What is the way to add paypal payment without papypal's button in V2
ambersariya
New Community Member
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Jun-01-2021
06:29 AM
I have the following cenario: On my website are different payment-options. First you choose the method, where by clicking on the paypal-button shout happens nothing. Only if you click then the order-and-pay-button it shout run the behavior of the paypal-button, with opening the paypal-dialog.
var wasLoaded = false;
function loadScript() {
if(wasLoaded) return;
wasLoaded = true;
var script = document.createElement('script');
script.type = 'text/javascript';
document.body.appendChild(script);
script.onload = function() {
paypal.Buttons({
// Set up the transaction
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '88.44'
}
}]
});
}, ...
load it to a hidden div.
}
script.src='https://www.paypal.com/sdk/js?client-id=SD&intent=capture&vault=false&commit=true';
}
by loading it to an hidden div. By clicking on order-and-pay I make button.click() to execute the paypal-stuff. But unfortunately the papypal-stuff is in a iframe, so I do not have access to it.
I could not find any hint in the paypal-specs. They wont always to use there button. How can I achieve this approach?
Labels:
- Labels:
-
PayPal HTML Buttons
0 REPLIES 0
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Paypal 4X credit : translated message & currency error in PayPal Payments Standard
- Unable to Retrieve Plan ID Related to a Subscription in REST APIs
- Need help to integrate PayPal Standard Checkout with Shopify in PayPal Payments Standard
- [UNPROCESSABLE_ENTITY], but payment went through in PayPal Payments Standard
- Security header is not valid error message in woo commerce in NVP/SOAP APIs