Monday 15 September 2014

node.js - Return url doesn't work with PayPal and NodeJS -



node.js - Return url doesn't work with PayPal and NodeJS -

my homecoming url not working paypi-rest-sdk , nodejs.

page after payment : https://space.zeo.net/g/2x2n1

and page should : http://www.mywebsite.fr/confirm

class="lang-js prettyprint-override"> var payment = { "intent": "sale", "payer": { "payment_method": "paypal" }, "redirect_urls": { "return_url": paypalconfigs.returnurl, "cancel_url": paypalconfigs.cancelurl+request.user.id }, "transactions": [{ "amount": { "total": total, "currency": "eur" }, "description": "commande printwithlove" }] }; paypal.payment.create(payment, function (error, payment) { if (error) { console.log(error); } else { if(payment.payer.payment_method === 'paypal') { request.session.paymentid = payment.id; var redirecturl; for(var i=0; < payment.links.length; i++) { var link = payment.links[i]; if (link.method === 'redirect') { redirecturl = link.href; } } response.redirect(redirecturl); } } });

hey seek creating payment using developer.paypal.com/webapps/developer/docs/integration/direct/… i.e. sending curl requests. if able , redirection works, can eliminate beingness issue business relationship settings or credentials , homecoming url formatted. seek samples github.com/paypal/rest-api-sdk-nodejs/samples, if samples work issue app.

eshan's suggestion issue here too.

node.js paypal paypal-rest-sdk

No comments:

Post a Comment