Advertisement
ariedomani_

Class Order Just Pulsa

Jun 25th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2. $key = "123"; // API Key anda.
  3. $service = "123"; // ID Layanan.
  4. $phone = "0853123456"; // No. Telp yang ditargetkan pesanan.
  5. $postdata = "key=$key&action=order&service=$service&phone=$phone";
  6.  
  7. $ch = curl_init();
  8. curl_setopt($ch, CURLOPT_URL, "https://arifahpedia.com/api/pulsa.php");
  9. curl_setopt($ch, CURLOPT_POST, 1);
  10. curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
  11. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  12. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  13. $chresult = curl_exec($ch);
  14. curl_close($ch);
  15. $json_result = json_decode($chresult, true);
  16.  
  17. if ($json_result['error'] == TRUE) {
  18. echo "ORDER GAGAL, PESAN : ".$json_result['error'];
  19. } else {
  20. echo "ORDER SUKSES, ORDER ID : ".$json_result['order_id'];
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement