Hello im trying to do a subscription for my app using paypal. I created the subscription plan and product in sandbox as it is still a test account. When I implement the codes into my ionic app, I get this error.
This is the script code that I added to the index.html
<script
src="https://www.paypal.com/sdk/js?client-id=qwe...&vault=true">
</script>
I have also added the code in my .ts page here
setTimeout(() => {
// Render the PayPal button into #paypal-button-container
<any>window['paypal'].Buttons({
// Set up the transaction
createOrder: function (data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: _this.data.paymentAmount
}
}]
});
},
// Finalize the transaction
onApprove: function (data, actions) {
return actions.order.capture()
.then(function (details) {
// Show a success message to the buyer
alert('Transaction completed by ' + details.payer.name.given_name + '!');
console.log(details)
})
.catch(err => {
console.log(err);
})
}
}).render('#paypal-button-container');
}, 500)
Inside the sandbox of my paypal account, I have enabled vault as well.
I am not really sure what else I can do to enable the vault to be true.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…