Trying to work with @paypal/react-paypal-js and I can't quite wrap my head around the documentation. I followed this tutorial:
https://github.com/paypaldev/PayPal-React-FullStack-Standard-Checkout-Sample/ using an express backend and made one-time purchases work on my website.
Then I've followed this guide for createSubscription: https://developer.paypal.com/docs/subscriptions/integrate/#3-create-payment-button
And seems like there's no need to capture the transaction as opposed to createOrder, does "onApprove" do it automatically?
Once I made the first subscription I tried the /v1/billing/subscriptions/ endpoint and got some useful links for devs in the reponse.
One of them being:
href: 'https://api.sandbox.paypal.com/v1/billing/subscriptions/I-CN85GKVK2872/capture',
rel: 'capture',
method: 'POST'
Is onApprove enough on its own? Is there any error handling I should be doing?