#ghostwalk3r

1 messages · Page 1 of 1 (latest)

mossy valeBOT
crimson rain
#

hi

naive drift
#

Hi there, looking..

crimson rain
#

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

naive drift
#

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?

crimson rain
#

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.

naive drift
#

Yeah then you can call creating PaymentIntent with confirm=true

crimson rain
#

ok

#

Do i have to give capture_method='automatic' ?