简体   繁体   中英

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:

  • Account is set to accept money in any currency
  • The seller account has digital goods enabled (created via automated process)
  • Both accounts are verified
  • The buyer account has a credit card as well as a paypal balance
  • Both accounts are US based
  • I've tried with multiple accounts

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'
);

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM