ruinernix
ruinernix

Reputation: 690

Paypal Sandbox recurring payment with initial amount pending

I'm using the PHP library here to create a new subscription profile. If I set an initial amount, the profile appears as "Pending".

Example:

Pending
Customer Mark Wally Verified
Profile start date Feb 18, 2013 | Profile ID I-BE824P6F9PER

On the other hand, if I set no initial payment amount, the profile will be "Active". I am setting the initial payment and the start date 1 month in the future since I want to bill monthly and get a payment right away.

I've already verified:

Any help would be greatly appreciated!

Code snippet to create the subscription that use the library listed above:

$subscription_details = array(
  'description'    => 'Premium membership: $4.95 every 30 days',
  'initial_amount' => '4.95',
  'amount'         => '4.95',
  'period'         => 'Day',
  'start_date'     => gmdate( 'Y-m-d\TH:i:s', strtotime( '+30 day' ) ),
  'frequency'      => '30'
);

Upvotes: 11

Views: 3840

Answers (2)

ruinernix
ruinernix

Reputation: 690

Just in case someone else has this trouble, my findings are:

There is nothing to solve -- the sandbox is just really slow, sometimes it took a couple days for the profile to become active and send the IPN. In other words, sandbox isn't good to test these functions at all, just go live and refund a couple tests. Even live sometimes takes a bit of time... I've seen it take a few hours sometimes, so don't go crazy.

Upvotes: 10

Jimzie
Jimzie

Reputation: 737

From PayPal doco:

"By default, PayPal does not activate the profile if the initial payment amount fails. To override this default behavior, set the FAILEDINITAMTACTION field to ContinueOnFailure. If the initial payment amount fails, ContinueOnFailure instructs PayPal to add the failed payment amount to the outstanding balance due on this recurring payment profile.

If you do not set FAILEDINITAMTACTION or set it to CancelOnFailure, PayPal creates the recurring payment profile. However, PayPal places the profile into a pending status until the initial payment completes. If the initial payment clears, PayPal notifies you by Instant Payment Notification (IPN) that it has activated the pending profile. If the payment fails, PayPal notifies you by IPN that it has canceled the pending profile"

from https://cms.paypal.com/mx/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_WPRecurringPayments, just below Table 6.

Upvotes: 3

Related Questions