Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. $tx = $_GET['tx'];
  2. $ID = $_GET['cm'];
  3. $amount = $_GET['amt'];
  4. $currency = $_GET['cc'];
  5. $identity = '###########################################';
  6.  
  7. // Init cURL
  8. $ch = curl_init();
  9.  
  10. // Set request options
  11. $url = 'https:www.paypal.com/cgi-bin/webscr';
  12. $fields = array(
  13. 'cmd' => '_notify-synch',
  14. 'tx' => $tx,
  15. 'at' => $identity,
  16. );
  17.  
  18. curl_setopt($ch,CURLOPT_URL, $url);
  19. curl_setopt($ch,CURLOPT_POST, count($fields));
  20. curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
  21. curl_setopt($ch,CURLOPT_RETURNTRANSFER, TRUE);
  22. curl_setopt($ch,CURLOPT_HEADER, FALSE);
  23.  
  24. // Execute request and get response and status code
  25. $response = curl_exec($ch);
  26. $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  27.  
  28. // Close connection
  29. curl_close($ch);
  30. if($status == 200 AND strpos($response, 'SUCCESS') === 0)
  31. {
  32. wp_redirect(home_url('/account'));
  33. exit;
  34. } else {
  35. wp_redirect(home_url());
  36. exit;
  37. }
  38.  
  39. $url = 'https:www.paypal.com/cgi-bin/webscr';
  40.  
  41. $url = 'https://www.paypal.com/cgi-bin/webscr';
  42.  
  43. curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
  44.  
  45. curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($fields));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement