Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $notifyURL = 'http://lifesurfers.pl/itn';
- $returnUrlSuccess = 'http://lifesurfers.pl/platnosc-ok';
- $data = array(
- 'shopId' => intval(1),
- 'price' => floatval(5),
- 'control' => 1234,
- 'notifyURL' => $notifyURL,
- 'returnUrlSuccess' => $returnUrlSuccess,
- 'signature' => hash('sha256', "TUTAJ_WKLEIC_HASH|1|5|1234|{$notifyURL}|{$returnUrlSuccess}")
- );
- $data_string = json_encode($data);
- $ch = curl_init('https://secure.pbl.pl/api/v1/transfer/generate');
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($data_string))
- );
- $result = curl_exec($ch);
- $result = json_decode($result);
- header('Location: https://secure.pbl.pl/transfer/' . $result->transactionId);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement