Subscription with PayPal Button is not working in Sandbox env

IgorBox
Contributor
Contributor


Hi!

I am testing Paypal and Subscription API, and finished with this error msg:
sandbox sorry we weren't able to set up preapproved payments at this time.
What I did:
1. Created a dev environment and test accounts
2. Created products and plans for them via Subscription API
3. Created a page on Heroku with Smart Payment button

Was following this doc: https://developer.paypal.com/docs/subscriptions/integrate/#render-the-smart-payment-button

4. Opened my page and click on Smart Payment button
5. Put in creds of test account in Paypal popup

6. And what I see next is this error msg - sandbox sorry we weren't able to set up preapproved payments at this time.
Here is a video of my steps:
https://monosnap.com/file/J1J9LNj6wGO9k7FZJuoX4y1PZ9HQ9H
I tried to create different test accounts, had read all the docs and now result.
What I am doing wrong? Please help! 😞

Login to Me Too
5 REPLIES 5

MTS_Jennifer
Moderator
Moderator

Hello,

Thank you for posting to the PayPal Sandbox Community.

Can you please comment your Sandbox Merchant ID? I can look at the back end logs to see the root cause of the error message.

Also the buyer account has to approve the Billing Agreement.

Its possible that you may need to have Reference Transactions enabled on the Sandbox Account.

Thank you,

Jennifer

PayPal

Login to Me Too

IgorBox
Contributor
Contributor

Thanks, for a quick response! I will check your recommendations, and

my sandbox:

client-id=AX668KhGIS4VeDAa75MVU1aW9JtBDKIFVPqqtntdOmwuPaOBpuz-_0PK0DaaVu4dgwcMWeStxkn0Kyhh

 

Login to Me Too

IgorBox
Contributor
Contributor

HI @MTS_Jennifer,
Did a little research and found from PayPal docs that  - Reference Transactions are enabled by default on Sandbox accounts that were created after December 15, 2015.
Also from Subscriptions API docs - Note: You cannot integrate the Subscriptions API with the Billing Plans and Billing Agreements APIs.

So not sure what I should do next, hope you will find something in logs. Thanks and waiting for your reply.

my sandbox:

client-id=AX668KhGIS4VeDAa75MVU1aW9JtBDKIFVPqqtntdOmwuPaOBpuz-_0PK0DaaVu4dgwcMWeStxkn0Kyhh

 

 

Login to Me Too

MTS_Jennifer
Moderator
Moderator

Hello,

Thank you for providing the information on your Sandbox Account. It looks like you are creating the billing plan and the subscription with no issues, however, the customer approval is missing.

In the response a URL like this one is created: I changed the Billing Agreement ID so this is not valid right now.

https://www.sandbox.paypal.com/webapps/billing/subscriptions?ba_token=BA-9SB890658E7440744

When you create the subscription and you get a URL like this one in your response, go to the URL, login as the buyer and subscribe.

Once this step is completed the Billing Agreement and Subscription will be fully created and setup.

Thank you,

Jennifer

PayPal

Login to Me Too

IgorBox
Contributor
Contributor

Ok thanks, I will check.

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.