question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Must pass vault=true to sdk to use createSubscription

See original GitHub issue

To Do First

  • [x ] Did you try latest release?
  • [ x] Did you look for existing matching issues?

Software Package Version: latest

Describe the bug Must pass vault=true to sdk to use createSubscription

Just trying to set up a Paypal Smart button, but getting this error, even though i am passing vault=true in the options prop

<PayPalButton
        options={{
        	'client-id': '/*...*/',
        	vault: true
        }}
        createSubscription={(data, actions) => {
	        return actions.subscription.create({
	            plan_id: 'P-XXXXXXXXXXXXXXX'
	        });
        }}
        onApprove={(data, actions) => {
        	// Capture the funds from the transaction
        	return actions.subscription.get().then(function(details) {
        	      // Show a success message to your buyer
        	      alert("Subscription completed");
                });
        }}
/>

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
crohde7707commented, Mar 13, 2020

While this might fix the issue, i disagree with this workaround, as the documentation on this module states that it accepts the vault parameter, which should bubble down to the script being pulled in. Adding the script manually also would cause it to load twice, since PaypalButton pulls in the script as well

1reaction
parmesh-shiroyacommented, Mar 13, 2020

For fix this you have to manually import paypal js file.

Add this in index.html or import this with HOC.

<script
    src="https://www.paypal.com/sdk/js?client-id={CLIENT_ID}&vault=true">
    </script>
Read more comments on GitHub >

github_iconTop Results From Across the Web

PayPal createSubscription: Must pass vault=true to sdk to use ...
When trying to use createSubscription with react-paypal-button-v2, I'm getting this error, despite passing vault=true. Uncaught Error: Must ...
Read more >
How does one resolve error message "Must pass vault=true to ...
Uncaught Error : Must pass vault=true to sdk to use createSubscription. The <script> tag in my top-level HTML file is:
Read more >
Must pass vault=true to sdk to use createSubscription-Reactjs
Coding example for the question PayPal createSubscription: Must pass vault=true to sdk to use createSubscription-Reactjs.
Read more >
Subscription with PayPal Checkout - Vault must be set to true ...
Hi, I am testing a recurring donation form for a client using PayPal ... it says Must pass vault=true to sdk to use...
Read more >
JavaScript SDK script configuration - PayPal Developer
then((paypal) => { // start to use the PayPal JS SDK script }) .catch((err) => { console.error( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found