Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- payment_intents = stripe.PaymentIntent.list()
- payment_intent_extract = [next(x['id'] for x in payment_intents.auto_paging_iter() if x['customer'] == 'cus_EszB7tXQtjsQhP')]
- payment_intent_id = ", ".join(payment_intent_extract)
- client_secret_extract = [next(x['client_secret'] for x in payment_intents.auto_paging_iter() if x['customer'] == 'cus_EszB7tXQtjsQhP')]
- client_secret = ", ".join(client_secret_extract)
- stripe.PaymentIntent.create(
- amount=25 * 100,
- currency='usd',
- payment_method_types=['card'],
- customer='cus_EszB7tXQtjsQhP',
- setup_future_usage='off_session'
- )
- payment_method = stripe.PaymentMethod.attach(
- 'pm_card_visa',
- customer='cus_EszB7tXQtjsQhP'
- )
- payment_intent_extract = [next(x['id'] for x in payment_intents.auto_paging_iter() if x['customer'] == 'cus_EszB7tXQtjsQhP')]
- payment_intent_id = ", ".join(payment_intent_extract)
- intent = stripe.PaymentIntent.retrieve(payment_intent_id)
- charges = intent.charges.data
- stripe.PaymentIntent.confirm(
- payment_intent_id,
- payment_method='pm_card_visa'
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement