Subscription purchases w/sandbox do not work due to setup fee issues. Javascript SDK + REST APIs

Johnww2
Contributor
Contributor

1) Created sandbox app in 1/2024 time frame.
2) Create products and billing plans using REST API.  Can list billing plans and patch without issue.
3) Test subscription purchase with sandbox account.

4) If purchase a plan with setup fee of 0, encounter "Sorry cannot complete payment. Try other method" type error.

5) If purchase a plan with non zero setup fee, the purchase completes but PayPal eventually sends webhook message: BILLING.SUBSCRIPTION.PAYMENT.FAILED.

Catch 22. Subscription support cannot be implemented. Very Sad.


Why does purchase fail in case 3-4 - with any sandbox account I create and test with
Why does payment fail in case 5 - with any sandbox account I create and test with.

Browser: Brave, target location: Japan.   (Brave shields are down during purchase testing)

Login to Me Too
3 REPLIES 3

Johnww2
Contributor
Contributor

example of BILLING.SUBSCRIPTION.FAILED resource content:

{"quantity":"1","subscriber":{"email_address":"<sandbox_account_email_here>","payer_id":"ZLMLN9L8H37TU","name":{"given_name":"John","surname":"Doe"}},"create_time":"2024-01-12T17:45:51Z","custom_id":"511","plan_overridden":false,"shipping_amount":{"currency_code":"JPY","value":"0"},"start_time":"2024-01-12T17:45:31Z","update_time":"2024-01-12T17:55:12Z","billing_info":{"outstanding_balance":{"currency_code":"JPY","value":"880"},"cycle_executions":[{"tenure_type":"REGULAR","sequence":1,"cycles_completed":0,"cycles_remaining":0,"current_pricing_scheme_version":1,"total_cycles":0}],"next_billing_time":"2024-01-12T17:45:51Z","failed_payments_count":0,"last_failed_payment":{"amount":{"currency_code":"JPY","value":"17380"},"time":"2024-01-12T17:55:12Z","reason_code":"PAYMENT_DENIED","next_payment_retry_time":"2024-01-17T17:45:51Z"}},"links":[{"href":"https:\/\/api.sandbox.paypal.com\/v1\/billing\/subscriptions\/I-XMTG4J5XEMDC\/cancel","rel":"cancel","method":"POST","encType":"application\/json"},{"href":"https:\/\/api.sandbox.paypal.com\/v1\/billing\/subscriptions\/I-XMTG4J5XEMDC","rel":"edit","method":"PATCH","encType":"application\/json"},{"href":"https:\/\/api.sandbox.paypal.com\/v1\/billing\/subscriptions\/I-XMTG4J5XEMDC?fields=last_failed_payment","rel":"self","method":"GET","encType":"application\/json"},{"href":"https:\/\/api.sandbox.paypal.com\/v1\/billing\/subscriptions\/I-XMTG4J5XEMDC\/suspend","rel":"suspend","method":"POST","encType":"application\/json"},{"href":"https:\/\/api.sandbox.paypal.com\/v1\/billing\/subscriptions\/I-XMTG4J5XEMDC\/capture","rel":"capture","method":"POST","encType":"application\/json"}],"id":"I-XMTG4J5XEMDC","plan_id":"P-9A593240K55719903MWKZKWA","status":"ACTIVE","status_update_time":"2024-01-12T17:55:12Z"}


Given this is a sandbox account purchase, and the sandbox account user dashboard (when login) doesn't show any issues that should block a successful purchase, (and the CC/bank account is fake anyway) and the webhook message content received on our server side is pretty unhelpful, this is very a disappointing developer experience..

Login to Me Too

Kavyar
Moderator
Moderator

Good day @Johnww2 

 

Thank you for posting to the PayPal community.

 

I have tried to reproduce the issue and confirm that it is now working as expected.

 

I would suggest to please contact your website developer or the third party eCommerce support to cross check your using same SANDBOX  REST API Credentials(Client ID & Secret) while performing the below API calls.

 

https://developer.paypal.com/api/rest/authentication/

https://developer.paypal.com/api/rest/postman/ 

 

I recommend that you try again by triggering a new API request.

 

To assist you further, I have provided a detailed guide that includes step-by-step instructions. Please refer to the link below:

 

https://developer.paypal.com/docs/api/subscriptions/v1/

 

The "setup_fee" field is not mandatory and any value can be passed (including 0 or non-zero values). Kindly visit the following link- https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create!path=payment_preferences/setup_...

 

BILLING.SUBSCRIPTION.PAYMENT.FAILED webhook event will be triggered whenever a payment fails on a subscription.

 

For additional information, please refer to the detailed guide provided in the link below.

 

https://developer.paypal.com/api/rest/webhooks/event-names/#subscriptions 

 

If your still facing issues, please create an MTS ticket via -  https://www.paypal-support.com/s/?language=en_US  with the detailed information and error details.

 

Sincerely,

Kavya

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Johnww2
Contributor
Contributor

The above links were not helpful, as I had already thoroughly read the documentation and tried numerous strategies to get PayPal's broken JavascriptSDK to work.  Given that the version of the Javascript SDK which is used is highly dependent on the creation date of the sandbox app, it may work for some people, especially if their app was created last year.  I have a working and non working case deployed on each of 2 different servers, and the two systems are running the same code, with only different sandbox credentials and different creation dates (separate by 8 months or so.)

I already reported this issue on the customer support site, and after overcoming PayPal's first line support response trying to discourage me with similar "read the docs please" links, the issue appears accepted to escalate to some actual PayPal developer investigation.  If it turns out there is any mistake in my config, I will update the findings here, but I think I've made a case that I have found a PayPal site issue.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.