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 more