#emng-subscription
1 messages · Page 1 of 1 (latest)
if default_payment_method isn't set on the subscription object, the subscription will use the invoices will use the customer’s invoice_settings.default_payment_method or default_source.
Retrieve the subscription and expand the parameters [0] e.g. customer.invoice_settings.default_payment_method
so in the UI, I see this on the customer's subscription
I navigated here through customer -> actions -> update subscription. Is this suggesting that default_payment_method should be something other than null?
no, not necessarily. You could have created a subscription with a trial via the API previously. At this point in time, the subscription doesn't need to have a default_payment_method nor does the customer need to have invoice_settings.default_payment_method or default_source set.
The customer could have that payment method before hand, but it's not the invoice_settings.default_payment_method or default_source
so will this subscription charge ***4242 next cycle?
can you share the subscription id so that i can take a look?
I got here by creating a subscription on the server and passing the clientSecret to the UI and then making this call
let { error } = await stripe.confirmCardPayment(data.clientSecret, {
payment_method: {
card: elements.getElement(CardElement),
billing_details: {
name: name,
},
},
});
is this the correct way to make the subscription?
sure, this is using the test network, is that okay?
looks fine. If you haven't seen this guide : https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements, you can use it as a reference. Yes, you can pass me the subscription id made in test mode
you haven't updated either the default_payment_method on the subscription, or set that payment method as invoice_settings.default_payment_method
so no, payment wouldn't succeed
subsequent payments, right? the initial payment looks like it went through fine
yeah, subsequent payments
I see so after the customer pays, I need to fetch the payment intent object and use it to set the default_payment_method on the subscription object?
onesec, let me test something
yep, it's mentioned here : https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#default-payment-method
got it, thanks for the help!