using the express checkout javascript. most of the time i get the message
Failed to load resource: the server responded with a status of 400 (Bad Request)
but not always... sometime it seems to work.. but even then it does not call my own success function paypal_thankyou() which is included in the javascript.
Now i switched back to
window.alert("Danke f眉r Ihre Paypal-Zahlung!");
but even this does not work...
I tried the interactive demo but its not working on my own webspace...
i googled a lot and i waited some days (because i read that this might help) - no change. Just not working.
Can you share your full code?
`
echo "
Zahlen Sie jetzt bequem per Paypal.
paypal.Button.render({
env: 'sandbox', // Or 'production' | 'sandbox'
client: {
sandbox: 'Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
production: 'Ayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
},
commit: true, // Show a 'Pay Now' button
payment: function(data, actions) {
return actions.payment.create({
transactions: [
{
amount: {
total: '<?php echo round($sum_total,2); ?>', // = 22.34
currency: 'EUR'
},
"description": "Ihr Einkauf bei XYZ.",
"invoice_number": "<?php echo stripslashes($invoice_number); ?>"
}
]
});
},
onAuthorize: function(data, actions) {
return actions.payment.execute().then(function(payment) {
window.alert("Danke f眉r Ihre Paypal-Zahlung!");
});
}
}, '#paypal-button');
`
Did you add your own client id in the client section in place of xxxxxxxxxxx and yyyyyyyy?
yes. i just replaced it here
Could you please share the code with the client ids, so I can try it? They're totally safe to share.
sandbox Ab3fN0ev3AvoYBYR8kgsXBLV8YTx7tu4beh2LmHLrUFYsDKU2DWA0Y_CGO-cWodF_fKXPdsioW4gHHUh
I tried your client id here: http://bluesuncorp.co.uk/icv4/test.htm
It seems to work pretty consistently for me. Can you try on that page?
hello,
yes it works on that page and even on the paypal test page.
but not on my own page. maybe an ssl issue?
Do you have a live version of that page I can try?
Do you see any javascript errors in the console?
no, sorry, there is no life version at the moment.
I get the error that i mentioned above.
Failed to load resource: the server responded with a status of 400 (Bad Request)
funny... because now, after about a week, its working... without a change.
I have to improve the paypal_thankyou() function now and hope that it will work.
thanks therefore!
Awesome! Going to close this issue. Please let me know if you run into any more.
the reason is probably that the "invoice number" cannot be used twice or more.
Thanks @kiliandr I was going crazy with this same problem. It turns out you are right. In the testing site I was same invoice so it works once and then doesn't work.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
the reason is probably that the "invoice number" cannot be used twice or more.