Determine if the user approved the payment or not
Get the payment Object by passing paymentId payment id was previously stored in session in CreatePaymentUsingPayPal.php
PaymentExecution object includes information necessary to execute a PayPal account payment. The payer_id is added to the request query parameters when the user is redirected from paypal back to your site
If you wish to update the amount that you wish to charge the customer,
based on the shipping address or any other reason, you could
do that by passing the transaction object with just amount
field in it.
Here is the example on how we changed the shipping to $1 more than before.
Add the above transaction object inside our Execution object.
Execute the payment
(See bootstrap.php for more on ApiContext
)
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
Execute Payment Sample
This is the second step required to complete PayPal checkout. Once user completes the payment, paypal redirects the browser to "redirectUrl" provided in the request. This sample will show you how to execute the payment that has been approved by the buyer by logging into paypal site. You can optionally update transaction information by passing in one or more transactions. API used: POST '/v1/payments/payment//execute'.