ng4-paypal-button
ng4-paypal-button copied to clipboard
angular 4 and paypal with Server Side REST
how to implement angular4 code with Server Side REST ?
https://developer.paypal.com/demo/checkout/#/pattern/server
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.
thanks for your answer, I will try it.
how to add auth token to my server url?
I believe for REST API it is
yoururl.com/foo/bar?access_token=yourtoken
Have you found any source or example for paypal in angular 4/5 with server side?
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 .