Using the Java REST-SDK question - Capture vs Authorize questions

hfPPDev
New Community Member

Hi,

  I'm trying out the java SDK that works on top of the REST API.  I'm a bit confused about the flow, and whether to create an order with CAPTURE or AUTHORIZE intent.  First off, can someone explain when you would use one versus the other?

   Now, assuming I use the capture intent, I've done the following:

1) My Spring application presents a page with a shopping basket and a button to confirm;

2) On clicking the button, my spring controller(java class that responds to POST request) will call methods in the Java SDK to build an order, and sends it to Paypal - I'm using CAPTURE rather than AUTHORIZE;

3) My app receives a response back with the order ID and a URL for the user to call, my app then forwards the user's browser to that URL

4) user fills in their paypal info (I use one of my developer test accounts) and clicks continue;

5) Paypal then forwards to a URL I pass (this is an http GET request with myurl.domain/myuri?token=.....)

6) I have a controller (Java class that responds to the above URL) that then performs a CAPTURE request on the existing order (once again using Java SDK to build the REST request);

7) I get a response back from paypal for the order with a STATUS of COMPLETE;

 

This looks like a fairly complete flow. The thing is, on the test account, I never see any money withdrawn from my test account in Paypal.  I feel like I'm missing a step in this flow or I'm doing something wrong. Can someone tell me at least if in theory the steps above are correct, and also at what point I would see money leave my test account in paypal?

Thanks in advance

-Hugh

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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