PayPal REST API (PHP SDK) successful transactions not showing in sandbox mode, showing in live mode

百般思念 提交于 2019-12-12 14:33:15

问题


I'm using the Paypal PHP REST API SDK, following exactly the samples provided by PayPal here to CREATE and CAPTURE an order.

The steps are:

  1. Create an order and retrieve the express checkout URL ( http://paypal.github.io/PayPal-PHP-SDK/sample/doc/payments/OrderCreateUsingPayPal.html ).

  2. Enter the retrieved URL, login to my PayPal's sandbox buyer account, and approve the payment. This redirects me to the success URL.

  3. Execute the order ( http://paypal.github.io/PayPal-PHP-SDK/sample/doc/payments/OrderGet.html ).

  4. Capture the payment ( http://paypal.github.io/PayPal-PHP-SDK/sample/doc/payments/OrderCapture.html ).

All steps are successful and I catch no exceptions, and the Payment and Order states are good (Order is "completed" and Payment is "approved").

The transaction is happening and I can see the money is being transferred between the test buyer account and the seller under the Sandbox Accounts settings.

BUT, the successful transactions DO NOT show up under Sandbox Transactions in https://developer.paypal.com/developer/dashboard/sandbox/ . The failed transactions DO show up there (e.g. if I try to capture the same payment twice).

If I switch to live mode, it all goes exactly the same except the successful transactions DO show up under Live Transactions. The transaction is being made and the order shows in my account and the buyer's account as "completed".

Am I doing something wrong, or is there something wrong with PayPal's sandbox? Why doesn't the sandbox reflect what really happens in live mode?

Also, the receipt for the captured order is never sent in either mode. The only email sent is:

You submitted an order in the amount of x.xx to MyBusiness

and it clearly states the payment is not charged yet. So basically nothing tells the buyer he paid any money.


回答1:


It appears that this is actually the intended behaviour.

I found these links (some are quite old):

  • https://www.paypal-community.com/t5/Selling-on-your-website/Not-receiving-capture-funds-email-notifications/td-p/552038?profile.language=en-gb
  • http://www.e-junkie.com/bb/topic/3039#post8545
  • http://www.rdnassociates.com/newsletters/081217.pdf
  • http://eventhorizon1984.typepad.com/event_horizon_1984_blog/2008/12/paypal-ebay-important-paypal-is-eliminating-some-automatic-emails.html

which seems to indicate that PayPal deliberately neither sends an email to the buyer nor to the merchant when the payment is captured.

Some says that they received an email from PayPal similar to this:

Tired of email clutter? So are we. To make your life easier, we're eliminating some of the automatic emails we send after transactions. These changes will take effect on February 11, 2009. Though you will no longer receive certain emails, all transaction details will still show up in your PayPal account for your record keeping.

[…]

The emails we're discontinuing are:

  • […]
  • The email you receive when funds move out of your customer's PayPal account (Merchant capture email: ID# PP593)
  • The email your customer receives when funds move out of their PayPal account (Buyer capture email: ID# PP591)
  • […]

To see examples of these emails, visit www.paypal.com/discontinuedemails.

Thanks,
PayPal

You can do a search on [paypal "merchant capture email"] or [paypal "buyer capture email"] in your favourite search engine to find more like these.

I guess you have to send your own emails.

Here's a question that might be related, but I'm not 100% sure.



来源:https://stackoverflow.com/questions/32156374/paypal-rest-api-php-sdk-successful-transactions-not-showing-in-sandbox-mode-s

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