Paypal smart button (multiple buttons)
glcvr6
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Aug-13-2020
08:36 AM
Hello guys,
I am wondering is it possible to show/use multiple Smart buttons on website side by side?
I am trying to find a way but not so lucky so asking here.
I am using this code generated automaticaly:
<div id="paypal-button-container"></div>
<!-- <script src="https://www.paypal.com/sdk/js?client-id=sb¤cy=EUR" data-sdk-integration-source="button-factory"></script> -->
<script src="https://www.paypal.com/sdk/js?client-id=ARcbGj17hMo1yw4nEMDB5E-Y7W00gbie9F_zb0m--XCOjKWo4jIddFV9N5UzbluK-if61HLUVs0rQ7zC¤cy=EUR" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'pill',
color: 'gold',
layout: 'vertical',
label: 'buynow',
},
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '13.88'
}
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name + '!');
window.open('www.google.ba');
});
}
}).render('#paypal-button-container');
</script>
I have tried to change class of button : render('paypal-button-container'); to anything else like 'paypal' and then changing <div> class where it should show but nothing happens.
Is is even possible?
Labels:
Login to Me Too
- Labels:
-
PayPal HTML Buttons
1 REPLY 1
MTS_Andre
Moderator
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug-14-2020
03:04 AM
Hi Glcvr6, if you want to render more than one button you could just load the sdk once (<script src="https://www.paypal.com/sdk/js?client-id=... ... ...) and then call paypal.Buttons({ .. }).render()
multiple times.
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
- credit is not eligible unless vault=true in SDKs
- Payment confirmation button does not exist in PayPal Upgrade Community
- Cant get mobile number from details. object even though my paypal button mandates submission in Sandbox Environment
- Embed Button and Entire Page in PayPal Payments Standard
- How will PayPal API Endpoint Platform migration impact legacy buttons? in PayPal Payments Standard