Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php
  2.  
  3. use PaypalApiPayment;
  4. use PaypalApiPaymentExecution;
  5.  
  6. require 'app/start.php';
  7.  
  8. if(!isset($_GET['success'], $_GET['paymentId'],$_GET['PayerID'])) {
  9. die();
  10. }
  11.  
  12. if ((bool)$_GET['success'] === false){
  13. die();
  14. }
  15.  
  16. $paymentId = $_GET['paymentId'];
  17. $payerId = $_GET['PayerID'];
  18.  
  19. $payment = Payment::get($paymentId, $paypal);
  20. $execute = new PaymentExecution();
  21. $execute->setPayerId($payerId);
  22.  
  23. try {
  24. $result = $payment -> execute($execute, $paypal);
  25. } catch (Exception $e) {
  26. die($e);
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement