Created
September 2, 2020 13:06
-
-
Save miodeqqq/4d4469f1c405854a5b8a044269deead4 to your computer and use it in GitHub Desktop.
Django & Stripe - charge_customer_card.py
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
payment_method = stripe.Customer.retrieve(user1.stripe_id).default_source | |
payment_intent = stripe.PaymentIntent.create( | |
amount=amount, | |
currency="pln", | |
payment_method_types=["card"], | |
capture_method="manual", | |
customer=user1.stripe_id, # customer | |
payment_method=payment_method, | |
application_fee_amount=application_fee_amount, | |
transfer_data={"destination": user2.stripe_id}, # connect account | |
description=description, | |
metadata=metadata, | |
) | |
payment_intent_confirm = stripe.PaymentIntent.confirm( | |
payment_intent.stripe_id, payment_method=payment_method | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment