Advertisement
GAMELASTER

Untitled

Jan 13th, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. if (isset($_GET['tx'])) {
  2. $req = 'cmd=_notify-synch';
  3.  
  4. $tx_token = $_GET['tx'];
  5. $auth_token = "AAAAA";
  6. $req .= "&tx=$tx_token&at=$auth_token";
  7.  
  8. $ch = curl_init();
  9. curl_setopt($ch, CURLOPT_URL, "https://$pp_hostname/cgi-bin/webscr");
  10. curl_setopt($ch, CURLOPT_POST, 1);
  11. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  12. curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
  13. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
  14. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  15. curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: $pp_hostname"));
  16. $res = curl_exec($ch);
  17. curl_close($ch);
  18. if(!$res){
  19. echo "Overenie vašej platby zlyhalo!";
  20. }else{
  21. $lines = explode("\n", trim($res));
  22. $keyarray = array();
  23. $success = false;
  24. $order = null;
  25. if (strcmp ($lines[0], "SUCCESS") == 0) {
  26. for ($i = 1; $i < count($lines); $i++) {
  27. $temp = explode("=", $lines[$i],2);
  28. $keyarray[urldecode($temp[0])] = urldecode($temp[1]);
  29. }
  30. $success = true;
  31. if ($keyarray["payment_status"]
  32. /// atd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement