Skip to content

Commit d61262b

Browse files
authored
Merge pull request #731 from noplanman/fix_payments
Fix payment related entity relations and types.
2 parents 3e7af92 + bddf582 commit d61262b

File tree

5 files changed

+5
-16
lines changed

5 files changed

+5
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
99
### Deprecated
1010
### Removed
1111
### Fixed
12+
- Entity relations and wrong types for payments.
1213
### Security
1314

1415
## [0.51.0] - 2017-12-05

src/Entities/InlineKeyboardButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @method string getCallbackData() Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
2323
* @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.
2424
* @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.
25-
* @method string getPay() Optional. Specify True, to send a Pay button.
25+
* @method bool getPay() Optional. Specify True, to send a Pay button.
2626
*
2727
* @method $this setText(string $text) Label text on the button
2828
* @method $this setUrl(string $url) Optional. HTTP url to be opened when button is pressed

src/Entities/Payments/PreCheckoutQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PreCheckoutQuery extends Entity
3737
public function subEntities()
3838
{
3939
return [
40-
'user' => User::class,
40+
'from' => User::class,
4141
'order_info' => OrderInfo::class,
4242
];
4343
}

src/Entities/Payments/ShippingOption.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,6 @@ protected function subEntities()
4343
*/
4444
public function getPrices()
4545
{
46-
$all_prices = [];
47-
48-
if ($these_prices = $this->getProperty('prices')) {
49-
foreach ($these_prices as $prices) {
50-
$new_prices = [];
51-
foreach ($prices as $price) {
52-
$new_prices[] = new LabeledPrice($price);
53-
}
54-
$all_prices[] = $new_prices;
55-
}
56-
}
57-
58-
return $all_prices;
46+
return $this->makePrettyObjectArray(LabeledPrice::class, 'prices');
5947
}
6048
}

src/Entities/Payments/ShippingQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ShippingQuery extends Entity
3434
public function subEntities()
3535
{
3636
return [
37-
'user' => User::class,
37+
'from' => User::class,
3838
'shipping_address' => ShippingAddress::class,
3939
];
4040
}

0 commit comments

Comments
 (0)