Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PaypalApiPayment;
- use PaypalApiPaymentExecution;
- require 'app/start.php';
- if(!isset($_GET['success'], $_GET['paymentId'],$_GET['PayerID'])) {
- die();
- }
- if ((bool)$_GET['success'] === false){
- die();
- }
- $paymentId = $_GET['paymentId'];
- $payerId = $_GET['PayerID'];
- $payment = Payment::get($paymentId, $paypal);
- $execute = new PaymentExecution();
- $execute->setPayerId($payerId);
- try {
- $result = $payment -> execute($execute, $paypal);
- } catch (Exception $e) {
- die($e);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement