#oftysterista_api

1 messages · Page 1 of 1 (latest)

bronze gustBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1331187048782106727

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

flint nacelle
#

default_payment_method
string
ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer’s invoice_settings.default_payment_method or default_source.

i have read this in the api explorer

#

in the subscription object. what key that define this subsciption paid using what method

#

basicly my question is how do user change their payment method let say the credit card for the next billing period

amber path
#

Yes you should set default_payment_method on the Subscription object. Right now there's no PM to future invoice payments will fail

flint nacelle
#

when i create the subscription and paid for the first time, why the default_payment_method is null?

amber path
flint nacelle
#

what happend if it is null?

amber path
#

If you set that to on_subscription then we save the PM used to pay the initial invoice as the default for future invoices

amber path
flint nacelle
#

PM stands for payment method?

amber path
#

Yes

flint nacelle
#

wait

#

let me try to summarize

#

so when i create a subscription,

const subscription = await this.stripeClient.subscriptions.create({
  customer: stripeCustomer.customerId,
  items: [
    {
      price: prices.data[0].id,
    },
  ],
  payment_behavior: 'default_incomplete',
  expand: ['latest_invoice.payment_intent'],
})

this will create a suscription and will make the default_payment_method to null?

#

if the default_payment_method is null, the next period user will not be charge automatically but have to do it manually?

amber path
#

Yes and we won't save the payment method you use when confirming the intent (to start ther subscription)

flint nacelle
#

so how can i make it automatically paid the next month?

flint nacelle
#

await this.stripeClient.subscriptions.create({
customer: stripeCustomer.customerId,
items: [
{
price: prices.data[0].id,
},
],
payment_behavior: 'default_incomplete',
expand: ['latest_invoice.payment_intent'],
payment_settings: {
save_default_payment_method: 'on_subscription',
},
}))

okay i have set it like this

#

so if i use on_subscription it means it will save the PM that the user use when paid for the first time?

amber path
#

Yes exactly

#

So the payment details used to pay the first invoice, when you confirm the intent, will be saved and set as default_payment_method to be used to automatically pay future invoices

flint nacelle
#

okayy then if the user want to change the PM for that subscription, i just need to update the default_payment_method in the subscription?

amber path
#

Yes

flint nacelle
#

is that possible is 1 customer has multiple subs in 1 product?

amber path
#

Sure

flint nacelle
#

to create a payment method is there something like embeded component for the user to input the card number or something?

amber path
flint nacelle
#

okayy will read and try it first