#ghostwalk3r
1 messages · Page 1 of 1 (latest)
hi
Hi there, looking..
Thanks 🙂
charge = stripe.Charge.create( payment_method='pm_1NQnvvLeN8gNaf8IPN0aeUIh', amount=8000, currency='gbp', description=f"str(order.id)-reschedule", customer='cus_OCoMIGnmfZTMx7', capture=True )
THis is the code I used
`# Attach the payment method to the customer
stripe.PaymentMethod.attach(
'pm_1NQnvvLeN8gNaf8IPN0aeUIh',
customer='cus_OCoMIGnmfZTMx7',
)
Set the payment method as the default for the customer
stripe.Customer.modify(
'cus_OCoMIGnmfZTMx7',
invoice_settings={
'default_payment_method': 'pm_1NQnvvLeN8gNaf8IPN0aeUIh',
},
)
`
Did this also before charging
Okie so this is a PaymentMethod, generated from a PaymentIntent, which is new API and good. Why do you want to use it in a legacy Charge API?
I actually want to charge the customer's card without his interaction
Like this part is when the customer does a reschedule and there is a small reschedule fee.
I don't want the customer to worry about selecting card and all that stuff.
Yeah then you can call creating PaymentIntent with confirm=true