Skip to content

Instantly share code, notes, and snippets.

@homfarnam
Created July 10, 2023 13:19
Show Gist options
  • Save homfarnam/8ab81580a55086f15f5dce55426f395d to your computer and use it in GitHub Desktop.
Save homfarnam/8ab81580a55086f15f5dce55426f395d to your computer and use it in GitHub Desktop.
payment bot
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