telegram bot shipping info for invoice PHP - AARON SMITH TECH

Latest

Programming PHP tutorials for beginners. Technology and product reviews. Aaron Smith video tutorials for beginners.

sponsor

Saturday, June 3, 2017

telegram bot shipping info for invoice PHP


telegram bot shipping info

How to add shipping info, email, phone number for Telegram Bot Invoice PHP request. With this simple script, you can send additional information (Image, Email, Phone number, Shipping address, Name). Include this parameters into PHP ARRAY, must be TRUE. Don't forget about Shipping price. With this example Shipping price will be included into final price. You can exclude shipping price, just change to is_flexible => "False"

Numbers for telegram SMS verification: https://www.facebook.com/chakabiz/posts/848623458622948


$LabeledPrice = array(array('label' => "Nike Shoes", 'amount' => 11000), array('label' => "Shipping", 'amount' => 2500));

$postfields = array(
'chat_id' => "$chat_id", // Telegram bot Chat ID
'title' => "NIKE SHOES",
'photo_url' => "https://at-cdn-s01.audiotool.com/2014/04/24/documents/CJdSUBI3TeFEiohdPJLsDgwF7Im5rOX/0/cover256x256-c73e8c1831fd4a78801487a2f6dc1de2.jpg",
'photo_width' => 50,
'photo_height' => 50,
'description' => "The best running shoes 2017",
'payload' => "telebot-test-invoice",
'provider_token' => "$stripe_token", // Your Stipe token for telegram Bot
'start_parameter' => "pay",
'currency' => "EUR",
'prices' => json_encode($LabeledPrice),
'need_name' => True,
'need_phone_number' => True,
'need_email' => True,
'need_shipping_address' => True,
'is_flexible' => True,
);

telegram bot payments

Finally you will receive this:





Here you can copy full PHP script with Curl request.


$chat_id = $resulta['message']['chat']['id'];
$bot_id = "******"; // Bot ID
$stripe_token = "*****"; // Stripe token

$url = "https://api.telegram.org/$bot_id/sendInvoice";

$LabeledPrice = array(array('label' => "Nike Shoes", 'amount' => 11000), array('label' => "Shipping", 'amount' => 2500));
$postfields = array(
'chat_id' => "$chat_id", // Telegram bot Chat ID
'title' => "NIKE SHOES",
'photo_url' => "https://at-cdn-s01.audiotool.com/2014/04/24/documents/CJdSUBI3TeFEiohdPJLsDgwF7Im5rOX/0/cover256x256-c73e8c1831fd4a78801487a2f6dc1de2.jpg",
'photo_width' => 50,
'photo_height' => 50,
'description' => "The best running shoes 2017",
'payload' => "telebot-test-invoice",
'provider_token' => "$stripe_token", // Your Stipe token for telegram Bot
'start_parameter' => "pay",
'currency' => "EUR",
'prices' => json_encode($LabeledPrice),
'need_name' => True,
'need_phone_number' => True,
'need_email' => True,
'need_shipping_address' => True,
'is_flexible' => True,
);

print_r($postfields);

if (!$curld = curl_init()) {
exit;
}

curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($curld, CURLOPT_URL,$url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($curld);

curl_close ($curld);


https://www.facebook.com/chakabiz
https://www.youtube.com/channel/UCYuMRNb_SRZ4FMsZjnHRZUA

No comments:

Post a Comment