Im trying to add a smart button paypal thingy into my website but its not working at all. only sandbox works but when i try out live the paypal button closes and the debit card one just doesnt work. CLIENT ID: AV7cr98Ra5RK32to64KTmF7VM6fo23xu2_eJvdaFbOusn_YxJEmu-WUU_AN1TDdjpUTOq-sNjAyKTWve SOURCE CODE: <!DOCTYPE html> <html lang="en"> <head> <!-- Add meta tags for mobile and IE --> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title> PayPal Checkout Integration | Client Demo </title> </head> <body> <!-- Set up a container element for the button --> <div id="paypal-button-container"></div> <!-- Include the PayPal JavaScript SDK --> <script src="https://www.paypal.com/sdk/js?client-id=AV7cr98Ra5RK32to64KTmF7VM6fo23xu2_eJvdaFbOusn_YxJEmu-WUU_AN1TDdjpUTOq-sNjAyKTWve¤cy=USD"></script> <script> // Render the PayPal button into #paypal-button-container paypal.Buttons({ // Set up the transaction createOrder: function(data, actions) { return actions.order.create({ purchase_units: [{ amount: { value: '88.44' } }] }); }, // Finalize the transaction onApprove: function(data, actions) { return actions.order.capture().then(function(orderData) { // Successful capture! For demo purposes: console.log('Capture result', orderData, JSON.stringify(orderData, null, 2)); var transaction = orderData.purchase_units[0].payments.captures[0]; alert('Transaction '+ transaction.status + ': ' + transaction.id + '\n\nSee console for all available details'); // Replace the above to 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'); }); } }).render('#paypal-button-container'); </script> </body> </html>
... View more