Multi-step checkout Process. User Logs in, and later settles payment

ShadowSword
Contributor
Contributor

I have worked with PayPal NVP many times in the past, and it appears that the REST behaves similarly (just a lot easier). Here is the workflow we are trying to accomplish https://www.screencast.com/t/VNczidWSlyc

 

Basically, we need to have the user:

  1. log into PayPal on the Cart Review Page.
  2. We receive the customer information (name and shipping address)
  3. The user is taken to the Order Confirmation Page, where we add Sales Tax
  4. We Settle the Payment for the total amount (Order + Shipping + Tax)

In BrainTree, they provided a Nonce that we would receive this, and then we use the Nonce to complete the transaction. In my experience prior, the whole payment process was a single flow that couldn't be broken.

 

We are looking at a hybrid of Client and Server side development on this, as we can pass values back to the server without an issue. I just wanted to make sure this flow is something that is possible.

 

It appears that based on this: https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/ I can probably hijack that Order Confirmation page to do what I am looking to dp

 

Thanks

 

 

 

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MTS_Martin
Moderator
Moderator

This can be done using REST APIs. the Flow is the same classic Express Checkout.
If you want to use Checkout JS, it'd look something like this:

1. Render Button using payment details.
2. Call your server in the payment function, create the payment and get a Pay-ID back.

3. Payment function launches, user logs in and authorizes payment.

4. Once payment is authorized, the checkout popup / iframe closes and the onAuthorize function is called

5. Within onAuthorize, you could call your server side again, retrieve the shipping details from the pay id and the pass it back to the client in JSON format.

6. The client will display the "order page" and once satisfied, can execute the payment by clicking a button, which will in turn call your servers execute function to execute the payment.

 

This should be it. See https://github.com/paypal/paypal-checkout/tree/master/docs for some examples. 

 

I've also created a very rough proof of concept that works with a classic integration's EC-Token (see: https://github.com/marsie84/computop-paypal-v4/blob/master/index.php )

View solution in original post

Login to Me Too
1 REPLY 1
Solved

MTS_Martin
Moderator
Moderator

This can be done using REST APIs. the Flow is the same classic Express Checkout.
If you want to use Checkout JS, it'd look something like this:

1. Render Button using payment details.
2. Call your server in the payment function, create the payment and get a Pay-ID back.

3. Payment function launches, user logs in and authorizes payment.

4. Once payment is authorized, the checkout popup / iframe closes and the onAuthorize function is called

5. Within onAuthorize, you could call your server side again, retrieve the shipping details from the pay id and the pass it back to the client in JSON format.

6. The client will display the "order page" and once satisfied, can execute the payment by clicking a button, which will in turn call your servers execute function to execute the payment.

 

This should be it. See https://github.com/paypal/paypal-checkout/tree/master/docs for some examples. 

 

I've also created a very rough proof of concept that works with a classic integration's EC-Token (see: https://github.com/marsie84/computop-paypal-v4/blob/master/index.php )

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.