Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <?php
  2. use PayPal\Service\AdaptivePaymentsService;
  3. use PayPal\Types\AP\PayRequest;
  4. use PayPal\Types\AP\Receiver;
  5. use PayPal\Types\AP\ReceiverList;
  6. use PayPal\Types\Common\RequestEnvelope;
  7.  
  8. ini_set('display_errors', 1);
  9. error_reporting(E_ALL ^ E_NOTICE);
  10.  
  11. echo("0");
  12. require_once("../vendor/autoload.php");
  13. //apstudios apstestaps
  14.  
  15. echo("1");
  16.  
  17. $payRequest = new PayRequest();
  18.  
  19. echo("2");
  20.  
  21. $receiver = array();
  22. $receiver[0] = new Receiver();
  23. $receiver[0]->amount = "1.00";
  24. $receiver[0]->email = "austinjbsmith@gmail.com";
  25. $receiverList = new ReceiverList($receiver);
  26. $payRequest->receiverList = $receiverList;
  27.  
  28. echo("3");
  29.  
  30. $requestEnvelope = new RequestEnvelope("en_US");
  31. $payRequest->requestEnvelope = $requestEnvelope;
  32. $payRequest->actionType = "PAY";
  33. $payRequest->cancelUrl = "https://devtools-paypal.com/guide/ap_simple_payment/php?cancel=true";
  34. $payRequest->returnUrl = "https://devtools-paypal.com/guide/ap_simple_payment/php?success=true";
  35. $payRequest->currencyCode = "USD";
  36. $payRequest->ipnNotificationUrl = "http://trackyour.tips/scripts/pay.php";
  37.  
  38. echo("4");
  39.  
  40. $sdkConfig = array(
  41. "mode" => "sandbox",
  42. "acct1.UserName" => "jb-us-seller_api1.paypal.com",
  43. "acct1.Password" => "WX4WTU3S8MY44S7F",
  44. "acct1.Signature" => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy",
  45. "acct1.AppId" => "APP-80W284485P519543T"
  46. );
  47.  
  48. $adaptivePaymentsService = new AdaptivePaymentsService($sdkConfig);
  49. $payResponse = $adaptivePaymentsService->Pay($payRequest);
  50.  
  51. echo("5");
  52.  
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement