Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit dee89bb

Browse files
committed
Additions for Bot API v3.5: add field provider_data
1 parent 793a10b commit dee89bb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Telegram/Methods/SendInvoice.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66

77
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
88
use unreal4u\TelegramAPI\Telegram\Types\Inline\Keyboard\Markup;
9+
use unreal4u\TelegramAPI\Telegram\Types\LabeledPrice;
910

1011
/**
1112
* Use this method to send invoices. On success, the sent Message is returned.
1213
*
13-
* Objects defined as-is May 2017
14+
* Objects defined as-is november 2017
1415
*
1516
* @see https://core.telegram.org/bots/api#sendinvoice
1617
*/
@@ -66,6 +67,15 @@ class SendInvoice extends TelegramMethods
6667
*/
6768
public $prices = [];
6869

70+
/**
71+
* Array data about the invoice, which will be shared with the payment provider. A detailed description of
72+
* required fields should be provided by the payment provider.
73+
*
74+
* The conversion to JSON-encoded string will be handled by the class itself.
75+
* @var array
76+
*/
77+
public $provider_data;
78+
6979
/**
7080
* Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a
7181
* service. People like it better when they see what they are paying for
@@ -152,6 +162,10 @@ public function performSpecialConditions(): TelegramMethods
152162
$this->prices = json_encode($this->prices);
153163
}
154164

165+
if (!empty($this->provider_data)) {
166+
$this->provider_data = json_encode($this->provider_data);
167+
}
168+
155169
return parent::performSpecialConditions();
156170
}
157171

0 commit comments

Comments
 (0)