Skip to content

Add two arguments to send_invoice #986

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2018
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
10 changes: 10 additions & 0 deletions telegram/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2202,6 +2202,8 @@ def send_invoice(self,
reply_to_message_id=None,
reply_markup=None,
provider_data=None,
send_phone_number_to_provider=None,
send_email_to_provider=None,
timeout=None,
**kwargs):
"""Use this method to send invoices.
Expand Down Expand Up @@ -2236,6 +2238,10 @@ def send_invoice(self,
complete the order.
need_shipping_address (:obj:`bool`, optional): Pass True, if you require the user's
shipping address to complete the order.
send_phone_number_to_provider (:obj:`bool`, optional): Pass True, if user's phone
number should be sent to provider.
send_email_to_provider (:obj:`bool`, optional): Pass True, if user's email address
should be sent to provider.
is_flexible (:obj:`bool`, optional): Pass True, if the final price depends on the
shipping method.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
Expand Down Expand Up @@ -2292,6 +2298,10 @@ def send_invoice(self,
data['need_shipping_address'] = need_shipping_address
if is_flexible is not None:
data['is_flexible'] = is_flexible
if send_phone_number_to_provider is not None:
data['send_phone_number_to_provider'] = send_email_to_provider
if send_email_to_provider is not None:
data['send_email_to_provider'] = send_email_to_provider

return url, data

Expand Down
2 changes: 2 additions & 0 deletions tests/test_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def test_send_all_args(self, bot, chat_id, provider_token):
need_phone_number=True,
need_email=True,
need_shipping_address=True,
send_phone_number_to_provider=True,
send_email_to_provider=True,
is_flexible=True)

assert message.invoice.currency == self.currency
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy