#vibha-sharma_api

1 messages ¡ Page 1 of 1 (latest)

viral sentinelBOT
#

👋 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.

celest creek
upbeat path
#

can we use lines->data[0] only for taking period ?

#

because period start and end are same for all line items

viral sentinelBOT
earnest vine
#

you can do a lines->data.filter() for that

upbeat path
#

I have subscription id in invoice object not subscription item id

earnest vine
upbeat path
#

and how can we get invoice item from invoice id??

earnest vine
#

the lines property on the Invoice object

viral sentinelBOT
upbeat path
#

actually I wanna show the period in from date to date form for which invoice is created

earnest vine
#

not sure what that means sorry

upbeat path
#

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

earnest vine
#

what does " duration for which invoice is created" mean? can you explain with an example?

upbeat path
#

like that

earnest vine
#

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?

upbeat path
#

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

earnest vine
upbeat path
#

so can I use only one invoice item for that ?

#

any one of them

earnest vine
#

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.

upbeat path
#

and if I have 2 invoice item with type "subscription" then?

earnest vine
#

if that happens they all have the same period so it doesn't matter which one you look at

upbeat path
#

okkk thanx

#

and I have another query on different topic

#

can I ask?

earnest vine
#

sure

upbeat path
#

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?

earnest vine
#

a Customer object can have multiple Subscriptions yes

upbeat path
#

how can we handle both subscription running on different payment method

#

?

earnest vine
#

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

viral sentinelBOT
upbeat path
#

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,
]);

finite rampart
#

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?

upbeat path
#

how can i create payment method for bank transfer

finite rampart
#

are you talking about recurring payment with Subscription, or a one time payment?

upbeat path
#

recurring