Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $curl = curl_init();
- curl_setopt_array($curl, array(
- CURLOPT_PORT => "4433",
- CURLOPT_URL => "https://pay.tektaya.id:4433/tty_api/dev/index.php/v3/multibill?mti=38&kdproduk=406&userid=&password=&sessionkey=&bit62=&idpel=&trxid=",
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => "",
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 30,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => "GET",
- CURLOPT_HTTPHEADER => array(
- "Content-Type: application/x-www-form-urlencoded",
- "cache-control: no-cache"
- ),
- ));
- $response = curl_exec($curl);
- $err = curl_error($curl);
- curl_close($curl);
- if ($err) {
- echo "cURL Error #:".$err;
- } else {
- $getResponjson = json_decode($response);
- foreach ($getResponjson as $value) {
- $getRespcode = $value->respcode;
- $getMessage = $value->message;
- }
- if ($getRespcode == "00") {
- $splitMessage = explode("|", $getMessage);
- echo $splitMessage[0]."<br>";
- echo $splitMessage[1]."<br>";
- echo $splitMessage[2]."<br>";
- echo $splitMessage[3]."<br>";
- echo $splitMessage[4]."<br>";
- } else {
- echo "Error #: ".$getMessage;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement