Advertisement
adrian_abdillah

Script order nespedia

Jun 25th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. // api data
  2. $service_id = 123; //id service
  3. $api_key = "api_key";
  4. $target = "adrian_abdllh";
  5. $jumlah = 100;
  6. // end api data
  7. //SCRIPT AUTO OPER(ORDER SOSMED) NESPEDIA BY ADRIAN57
  8.  
  9. $api_postdata = "key=$api_key&action=order&service=$service_id&target=$target&quantity=$jumlah";
  10. $ch = curl_init();
  11. curl_setopt($ch, CURLOPT_URL, $api_link);
  12. curl_setopt($ch, CURLOPT_POST, 1);
  13. curl_setopt($ch, CURLOPT_POSTFIELDS, $api_postdata);
  14. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  15. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  16. $chresult = curl_exec($ch);
  17. curl_close($ch);
  18. $json_result = json_decode($chresult);
  19. if ($json_result['error'] == true) {
  20. echo "ORDER GAGAL, PESAN : ".$json_result['error'];
  21. } else {
  22. echo "ORDER SUKSES, ORDER ID : ".$json_result['data']['id'];
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement