Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // api data
- $api_link = $data_provider['link'];
- $api_key = $data_provider['api_key'];
- // end api data
- if ($provider == "MANUAL") {
- $api_postdata = "";
- } else if ($provider == "PULSAMEDIA") {
- $api_postdata = "api_key=$api_key&action=order&service=$post_service&data=$post_link&quantity=$post_quantity";
- } else {
- die("System Error!");
- }
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $api_link);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $api_postdata);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- $chresult = curl_exec($ch);
- curl_close($ch);
- $json_result = json_decode($chresult, true);
- if ($provider == "PULSAMEDIA" AND $json_result['status'] == false) {
- $msg_type = "error";
- $msg_content = "×</span></button><b>Gagal:</b> Server Maintenance (1).";
- } else {
- if ($provider == "PULSAMEDIA") {
- $poid = $json_result['data']['id'];
- } else if ($provider == "MANUAL") {
- $poid = $oid;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement