payment: cr fixes

This commit is contained in:
Noam Meltzer 2017-06-01 21:52:47 +03:00
parent cd24bb4ba5
commit c4b78673a3
8 changed files with 21 additions and 15 deletions

View file

@ -31,10 +31,11 @@ class Invoice(TelegramObject):
be used to generate this invoice
currency (str): Three-letter ISO 4217 currency code
total_amount (int): Total price in the smallest units of the currency (integer)
**kwargs (dict): Arbitrary keyword arguments.
"""
def __init__(self, title, description, start_parameter, currency, total_amount):
def __init__(self, title, description, start_parameter, currency, total_amount, **kwargs):
self.title = title
self.description = description
self.start_parameter = start_parameter

View file

@ -27,9 +27,10 @@ class LabeledPrice(TelegramObject):
Attributes:
label (str): Portion label
amount (int): Price of the product in the smallest units of the currency (integer)
**kwargs (dict): Arbitrary keyword arguments.
"""
def __init__(self, label, amount):
def __init__(self, label, amount, **kwargs):
self.label = label
self.amount = amount

View file

@ -29,10 +29,11 @@ class OrderInfo(TelegramObject):
phone_number (Optional[str]): User's phone number
email (Optional[str]): User email
shipping_address (Optional[:class:`telegram.ShippingAddress`]): User shipping address
**kwargs (dict): Arbitrary keyword arguments.
"""
def __init__(self, name=None, phone_number=None, email=None, shipping_address=None):
def __init__(self, name=None, phone_number=None, email=None, shipping_address=None, **kwargs):
self.name = name
self.phone_number = phone_number
self.email = email

View file

@ -28,15 +28,14 @@ class PreCheckoutQuery(TelegramObject):
* In Python `from` is a reserved word, use `from_user` instead.
Attributes:
id (int): Unique query identifier
id (str): Unique query identifier
from_user (:class:`telegram.User`): User who sent the query
currency (str): Three-letter ISO 4217 currency code
total_amount (int): Total price in the smallest units of the currency (integer)
invoice_payload (str): Bot specified invoice payload
Keyword Args:
shipping_option_id (Optional[str]): Identifier of the shipping option chosen by the user
order_info (Optional[:class:`telegram.OrderInfo`]): Order info provided by the user
**kwargs (dict): Arbitrary keyword arguments.
"""
@ -47,7 +46,8 @@ class PreCheckoutQuery(TelegramObject):
total_amount,
invoice_payload,
shipping_option_id=None,
order_info=None):
order_info=None,
**kwargs):
self.id = id
self.from_user = from_user
self.currency = currency

View file

@ -31,10 +31,11 @@ class ShippingAddress(TelegramObject):
street_line1 (str): First line for the address
street_line2 (str): Second line for the address
post_code (str): Address post code
**kwargs (dict): Arbitrary keyword arguments.
"""
def __init__(self, country_code, state, city, street_line1, street_line2, post_code):
def __init__(self, country_code, state, city, street_line1, street_line2, post_code, **kwargs):
self.country_code = country_code
self.state = state
self.city = city

View file

@ -28,13 +28,14 @@ class ShippingOption(TelegramObject):
* In Python `from` is a reserved word, use `from_user` instead.
Attributes:
id (int): Shipping option identifier
id (str): Shipping option identifier
title (str): Option title
prices (List[:class:`telegram.LabeledPrice`]): List of price portions
**kwargs (dict): Arbitrary keyword arguments.
"""
def __init__(self, id, title, prices):
def __init__(self, id, title, prices, **kwargs):
self.id = id
self.title = title
self.prices = prices

View file

@ -28,14 +28,15 @@ class ShippingQuery(TelegramObject):
* In Python `from` is a reserved word, use `from_user` instead.
Attributes:
id (int): Unique query identifier
id (str): Unique query identifier
from_user (:class:`telegram.User`): User who sent the query
invoice_payload (str): Bot specified invoice payload
shipping_address (:class:`telegram.ShippingQuery`): User specified shipping address
**kwargs (dict): Arbitrary keyword arguments.
"""
def __init__(self, id, from_user, invoice_payload, shipping_address):
def __init__(self, id, from_user, invoice_payload, shipping_address, **kwargs):
self.id = id
self.from_user = from_user
self.invoice_payload = invoice_payload

View file

@ -33,10 +33,9 @@ class SuccessfulPayment(TelegramObject):
invoice_payload (str): Bot specified invoice payload
telegram_payment_charge_id (str): Telegram payment identifier
provider_payment_charge_id (str): Provider payment identifier
Keyword Args:
shipping_option_id (Optional[str]): Identifier of the shipping option chosen by the user
order_info (Optional[:class:`telegram.OrderInfo`]): Order info provided by the user
**kwargs (dict): Arbitrary keyword arguments.
"""
@ -47,7 +46,8 @@ class SuccessfulPayment(TelegramObject):
telegram_payment_charge_id,
provider_payment_charge_id,
shipping_option_id=None,
order_info=None):
order_info=None,
**kwargs):
self.currency = currency
self.total_amount = total_amount
self.invoice_payload = invoice_payload