489495df
* $transaction = MyClass::saveTransaction($some_data); * $txn_id = $transaction->getId(); *
* $paymentId = $_GET['paymentId']; * $payerId = $_GET['payerId']; * * // Once the transaction has been approved, we need to complete it. * $transaction = $gateway->completePurchase(array( * 'payer_id' => $payer_id, * 'transactionReference' => $sale_id, * )); * $response = $transaction->send(); * if ($response->isSuccessful()) { * // The customer has successfully paid. * echo "Step 4 was successful!\n"; * } else { * // There was an error returned by completePurchase(). You should * // check the error code and message from PayPal, which may be something * // like "card declined", etc. * } *