Quantcast
Channel: Active questions tagged paypal - Stack Overflow
Viewing all articles
Browse latest Browse all 514

Is this the correct flow for PayPal Payments?

$
0
0

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.


Viewing all articles
Browse latest Browse all 514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>