diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cc1f9042..04d6bc27f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ### Deprecated ### Removed ### Fixed +- Entity relations and wrong types for payments. ### Security ## [0.51.0] - 2017-12-05 diff --git a/src/Entities/InlineKeyboardButton.php b/src/Entities/InlineKeyboardButton.php index d3b4600f5..2ec1adc6a 100644 --- a/src/Entities/InlineKeyboardButton.php +++ b/src/Entities/InlineKeyboardButton.php @@ -22,7 +22,7 @@ * @method string getCallbackData() Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes * @method string getSwitchInlineQuery() Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted. * @method string getSwitchInlineQueryCurrentChat() Optional. If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted. - * @method string getPay() Optional. Specify True, to send a Pay button. + * @method bool getPay() Optional. Specify True, to send a Pay button. * * @method $this setText(string $text) Label text on the button * @method $this setUrl(string $url) Optional. HTTP url to be opened when button is pressed diff --git a/src/Entities/Payments/PreCheckoutQuery.php b/src/Entities/Payments/PreCheckoutQuery.php index 6acd90ec9..b86e7647a 100644 --- a/src/Entities/Payments/PreCheckoutQuery.php +++ b/src/Entities/Payments/PreCheckoutQuery.php @@ -37,7 +37,7 @@ class PreCheckoutQuery extends Entity public function subEntities() { return [ - 'user' => User::class, + 'from' => User::class, 'order_info' => OrderInfo::class, ]; } diff --git a/src/Entities/Payments/ShippingOption.php b/src/Entities/Payments/ShippingOption.php index 39fd0cdfd..2c0ad8b7e 100644 --- a/src/Entities/Payments/ShippingOption.php +++ b/src/Entities/Payments/ShippingOption.php @@ -43,18 +43,6 @@ protected function subEntities() */ public function getPrices() { - $all_prices = []; - - if ($these_prices = $this->getProperty('prices')) { - foreach ($these_prices as $prices) { - $new_prices = []; - foreach ($prices as $price) { - $new_prices[] = new LabeledPrice($price); - } - $all_prices[] = $new_prices; - } - } - - return $all_prices; + return $this->makePrettyObjectArray(LabeledPrice::class, 'prices'); } } diff --git a/src/Entities/Payments/ShippingQuery.php b/src/Entities/Payments/ShippingQuery.php index a2395b9d8..0425254d9 100644 --- a/src/Entities/Payments/ShippingQuery.php +++ b/src/Entities/Payments/ShippingQuery.php @@ -34,7 +34,7 @@ class ShippingQuery extends Entity public function subEntities() { return [ - 'user' => User::class, + 'from' => User::class, 'shipping_address' => ShippingAddress::class, ]; }