Angular 2 paypal

I am creating a new e-commerce project with angular 2 and firebase. My problem is how to integrate the paypal button, and when customers click on it, they will be redirected to paypal and will pay, and then redirect back to my website. At the moment, I am able to return back either they pay or cancel with the given return URL, as indicated in this github registry: https://github.com/musale/angular2-paypal The problem is how to receive data from PayPal in order to guarantee that the payment was successful before we can proceed with the order. I understand that we can get them either using PayPal IPN or PDT, but we can not do it using angular 2 firebase. Decisions, examples or suggestions will be appreciated.

+5
source share
2 answers

Thanks to everyone for the solutions, and here is our deferred solution: since Firebase manages the backend, it is not possible to configure the payment system on it, we install a lightweight nodejs express server hosted on the Google Cloud platform, which can communicate with paypal to receive IPP data from PayPal every time when our customer makes a payment. IPN data will be used to check with real-time data from Firebase and update the payment status on the client side.

+2
source

After the user completes the payment in PayPal, you can send them back to your site, and then put the boot message on the screen. Meanwhile, you will have the interval that your server will request if the transaction is completed.

Using PayPal IPN, PayPal will make an http call to the desired URL after the transaction, then you will need to receive POST data containing information about the transaction, send it back to PayPal to verify that they send it, and after that do what you want with information.

  • When you create a form for the PayPal button, use the "custom" hidden fields to identify the transaction (for example, it can be a user ID). PayPal we will send this data back using IPN, so when you select you can bind it to the correct user.

  • You need to determine your IPN address in PayPal settings

0
source

Source: https://habr.com/ru/post/1257753/


All Articles