[BUG] Must pass vault=true to sdk to use createSubscription
See original GitHub issueTo 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:
- Created 4 years ago
- Reactions:1
- Comments:7
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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
For fix this you have to manually import paypal js file.
Add this in index.html or import this with HOC.