Skip to content

Commit c4b7867

Browse files
committed
payment: cr fixes
1 parent cd24bb4 commit c4b7867

File tree

8 files changed

+21
-15
lines changed

8 files changed

+21
-15
lines changed

telegram/invoice.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ class Invoice(TelegramObject):
3131
be used to generate this invoice
3232
currency (str): Three-letter ISO 4217 currency code
3333
total_amount (int): Total price in the smallest units of the currency (integer)
34+
**kwargs (dict): Arbitrary keyword arguments.
3435
3536
"""
3637

37-
def __init__(self, title, description, start_parameter, currency, total_amount):
38+
def __init__(self, title, description, start_parameter, currency, total_amount, **kwargs):
3839
self.title = title
3940
self.description = description
4041
self.start_parameter = start_parameter

telegram/labeledprice.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ class LabeledPrice(TelegramObject):
2727
Attributes:
2828
label (str): Portion label
2929
amount (int): Price of the product in the smallest units of the currency (integer)
30+
**kwargs (dict): Arbitrary keyword arguments.
3031
"""
3132

32-
def __init__(self, label, amount):
33+
def __init__(self, label, amount, **kwargs):
3334
self.label = label
3435
self.amount = amount
3536

telegram/orderinfo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ class OrderInfo(TelegramObject):
2929
phone_number (Optional[str]): User's phone number
3030
email (Optional[str]): User email
3131
shipping_address (Optional[:class:`telegram.ShippingAddress`]): User shipping address
32+
**kwargs (dict): Arbitrary keyword arguments.
3233
3334
"""
3435

35-
def __init__(self, name=None, phone_number=None, email=None, shipping_address=None):
36+
def __init__(self, name=None, phone_number=None, email=None, shipping_address=None, **kwargs):
3637
self.name = name
3738
self.phone_number = phone_number
3839
self.email = email

telegram/precheckoutquery.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ class PreCheckoutQuery(TelegramObject):
2828
* In Python `from` is a reserved word, use `from_user` instead.
2929
3030
Attributes:
31-
id (int): Unique query identifier
31+
id (str): Unique query identifier
3232
from_user (:class:`telegram.User`): User who sent the query
3333
currency (str): Three-letter ISO 4217 currency code
3434
total_amount (int): Total price in the smallest units of the currency (integer)
3535
invoice_payload (str): Bot specified invoice payload
36-
37-
Keyword Args:
3836
shipping_option_id (Optional[str]): Identifier of the shipping option chosen by the user
3937
order_info (Optional[:class:`telegram.OrderInfo`]): Order info provided by the user
38+
**kwargs (dict): Arbitrary keyword arguments.
4039
4140
"""
4241

@@ -47,7 +46,8 @@ def __init__(self,
4746
total_amount,
4847
invoice_payload,
4948
shipping_option_id=None,
50-
order_info=None):
49+
order_info=None,
50+
**kwargs):
5151
self.id = id
5252
self.from_user = from_user
5353
self.currency = currency

telegram/shippingaddress.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ class ShippingAddress(TelegramObject):
3131
street_line1 (str): First line for the address
3232
street_line2 (str): Second line for the address
3333
post_code (str): Address post code
34+
**kwargs (dict): Arbitrary keyword arguments.
3435
3536
"""
3637

37-
def __init__(self, country_code, state, city, street_line1, street_line2, post_code):
38+
def __init__(self, country_code, state, city, street_line1, street_line2, post_code, **kwargs):
3839
self.country_code = country_code
3940
self.state = state
4041
self.city = city

telegram/shippingoption.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ class ShippingOption(TelegramObject):
2828
* In Python `from` is a reserved word, use `from_user` instead.
2929
3030
Attributes:
31-
id (int): Shipping option identifier
31+
id (str): Shipping option identifier
3232
title (str): Option title
3333
prices (List[:class:`telegram.LabeledPrice`]): List of price portions
34+
**kwargs (dict): Arbitrary keyword arguments.
3435
3536
"""
3637

37-
def __init__(self, id, title, prices):
38+
def __init__(self, id, title, prices, **kwargs):
3839
self.id = id
3940
self.title = title
4041
self.prices = prices

telegram/shippingquery.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ class ShippingQuery(TelegramObject):
2828
* In Python `from` is a reserved word, use `from_user` instead.
2929
3030
Attributes:
31-
id (int): Unique query identifier
31+
id (str): Unique query identifier
3232
from_user (:class:`telegram.User`): User who sent the query
3333
invoice_payload (str): Bot specified invoice payload
3434
shipping_address (:class:`telegram.ShippingQuery`): User specified shipping address
35+
**kwargs (dict): Arbitrary keyword arguments.
3536
3637
"""
3738

38-
def __init__(self, id, from_user, invoice_payload, shipping_address):
39+
def __init__(self, id, from_user, invoice_payload, shipping_address, **kwargs):
3940
self.id = id
4041
self.from_user = from_user
4142
self.invoice_payload = invoice_payload

telegram/successfulpayment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ class SuccessfulPayment(TelegramObject):
3333
invoice_payload (str): Bot specified invoice payload
3434
telegram_payment_charge_id (str): Telegram payment identifier
3535
provider_payment_charge_id (str): Provider payment identifier
36-
37-
Keyword Args:
3836
shipping_option_id (Optional[str]): Identifier of the shipping option chosen by the user
3937
order_info (Optional[:class:`telegram.OrderInfo`]): Order info provided by the user
38+
**kwargs (dict): Arbitrary keyword arguments.
4039
4140
"""
4241

@@ -47,7 +46,8 @@ def __init__(self,
4746
telegram_payment_charge_id,
4847
provider_payment_charge_id,
4948
shipping_option_id=None,
50-
order_info=None):
49+
order_info=None,
50+
**kwargs):
5151
self.currency = currency
5252
self.total_amount = total_amount
5353
self.invoice_payload = invoice_payload

0 commit comments

Comments
 (0)