nov / paypal-express

Ruby Gem for PayPal Express Checkout API
MIT License
374 stars 163 forks source link

Add "activation" in the param of recurring payment init, so it will charge 1 immediately upon complete. #91

Open lovesmall opened 8 years ago

lovesmall commented 8 years ago

Related to issue #51.

I think current recurring payment won't charge immediately (for the first month) upon complete. And I found add a "activation" param to make it happen (am I wrong?). Since it's quite normal to charge immediately for recurring payments, maybe can add this option in the wiki docs?

Paypal::Payment::Recurring.new(
      start_date: SET_YOUR_OWN,
      description: SET_YOUR_OWN,
      activation: {
        initial_amount: SET_YOUR_OWN
      },
      billing: {
        period: :SET_YOUR_OWN,
        frequency: SET_YOUR_OWN,
        amount: SET_YOUR_OWN
      }
    )
rgo commented 8 years ago

Be careful, in our experience paypal sandbox doesn't work exactly as production. Recurring payments are done with a delay (one day or more).

If you use initial_amount in sandbox it works as expected more or less(it charges at the first time) but in production it charges both amounts(initial_amount + amount).

It seems to be the same experience for others users as you can read in this comment:

https://github.com/nov/paypal-express/issues/51#issuecomment-68234257

lovesmall commented 8 years ago

I've just check our current payment history, so far so good for production use with initial amount. No double charge on the first month. I'll check more detail later.