Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. Start validations:_notify-validate,16.94,Eligible,confirmed,SVWAAUVZX2S4Y,0.00,1 Main St,13:57:50 May 07, 2012 PDT,Completed,windows-1252,95131,Test,0.84,US,Test User,3.4,,verified,demarc_1336421374_biz@gmail.com,United States,San Jose,1,As4zhnwQeMSnsOdh0NBxc2GkfRrEAd8OPZnnd3EWRDz38L81PzX-6vI- ,demarc_1321350258_per@gmail.com,6FT25620DT6366410,instant,User,CA,demarc_1336421374_biz@gmail .com,,6SHJZ2PT5YMLS,web_accept,test item,EUR,,US,1,0.00,test item,,0.00,de0561482901
  2. 2012-05-07 22:52:47 Paypal: ResponseVERIFIED
  3. 2012-05-07 22:52:47 Paypal: 1
  4. 2012-05-07 22:52:47 Paypal: Processing Trasaction: 4fa8361f-7574-444f-b821-5e660a00000f
  5. 2012-05-07 22:52:47 Paypal: 4fa8361f-7574-444f-b821-5e660a00000f
  6.  
  7. $data['cmd'] = '_notify-validate';
  8. $newData['cmd'] = '_notify-validate';
  9. foreach ($data AS $key => $val) {
  10. $newData[$key] = $val;
  11. }
  12. $this->log("Start validations:".join(",",$newData), 'paypal');
  13. $data = array_map(array('PaypalIpnSource', 'clearSlash'), $newData);
  14.  
  15. if (isset($data['test_ipn'])) {
  16. $server = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
  17. } else {
  18. $server = 'https://www.paypal.com/cgi-bin/webscr';
  19. }
  20.  
  21. $response = $this->Http->post($server, $newData);
  22. $this->log("Response".$response, 'paypal');
  23.  
  24. if ($response == "VERIFIED") {
  25. return true;
  26. }
  27.  
  28. if (!$response) {
  29. $this->log('HTTP Error in PaypalIpnSource::isValid while posting back to PayPal', 'paypal');
  30. }
  31.  
  32. return false;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement