0

I am working on Paypal webhook (subscription) section to insert recurring payment information into the database. I have done coding based on the link "https://jslim.net/blog/2018/01/22/PayPal-Rest-API-with-Laravel-5-and-Angular/" but Paypal webhook always return “payment_status: Pending” on sandbox image and its not inserting recurring payment information into the database (insert option added in PayPalController - function webhooksPaymentSaleCompleted ).

I think the problems related with routes/api.php file but I can't figure out what exactly is going wrong.

Another URL that I have referred and tried was "https://github.com/supermavster/PayPal-PHP-SDK"

Laravel version 5.8 paypal/rest-api-sdk-php: "^1.14"

Please suggest a feasible solution to this problem.

Thanks in advance.

Sugesh
  • 1
  • 4

1 Answers1

0

Verify that the sandbox account's email is confirmed, by logging into the sandbox business account receiving the payment and navigating to: https://www.sandbox.paypal.com/businessprofile/settings/email

Resend the confirmation message. Open the message via https://developer.paypal.com/developer/notifications/ , and confirm the sandbox email.


The v1 PayPal-PHP-SDK is deprecated and there is no reason to be using it for a new integration. Use the v2 Checkout-PHP-SDK for payments.

You'll need two routes on your server, one for 'Set Up Transaction' and one for 'Capture Transaction', documented here; https://developer.paypal.com/docs/checkout/reference/server-integration/

The best approval flow to pair it with is https://developer.paypal.com/demo/checkout/#/pattern/server

Preston PHX
  • 27,642
  • 4
  • 24
  • 44
  • Thanks, @Preston PHX. this is for a subscription payment. subscription section working fine. can I use the same for the webhook part (to capture recurring payment information)? – Sugesh Sep 28 '20 at 04:47
  • How can I use Smart Payment Button for a subscription? – Sugesh Sep 28 '20 at 06:03
  • The guide for subscriptions is at https://developer.paypal.com/docs/subscriptions/integrate/ , and includes instructions for use with a Smart Payment Button. Webhooks are a separate integration from all the above. – Preston PHX Sep 28 '20 at 07:04