#kekko7072 - automatic subscription payments
1 messages · Page 1 of 1 (latest)
How are you collecting payment details from your customers when they first subscripe?
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,
});
Why don't you just collect payment methods as part of the initial invoice?
for subscription i use
stripe.subscriptions.create({
customer: customerId,
items: [
{
price: priceId,
},
],
payment_behavior: "default_incomplete",
expand: ["latest_invoice.payment_intent"],
});
what do you mean?
then for the async process i use a webhook
Use the last invoice payment intent.client_secret to generate a front-end where you collect payment details from the customer
We break down the steps involved here: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
ok but the configuration of payment works fine
the problem is when subscription is charged that some cards doesnt works
ok yes i do it
this was only the backend, on front end i use a package for Flutter flutter_stripe https://pub.dev/packages/flutter_stripe
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,
),
);
and the client secret is generate in the backend using this
from the dashboard it says that it tried but then didn't worked
Do you have a request ID?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
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
There is a log, it's in your Stripe dashboard