Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.89 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.     $notifyURL = 'http://lifesurfers.pl/itn';
  5.     $returnUrlSuccess = 'http://lifesurfers.pl/platnosc-ok';
  6.  
  7.     $data = array(
  8.         'shopId' => intval(1),
  9.         'price' => floatval(5),
  10.         'control' => 1234,
  11.         'notifyURL' => $notifyURL,
  12.         'returnUrlSuccess' => $returnUrlSuccess,
  13.         'signature' => hash('sha256', "TUTAJ_WKLEIC_HASH|1|5|1234|{$notifyURL}|{$returnUrlSuccess}")
  14.     );
  15.                                                            
  16.     $data_string = json_encode($data);                                                                                  
  17.                                                                                                                          
  18.     $ch = curl_init('https://secure.pbl.pl/api/v1/transfer/generate');                                                                      
  19.     curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                    
  20.     curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
  21.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
  22.     curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
  23.         'Content-Type: application/json',                                                                                
  24.         'Content-Length: ' . strlen($data_string))                                                                      
  25.     );                                                                                                                  
  26.                                                                                                                          
  27.     $result = curl_exec($ch);
  28.     $result = json_decode($result);
  29.     header('Location: https://secure.pbl.pl/transfer/' . $result->transactionId);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement