#luciano-subs-sepadebit
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- luciano-subscription-sepadebit, 1 day ago, 26 messages
How can I help?
in practice, I create a customer with a sepa debit payment method, I create a subscription but it shows as incomplete status. why does the payment fail?
const paymentMethod = await stripe.paymentMethods.create({
type: 'sepa_debit',
sepa_debit: {
iban: "AT611904300234573201"//data.iban,
},
billing_details: {
name: data.nameOwner + " " + data.surnameOwner,
address: {
country: "IT",
line1: data.ownerResidence.address + " " + data.ownerResidence.nCivic,
state: data.ownerResidence.province,
city: data.ownerResidence.city,
postal_code: data.ownerResidence.zipCode,
},
email: data.email,
phone: "+39" + data.phoneNumber,
}
});
const customer = await stripe.customers.create(
{
name: data.nameOwner + " " + data.surnameOwner,
address: {
country: "IT",
line1: data.ownerResidence.address + " " + data.ownerResidence.nCivic,
state: data.ownerResidence.province,
city: data.ownerResidence.city,
postal_code: data.ownerResidence.zipCode,
},
description: "Proprietario del club",
payment_method: paymentMethod.id,
invoice_settings: {
default_payment_method: paymentMethod.id,
}
});
//TODO set real price
const subscription = await stripe.subscriptions.create({
customer: customer.id,
items: [
{ price: 'price_1O3kLhLgNVR2NB8Dceq1PF1n' },
],
});
this is code
obviously it's a test
If I had to guess, it might be related to mandate requirement.
You seem to be creating PaymentMethod directly by calling the API.
Which doesn't automatically create a mandate for the PaymentMethod
so what should I do?
in addition to the functions I called, what else should I add to create the mandate?
I believe my colleague mentioned that in your previous thread
Ignoring most of that: the problem is that you don't have any Mandate for your SEPA Debit PaymentMethod, so the Subscription will be incomplete as there's no way for it to be paid.
- Create the Subscription
- Complete the Subscription client-side with PaymentElement
- if you do that it will fill out the Mandate for you as expected
the problem is that I use flutter in client-side. Isn't there a more detailed guide for that language?
Unfortunately, we don't have have any guides for flutter.
luciano-subs-sepadebit
ok
one last thing, when I create the paymentintent for this procedure shouldn't it refer to the subcription somehow?
Sorry, I'm confused. Why are you creating a PaymentIntent for this?
When you create a subscription, the latest_invoice should have automatically created a PaymentIntent already (unless you use a trial)
in the guide he sent me he creates a payment intent
is it used to pay for the subscription?
No, that guide was meant to be used for learning how to collect the payment method details and mandate acknowledgement.
Taking a step back, all you want to do is to create subscriptions using SEPA payment methods right?
Is there a specific reason you're creating PaymentMethods directly by calling stripe.paymentMethods.create instead of using Stripe Elements?
No, if you let Stripe Elements handle this then there won't be an issue with the mandate.
We don't have a guide specific to mobile but you can combine two of the following:
follow step 1 through 4: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
Then, follow step 4 onwards: https://stripe.com/docs/payments/accept-a-payment?platform=android&ui=payment-sheet#android-collect-payment-details
Since we don't have flutter specific resources, the second guide is to be used just for reference. You'd need to implement your logic similarly.
ok, perfect, I'll try to proceed like this. thank you so much for your patience
NP! 🙂 Good luck