paypal transaction history creates an extra recurring payment

我的梦境 提交于 2019-12-12 00:27:30

问题


I'm using the paypal recurring gem:

https://github.com/fnando/paypal-recurring

for a ruby on rails application

Here's a selected portion of my code:

 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

Essentially, a user buys a product and gets charged 239.95. Then a user buys a plan for the product with a one time activation and gets charged 33.95. Those are both one time payments. Then when they buy the plan, they also get charged a 14.95 recurring monthly charge for that airtime plan. Everything seems to work but I notice in my paypal sandbox account another recurring charge that is blank:

Why is that blank charge happening?


回答1:


It is not an actual charge, its just a record of the profile being created. You have to first create a profile, before it can be charged. This is reflected in the PayPal account as you are seeing.



来源:https://stackoverflow.com/questions/16473088/paypal-transaction-history-creates-an-extra-recurring-payment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!