Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix payment related entity relations and types. #731

Merged
merged 1 commit into from
Dec 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/InlineKeyboardButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Payments/PreCheckoutQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PreCheckoutQuery extends Entity
public function subEntities()
{
return [
'user' => User::class,
'from' => User::class,
'order_info' => OrderInfo::class,
];
}
Expand Down
14 changes: 1 addition & 13 deletions src/Entities/Payments/ShippingOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
2 changes: 1 addition & 1 deletion src/Entities/Payments/ShippingQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ShippingQuery extends Entity
public function subEntities()
{
return [
'user' => User::class,
'from' => User::class,
'shipping_address' => ShippingAddress::class,
];
}
Expand Down