#kekko7072 - automatic subscription payments

1 messages · Page 1 of 1 (latest)

merry shoal
#

How are you collecting payment details from your customers when they first subscripe?

radiant fossil
#

I create a customer and then let user configure the payment method and finally create the subscription.

#

and i also configured to future intent

#

and if i use 424242 card works perfectly and automatically

#

but in production where card have more layer of security or for example card 4000 0027 6000 3183

#

things doesn't work

#

I use setupIntents.create({
customer: customer.id,
payment_method_types,
});

merry shoal
#

Why don't you just collect payment methods as part of the initial invoice?

radiant fossil
#

for subscription i use

#

stripe.subscriptions.create({
customer: customerId,
items: [
{
price: priceId,
},
],
payment_behavior: "default_incomplete",
expand: ["latest_invoice.payment_intent"],
});

radiant fossil
#

then for the async process i use a webhook

merry shoal
#

Use the last invoice payment intent.client_secret to generate a front-end where you collect payment details from the customer

radiant fossil
#

ok but the configuration of payment works fine

#

the problem is when subscription is charged that some cards doesnt works

radiant fossil
#

to register the cards

#

this is the dart code

#

//4. Confirm setup intent
final setupIntentResult = await stripe.Stripe.instance.confirmSetupIntent(
clientSecret,
stripe.PaymentMethodParams.card(
setupFutureUsage: stripe.PaymentIntentsFutureUsage.OffSession,
billingDetails: billingDetails,
),
);

radiant fossil
#

from the dashboard it says that it tried but then didn't worked

merry shoal
radiant fossil
#

if you want i have the info of the webhook event

#

this is the id

#

evt_1KlyOxA94JJJ3znbm0Q7Itjp

#

"amount_due": 150,
"amount_paid": 0,
"amount_remaining": 150,
"application_fee_amount": null,
"attempt_count": 1,
"attempted": true,
"auto_advance": true,
"automatic_tax": {
"enabled": false,
"status": null
},
"billing_reason": "subscription_cycle",
"charge": null,
"collection_method": "charge_automatically",

#

but there is no log

#

i have only an event of the attempt in the webook

merry shoal
#

There is a log, it's in your Stripe dashboard