$update = json_decode(file_get_contents('php://input'));
$message = $update -> message;
$cid = $message -> chat -> id;
$mid = $message -> message_id;
$text = $message -> text;
$successful_payment = $update->message->successful_payment;
$payment_currency = $successful_payment->currency;
$payment_total_amount = $successful_payment->total_amount;
$payment_invoice_payload = $successful_payment->invoice_payload;
$chec = $update->pre_checkout_query;
$chec_id = $chec->id;
$chec_from_id = $chec->from->id;
$chec_from_name = $chec->from->first_name;
$chec_from_username = $chec->from->username;
$chec_from_language = $chec->from->language_code;
$chec_from_is_premium = $chec->from->is_premium;
$chec_currency = $chec->currency;
$chec_total_amount = $chec->total_amount;
$chec_invoice_payload = $chec->invoice_payload;
if(isset($successful_payment)){
if($payment_currency == "XTR"){
bot('sendMessage', [
'chat_id' => $cid,
'text' => "
Rahmat",
'parse_mode' => "html",
]);
}
}
if(isset($chec)){
bot('answerPreCheckoutQuery', [
'pre_checkout_query_id' => $chec_id,
'ok' => true,
]);
}
if($text == "/pay"){
$miqdor = "1"; // Bu yerda xohlagan summangizni belgilashingiz mumkin
$uniqd = md5(uniqid());
$res = bot('sendInvoice', [
'chat_id' => $cid,
'title' => "@$bot",
'description' => "@$bot ni qo‘llab-quvvatlash uchun pastdagi tugmani bosing 👇👇",
'payload' => $uniqd,
'currency' => "XTR",
'prices' => json_encode([['label' => 'star', 'amount' => $miqdor]])
]);
exit();
}
@Reaksiyalar_bot dagi Stars to‘lov tizimida $miqdor qiymatini o‘zingiz xohlagan summa bilan belgilashingiz mumkin 💸✨Manba: @WonderfulCodersDasturchi:
@BestProger