#vibha-sharma_api
1 messages ¡ Page 1 of 1 (latest)
đ 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/1291335300643291177
đ 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.
- vibha-sharma_api, 6 days ago, 15 messages
- vibha-sharma_api, 6 days ago, 16 messages
Have you checked the priod inside the line item?
https://docs.stripe.com/api/invoices/object#invoice_object-lines-data-period
can we use lines->data[0] only for taking period ?
because period start and end are same for all line items
it's better to check the lines->data that has https://docs.stripe.com/api/subscription_items/object#subscription_item_object-subscription set to non-null, that is the item that is billing for the Subscription
you can do a lines->data.filter() for that
I have subscription id in invoice object not subscription item id
ah yeah , sorry, I meant look at the invoiceItem that is type:"subscription" https://docs.stripe.com/api/invoice-line-item/object#invoice_line_item_object-type
and how can we get invoice item from invoice id??
the lines property on the Invoice object
actually I wanna show the period in from date to date form for which invoice is created
not sure what that means sorry
I have created a subscription monthly basis and which is recurring for number of months
so I got all the invoices for that subscription
and I would like to show duration for which invoice is created
what does " duration for which invoice is created" mean? can you explain with an example?
like that
cool. So what did you try already? for example, take the Invoice object that you're looking at in that screenshot. Does the period on that Invoice tell you that information?
I have search this invoice id on my stripe dashboard from where I got this information that "2nd oct -2nd nov 2024"
and I don't know I can I got this from invoice
when you retrieve that invoice from the API and in your code you look at https://docs.stripe.com/api/invoice-line-item/object#invoice_line_item_object-period for each line item, what do you see?
The information is there.
no. Use the item that is type:"subscription" https://docs.stripe.com/api/invoice-line-item/object#invoice_line_item_object-type
if you're writing code it's quite easy to do a filter/find in most languages to find the item in the array of lines.data that has that type.
and if I have 2 invoice item with type "subscription" then?
if that happens they all have the same period so it doesn't matter which one you look at
sure
If a customer create a monthly subscription with card payment for 1 year
and another monthly subscription with bank transfer of same customer
is it possible?
it just works really, did you try? was there a specific difficulty?
like a Subscription has a default_payment_method and each subscription can have a different one
hi soma
I am unable to set default_payment_method to subscription because I have created payment_method like that
$this->stripe->paymentIntents->create([
'amount' =>2000, // Amount in the smallest currency unit
'currency' => 'gbp,
'automatic_payment_methods' => [
'enabled' => true,
'allow_redirects' => 'never', // Prevent automatic redirects
],
'payment_method_data' => ['type' => 'customer_balance'],
'confirm' => true,
'customer' => $customer->id,
]);
hi there!
that PaymentIntent created a PaymentMethod that cannot be reused. so you cannot use that PaymentMethod on a Subscription.
what exactly are you trying to do and what is the issue?
how can i create payment method for bank transfer
are you talking about recurring payment with Subscription, or a one time payment?
recurring