Search code examples
node.jspaypalkillbill

Paypal integration issue with KillBill in a node app


I am trying to integrate paypal payment gateway in my Node app in which i'm calling KillBill api provided for Paypal gateway in itsw documentation it is described that we will recieve a url in location header. But on hitting it in postman i'm recieving html of that page instead of its url in Headers with key "location". How to integrate it in node app so that if i make request to its url i get back the url of page to be redirected and can do anything i want. KillBill docs link https://github.com/killbill/killbill-paypal-express-plugin

following is the api i'm using of paypal integration provided by kill bill

curl -v \ -X POST \ -u admin:password \ -H 'X-Killbill-ApiKey: bob' \ -H 'X-Killbill-ApiSecret: lazar' \ -H 'X-Killbill-CreatedBy: admin' \ -H 'Content-Type: application/json' \ -d '{ "kb_account_id": "13d26090-b8d7-11e2-9e96-0800200c9a66", "currency": "USD", "options": { "return_url": "http://www.google.com/?q=SUCCESS", "cancel_return_url": "http://www.google.com/?q=FAILURE", "billing_agreement": { "description": "Your subscription" } } }' \ http://127.0.0.1:8080/plugins/killbill-paypal-express/1.0/setup-checkout


Solution

  • I have sort it some way i just converted that response html into a circular Json array and than found the URL of that html page in some index of that array as a key value pair of an object. Don't know that if it is a perfect solution but it works fine and according to my requirements.