Search code examples
ruby-on-railspaypal-rest-sdk

How to implement new version of PayPal payment gateway using REST application?


I am pretty new to rails and was trying to implement paypal payment gateway in my project.I have seen alot of guides but most of them are very old and have not explained each step.Can somebody please guide me how to do it with the new version of it.it would be helpful if you could explain both client side and server side integration in detail.


Solution

  • Use this front-end: https://developer.paypal.com/demo/checkout/#/pattern/server

    It will call two routes on your server, which you need to set up and create.

    One of those routes will call the PayPal API to 'Set Up Transaction', and the other will 'Capture Transaction'. The guide for that is here: https://developer.paypal.com/docs/checkout/reference/server-integration/

    The Ruby SDK to use for those API calls to PayPal is here: https://github.com/paypal/Checkout-Ruby-SDK