paypal交易历史记录创建额外的定期付款

paypal交易历史记录创建额外的定期付款,paypal,paypal-sandbox,Paypal,Paypal Sandbox,我正在使用paypal循环gem: 用于RubyonRails应用程序 以下是我的代码的选定部分: def make_recurring process :request_payment if @plan create_units process :create_recurring_profile, period: @plan.recurring, amount: (@plan.price), frequency: 1, start_at: Tim

我正在使用paypal循环gem:

用于RubyonRails应用程序

以下是我的代码的选定部分:

 def make_recurring

    process :request_payment

    if @plan
      create_units
      process :create_recurring_profile, period: @plan.recurring, amount: (@plan.price), frequency: 1, start_at: Time.zone.now        
    end
  end


 def process(action, options={})
    not_recurring_amount =  @cart.total_price  
    not_recurring_amount += 19.95 if @plan #add activation price for first payment

    options = options.reverse_merge(
      token: @order.paypal_payment_token,
      payer_id: @order.paypal_customer_token,
      description: "Your product total is below",
      amount: not_recurring_amount.round(2),
      currency: "USD"
    )

    response = PayPal::Recurring.new(options).send(action)
    raise response.errors.inspect if response.errors.present?
    response
  end
从本质上讲,用户购买一种产品,并收取239.95美元的费用。然后,用户购买一个一次性激活的产品计划,并收取33.95美元的费用。这些都是一次性付款。然后,当他们购买该计划时,他们还将收取该广播时间计划每月14.95美元的定期费用。一切似乎都正常,但我注意到在我的paypal沙箱帐户中,另一项经常性收费为空白:


为什么会出现空白收费?

这不是实际收费,只是创建配置文件的记录。您必须先创建一个配置文件,然后才能对其收费。正如您所看到的,这反映在贝宝帐户中。

那么我所做的是否正确?我不确定结果是否符合我的预期。你所做的看起来是正确的。但是,关于一次性设置费用33.95,您可以将其作为配置文件的一部分,仅对其进行一次收费,但不将其作为定期定期配置文件更改的一部分。当您创建概要文件时,如果您使用的是NVP,您只需使用变量INITAMT设置该金额。您还可以使用变量FailedInputAction来设置操作。