I am trying to test a button to create a subscription. Here is the flow and the data: In the sandbox dashboard, I created a sandbox app and a business and personal account. I went into the sandbox business account and created a product and a subscription plan... so I have a valid and active plan_id. I am creating a ReactJS JSX web app. In my page component, I am loading the sdk via a promise method: let sdkUrl = "https://www.paypal.com/sdk/js?client-id=MY_SANDBOX_CLIENT_ID&vault=true"
const script = document.createElement('script');
script.type = "text/javascript";
script.src=src;
script.addEventListener('load', resolve);
script.addEventListener('error', reject);
document.head.appendChild(script)
In the render method of my component, assuming the script has successfully loaded, I render the following button: let PayPalButton = window.paypal.Buttons.driver("react", {React, ReactDOM});
<PayPalButton
createSubscription={(data, actions) => actions.subscription.create({'plan_id': "P-91C68062SP676092ALZDUTTY"})}
onApprove={(data, actions) => actions.subscription.get().then(details => console.log("onApprove:", data))}
onSuccess={(data, actions) => actions.subscription.get().then(details => console.log("onSuccess:", data))}
catchError={err => actions.subscription.get().then(details => console.log("catchError:", err))}
onError={err => actions.subscription.get().then(details => console.log("onError:", err))}
onShippingChange={(data, actions) => actions.subscription.get().then(details => console.log("onShippingChange:", data))}
onCancel={data => actions.subscription.get().then(details => console.log("onCancel:", data))}
/> I run the webpage and the button appears exactly as it should. I click the button and the PayPal checkout dialog appears asking me to login: I log in using my "personal" sandbox account that I created. Immediately upon clicking "Log In" I see the following: At this point, the dialog is stuck and never progresses. The dialog url at this point is as follows: /*
https://www.sandbox.paypal.com/checkoutnow?sessionID=012099b64e_mty6mde6mjm&buttonSessionID=5c387d19bf_mty6mde6mjg&fundingSource=paypal&buyerCountry=CA&locale.x=en_US&commit=true&clientID=AbWTlgcsukRa6ihm3dz5afywmp-d0WZOq1qPYYkCO9oB4-rQ1W2pz-mBsOFhHkWkWreYjfHHLbbUcOgM&env=sandbox&sdkMeta=eyJ1cmwiOiJodHRwczovL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QWJXVGxnY3N1a1JhNmlobTNkejVhZnl3bXAtZDBXWk9xMXFQWVlrQ085b0I0LXJRMVcycHotbUJzT0ZoSGtXa1dyZVlqZkhITGJiVWNPZ00mdmF1bHQ9dHJ1ZSIsInN0YWdlSG9zdCI6bnVsbCwiYXBpU3RhZ2VIb3N0IjpudWxsfQ&xcomponent=1&version=5.0.104&token=7K52873721966951E&arc=1#/checkout/genericError?code=UkVUUlk%3D
*/ Now, since this is the sandbox environment, I decided to test it using a live account. I had a friend enter his PayPal credentials and after clicking login, it successfully showed the "choose a payment method" screen. I did not proceed any further as I did not want to actually charge my friends account. It appears to be a sandbox only issue - but I really really want to test my PayPal button from start to finish to make sure everything is working, but I don't have the resources to test using a live account. Anyone have any ideas as to what is going on?
... View more