-
-
Save homfarnam/8ab81580a55086f15f5dce55426f395d to your computer and use it in GitHub Desktop.
payment bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import stripe | |
stripe.api_key="" | |
def create_payment(): | |
# This is just an example. You would need to handle payments in a secure environment | |
session = stripe.checkout.Session.create( | |
payment_method_types=['card'], | |
line_items=[{ | |
'price_data': { | |
'currency': 'eur', | |
'product_data': { | |
'name': '', | |
}, | |
'unit_amount': 500, | |
}, | |
'quantity': 1, | |
}], | |
mode='payment', | |
success_url='https://t.me/BOTUSERNAME?start=SUCCESSFUL_PAYMENT', | |
cancel_url='https://t.me/BOTUSERNAME?start=CANCELLED_PAYMENT', | |
) | |
return session.url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment