PayPal API Subscription Shows 0 (zero) as the purchase total

Viewed 71

I'm using the PayPal API from PHP/Laravel and the purchase total is bugged. It results in a payment with the correct amount from the credit card, but when showing the amount to the customer during checkout, it only shows a 0 total

checkout screenshot

1 Answers

Do not include a start_time (date) when creating the subscription.

https://prnt.sc/pOK5-7v5ZYMY

You should always uput text in code blocks, either with indentation or surrounded by three backticks, ``` before and after the code. Never take a screenshot of code.

It would appear you are using the old PayPal-PHP-SDK, which is deprecated. Do not use it for anything. (separately, that SDK also uses an older version of PayPal Subscriptions with billing agreements; current Subscriptions API does not use agreements).

The current version of PayPal Subscriptions integrations is documented here. There is no REST SDK for it. For any API calls, you can use direct HTTPS REST calls, first obtaining an access_token using the client id and secret. (If you need sample code for that, the current Checkout-PHP-SDK's classes or functions might be useful as a base, but it does not include support for Subscriptions API calls, which you need to write yourself)

Related