Trying the "Smart Payment Button" but how ot edit it after you logout?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using the "Smart Payment Button" and it works, but my problem is I can't find the way to make changes to in after logout. Right now I would have to create the button again if I want to make changes to the description and pricing. I'm NOT talking about the regular buttons, I'm taking about the "Smart Payment Button"; any help will be appreciated. Thank you.
- Labels:
-
PayPal HTML Buttons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Those values are in the code that it gives you. For example, I just generated smart button code from my sandbox account and it gave me this:
<div id="smart-button-container">
<div style="text-align: center;">
<div id="paypal-button-container"></div>
</div>
</div>
<script src="https://www.paypal.com/sdk/js?client-id=AfDRarIYpaffeXRArUxdaNvyo9xTj8rIHcrNA3rjGEe1mwe5YHS8_y63KHySLjkYtBlndiPcPHYNu7H4&enable-funding=venmo¤cy=USD" data-sdk-integration-source="button-factory"></script>
<script>
function initPayPalButton() {
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'paypal',
},
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{"description":"This is the item description.","amount":{"currency_code":"USD","value":110,"breakdown":{"item_total":{"currency_code":"USD","value":100},"shipping":{"currency_code":"USD","value":5},"tax_total":{"currency_code":"USD","value":5}}}}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(orderData) {
// Full available details
console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));
// Show a success message within this page, e.g.
const element = document.getElementById('paypal-button-container');
element.innerHTML = '';
element.innerHTML = '<h3>Thank you for your payment!</h3>';
// Or go to another URL: actions.redirect('thank_you.html');
});
},
onError: function(err) {
console.log(err);
}
}).render('#paypal-button-container');
}
initPayPalButton();
</script>
Inside of that you'll find the createOrder element, which looks like this:
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{"description":"This is the item description.","amount":{"currency_code":"USD","value":110,"breakdown":{"item_total":{"currency_code":"USD","value":100},"shipping":{"currency_code":"USD","value":5},"tax_total":{"currency_code":"USD","value":5}}}}]
});
},
That is where you can adjust your description, item pricing, shipping, tax, etc.
Hope that helps!
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- where does paypal payments go to if there is no linked phone or email to the seller ? in PayPal Payments Standard
- Couldn't receive International payment in PayPal Payments Standard
- Is it possible to make payments in RON (Romanian Leu) through PayPal? in REST APIs
- My PayPal is not allowing me to receive or send requests. in PayPal Payments Standard
- "System error. Please try again later" when connecting to paypal sandbox account with my android app in Sandbox Environment