telegram bot shipping info for invoice PHP - IT NEWS

Latest

Programming PHP tutorials for beginners. Technology and product reviews.

Saturday, June 3, 2017

telegram bot shipping info for invoice PHP

Adv

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

4 comments:

  1. Thanks for sharing this information. The most interesting part is that it provides all the required API tests and commands. This will take you only a few seconds to download and install it in your existing application or software.

    sms api php
    php sms gateway integration

    ReplyDelete
  2. Get ready SMS PHP API or Bulk SMS API PHP Gateway Integration Source Code/Script to Integrate into your website, software or web application. MsgClub PHP APIs helps to send verification code or OTP, Transactional & Promotional SMS from your PHP based application automatically.

    ReplyDelete
  3. Our Ready php code/ script will help you to save time and efforts at a large level. Your enterprise/organization's php application can be easily integrated with our services. However, we provide ready to use bulk SMS API PHP code that helpfuls to send various information to your user's mobile.

    ReplyDelete