0

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

  • You cannot run pay-systems with webhooks from localhost, as the server that carries out the payments can never find you. You should run your code from a reachable server. – Ansjovis86 Oct 30 '19 at 14:10
  • It is working with Curl command perfectly. Hitting the paypal api and returning the location header with required URL then why not returning any Url to their site while hitting through postman or using axios my main question is that. – Ameer Hamza Oct 31 '19 at 05:23
  • while hitting through postman or using axios it is returning Html only of that page on which i want to redirec my site – Ameer Hamza Oct 31 '19 at 05:24

1 Answers1

0

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.