#Moustache - mandate error
1 messages ยท Page 1 of 1 (latest)
Here is the python code used: source = stripe.Customer.create_source(
customer.stripe_id,
source=token,
stripe_account = request.tenant.stripe_account_id
)
stripe.Customer.modify(
customer.stripe_id,
default_source=source.id,
invoice_settings = {'default_payment_method': source.id},
stripe_account=request.tenant.stripe_account_id
)
Thanks for the info. Checking in to that error
Moustache - mandate error
Still looking. One quick question, are you just getting started on this subscription now, or are you updating an existing integration that uses sources?
I am currently using an integration that uses sources. Should I update to paymentmethods?
After running the above code, I start the subscription later with the following: sub = stripe.Subscription.create(
customer=customer.stripe_id,
items=[{"plan": plan.stripe_id}],
trial_end=trial_end_timestamp,
payment_behavior='error_if_incomplete',
automatic_tax={
"enabled": True
},
coupon = coupon_id,
stripe_account = request.tenant.stripe_account_id
)
This has always worked in that past. The customer with the error is using a bank account which may be related.
Oh I see this bank account/token was created with Plaid. I am still looking in to how to work with mandates + sources here. I am less familiar with how to do this or if it is possible outside of our payment methods API
ok, thank you
Is there a better approach I should consider that doesn't use sources?
The modern flow for bank account payments uses payment methods, we show it in action here. In that one the mandate info is automatically handled by Stripe https://stripe.com/docs/payments/ach-debit/accept-a-payment
You may be able to ask Plaid how they handle Stripe mandates and if you want to keep using something closer to your current integration.
I see. So I get a bank_account token from Plaid. Could I just use that to create a PaymentMethod in Stripe?
After reading the docs it appears that will not work as the PaymentMethod.create us_bank_account requires account number/routing number
Hi there
Stepping in as Pompey needs to step away
thanks, hanzo
Can you try omitting invoice_settings parameter from the Customer.modify(...)? As far as I know, subscription should use default_source instead
๐
THat worked!! Thank you
NP! ๐ invoice_settings.default_payment_method is what the subscription uses if you use PaymentMethods API