Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <?php
  2.  
  3. $curl = curl_init();
  4.  
  5. curl_setopt_array($curl, array(
  6. CURLOPT_PORT => "4433",
  7. CURLOPT_URL => "https://pay.tektaya.id:4433/tty_api/dev/index.php/v3/multibill?mti=38&kdproduk=406&userid=&password=&sessionkey=&bit62=&idpel=&trxid=",
  8. CURLOPT_RETURNTRANSFER => true,
  9. CURLOPT_ENCODING => "",
  10. CURLOPT_MAXREDIRS => 10,
  11. CURLOPT_TIMEOUT => 30,
  12. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  13. CURLOPT_CUSTOMREQUEST => "GET",
  14. CURLOPT_HTTPHEADER => array(
  15. "Content-Type: application/x-www-form-urlencoded",
  16. "cache-control: no-cache"
  17. ),
  18. ));
  19.  
  20. $response = curl_exec($curl);
  21. $err = curl_error($curl);
  22.  
  23. curl_close($curl);
  24.  
  25. if ($err) {
  26. echo "cURL Error #:".$err;
  27. } else {
  28. $getResponjson = json_decode($response);
  29. foreach ($getResponjson as $value) {
  30. $getRespcode = $value->respcode;
  31. $getMessage = $value->message;
  32. }
  33. if ($getRespcode == "00") {
  34. $splitMessage = explode("|", $getMessage);
  35. echo $splitMessage[0]."<br>";
  36. echo $splitMessage[1]."<br>";
  37. echo $splitMessage[2]."<br>";
  38. echo $splitMessage[3]."<br>";
  39. echo $splitMessage[4]."<br>";
  40. } else {
  41. echo "Error #: ".$getMessage;
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement