#Moustache - mandate error

1 messages ยท Page 1 of 1 (latest)

deft willowBOT
fallow venture
#

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
)

indigo crane
#

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?

fallow venture
#

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.

indigo crane
#

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

fallow venture
#

ok, thank you

#

Is there a better approach I should consider that doesn't use sources?

indigo crane
#

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.

fallow venture
#

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

north fractal
#

Hi there
Stepping in as Pompey needs to step away

fallow venture
#

thanks, hanzo

north fractal
#

Can you try omitting invoice_settings parameter from the Customer.modify(...)? As far as I know, subscription should use default_source instead

fallow venture
#

hmm ok

#

ok, I see. I think I got it. Let me run some tests. BRB

north fractal
#

๐Ÿ‘

fallow venture
#

THat worked!! Thank you

north fractal
#

NP! ๐Ÿ™‚ invoice_settings.default_payment_method is what the subscription uses if you use PaymentMethods API