My eCommerce platform charges the customer when the item ships, not when it is ordered. Would this be the correct flow to do this? Note that customer's can pay using CardFields or PaypalButtons.
First I create a POST request to${process.env.PAYPAL_ENDPOINT}/v2/checkout/orders
to create the order. The intent is set to "AUTHORIZE".
Then I send the order ID back to my frontend to pass it to onApprove.
Then no other calls are made until we ship the product. This can be days later. Then a POST request is made to ${process.env.PAYPAL_ENDPOINT}/v2/checkout/orders/${req.body.paypalOrderId}/capture
.
I thought I would have to confirm the order, but it says I am missing a parameter, but payment_source should be attached on its own in the frontend to my understanding (unless I am approved to collect it on my own, which I am not).
This method does work when capturing it immediately, but I'm unsure if it will work in, for example, 28 days which is the max number of days to capture a payment.