Transaction vs Authorization

deni6052
New Community Member

Hello everyone,

 

in this guide there is a section for setting up transactions and authorizations but they both use the createOrder method. I was wondering do I have to implement both or is it just two different types of purchasing (if so what's the difference)?

 

Thank you in advance.

Login to Me Too
1 REPLY 1

shawnz
Contributor
Contributor

Here's my understanding: When they say 'transaction' on that page they really mean 'order'. You create an order, which is like an invoice that specifies how much the client must pay. Then, you use the javascript SDK to show the checkout process to the user and allow them to pay for that order.

 

What comes next depends on what you set the INTENT to when making the order. If the INTENT was CAPTURE, then the next step is to call the order capture API which, if successful, means the money was put in your account (as far as I understand). No authorizations are involved in that flow.

 

See: https://developer.paypal.com/docs/api/orders/v2/#orders_capture .

 

If you created the order with an INTENT of AUTHORIZE, then the next step after checkout is to create an authorization, which represents a hold on the client's funds. You can then capture the authorization at a later date which actually takes the money from the client. I believe the purpose of the INTENT=AUTHORIZE flow is so that you can charge the user in advance of checking the stock of all the items in their order, etc. However I haven't used that flow personally.

 

See: https://developer.paypal.com/docs/api/orders/v2/#orders_authorize and then https://developer.paypal.com/docs/api/payments/v2/#authorizations_capture .

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.