ng4-paypal-button icon indicating copy to clipboard operation
ng4-paypal-button copied to clipboard

angular 4 and paypal with Server Side REST

Open kandyjam opened this issue 7 years ago • 7 comments

how to implement angular4 code with Server Side REST ?

kandyjam avatar Sep 22 '17 08:09 kandyjam

https://developer.paypal.com/demo/checkout/#/pattern/server

kandyjam avatar Sep 22 '17 08:09 kandyjam

Currently do not have the time to test this myself, but try something like this:

Follow paypal's documentation for REST integration on the server side: https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/server-side-REST-integration/

Create a url on your server that makes a post request to the Payment API, with the JSON payload of the post request following this format: https://developer.paypal.com/docs/api/payments/#payment_create

Then in your paypal config:

// ...
payment: () => {
  let url: string = 'your_url';
  return paypal.request.post(url).then((res) => {
    return res.paymentID;
  });
}

With any luck your server will successfully get back a response containing an id from the API and can then send that ID back to the client, which gets passed to checkout.js.

Let me know if you make any progress on this.

KevinShiCA avatar Sep 22 '17 19:09 KevinShiCA

thanks for your answer, I will try it.

kandyjam avatar Sep 23 '17 00:09 kandyjam

how to add auth token to my server url?

kandyjam avatar Sep 27 '17 04:09 kandyjam

I believe for REST API it is yoururl.com/foo/bar?access_token=yourtoken

KevinShiCA avatar Sep 27 '17 04:09 KevinShiCA

Have you found any source or example for paypal in angular 4/5 with server side?

gfaganli avatar Jul 12 '18 11:07 gfaganli

yes, i get the answer on https://github.com/paypal/paypal-checkout/blob/master/docs/paypal-rest-api.md

On Thu, Jul 12, 2018 at 6:58 PM Gulnar Faganli [email protected] wrote:

Have you found any source or example for paypal in angular 4/5 with server side?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/KevinShiCA/ng4-paypal-button/issues/1#issuecomment-404488037, or mute the thread https://github.com/notifications/unsubscribe-auth/ALeUiwhYEtcdr9ZIixipBNKAG3n0Rrl0ks5uFzoAgaJpZM4PgZ1J .

agussuhardi-dev avatar Jul 14 '18 15:07 agussuhardi-dev