I am using Woocommerce for backend and react js for the front end. Since woocommerce is supported with apis, I am trying to integrate PayPal for payment gateway. Default WordPress themes work with woocommerce are making the payment in the following flow.
- When Pay with PayPal button clicked order placed with payment status pending
- Redirects user to PayPal payment site with order id and cart amount
- When the user completes payment, the user gets redirected to the order placed page.
- The previously placed order status get updated to appropriate response from Paypal as Processing or Cancelled
My question is How can I achieve this process with REST API.
Is it best to use client-side integration or server-side integration? If using client-side integration, will there be any vulnerability? How can I confirm that the user paid the value of the cart?