cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

PayPal Smart Buttons are not working on my website; transaction not posting.

whitecfb
Contributor
Contributor

I've created a PayPal Smart Button and copied the HTML code to my website. When I do a test, it lets me enter all of the information for shipping, billing, and payment into the fields and concludes the transaction with a "Thank you for your payment" notification.  However, the transaction is not showing up in my PayPal account. No funds are transferred and no email notification is sent to us from PayPal.  TEST FAILED!

 

Here is the HTML code that PayPal told me to copy to my website...

 

<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=sb&enable-funding=venmo&currency=USD" data-sdk-integration-source="button-factory"></script> <script> function initPayPalButton() { paypal.Buttons({ style: { shape: 'rect', color: 'silver', layout: 'vertical', label: 'pay', }, createOrder: function(data, actions) { return actions.order.create({ purchase_units: [{"description":"2022 White County, Illinois Plat Book","amount":{"currency_code":"USD","value":50.2,"breakdown":{"item_total":{"currency_code":"USD","value":40},"shipping":{"currency_code":"USD","value":7},"tax_total":{"currency_code":"USD","value":3.2}}}}] }); }, 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>

 

I'm not sure what else I need to do.  Thanks for assisting!

Login to Me Too
Who Me Too'd this topic