0
votes

I am using PayPal-php-sdk .I had successfully implemented recurring payment using this rest api . Currently the payment occurring in each end of the month. But I want to charge immediately when the user subscribe ie the first payment will charged when user subcribe the plan. How can I implement this ? Please any one help.

3

3 Answers

1
votes

I created mine to where I have a set up fee which charges immediately and then I set the regular payments to begin 1 month later.

$merchantPreferences->setReturnUrl("$baseUrl/paypal/ExecuteAgreement?success=true")
->setCancelUrl("$baseUrl/paypal/ExecuteAgreement?success=false")
->setAutoBillAmount("yes")
->setInitialFailAmountAction("CONTINUE")
->setMaxFailAttempts("0")
->setSetupFee(new Currency(array('value' => 8.50, 'currency' => 'USD')));

I hope this helps.

0
votes

It is likely that you are encountering a bug in the PayPal Sandbox.

Please report it to PayPal Merchant Support.

0
votes

If you don't offer free trial period the user must pay for the first cycle immediately. If you offer free trial period, you can control the sequence of the cycles to have the paid one first and then the trial one.