#abdhesh-rajput_api

1 messages ¡ Page 1 of 1 (latest)

frozen hollyBOT
#

👋 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/1224661629057110028

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

trim raftBOT
#

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.

simple scarab
#

hi there! I'm not sure I follow your question. can you clairfy with a concrete example of what you are trying to do exactly?

runic flame
#

i need to give free trial for my customer for that i creating subscriptin with trial.
for creating subscription i use setup also getting card details working

now issue is my payment invoices is showing in draft.
what is means of draft here

also there one scenarios i have two type of pricing implementation one time pricing
another one in platform

I added new invoices item for implementation after listing invoices.created on my webhook

now next cycle invoices is showing implementation + platform but i want only platform.
implementation is one time pricing

simple scarab
#

it looks like you are asking many questions at the same time. let's try to focus on them one by one.

#

for creating subscription i use setup also getting card details working
if you create a Subscription, then you don't need to create a SetupIntent. you would just use the SetupIntent created by the Subscripton, correct?

#

now issue is my payment invoices is showing in draft.
Can you share an example of this? For example a Subscription ID (sub_xxx) or Invoice ID (in_xxx)?

runic flame
#

this is my invoice id in_1P13fpCz4DYWbcET2o8FYAwW

simple scarab
#

that's normal. Invoices created by Subscriptions are in Draft status, and then automatically become finalized one hour later

#

this is to allow you to make some changes to the invoice if needed

runic flame
simple scarab
#

if you don't want that delay, you can always finalize the invoice yourself

runic flame
#

suppose my implementation amount is
100
and platform amount is 20

so first subscription cycle it is 120 which right
but second subscription cycle why it is again 120

simple scarab
#

I'm sorry I'm confused. the invoice you shared is for 199$, and everything goes to the main Stripe account.

#

what do you mean by "implementation amount is 100 and platform amount is 20"

runic flame
#

okay sorry for the confusion

this is subscription in which i have
sub_1P13eRCz4DYWbcETvsxLx2JS

one is for $150 another is for $49

150 is one time
49 is reccurring

#

Next invoice
US$199.00 on 3 Apr

but i want here only recurriing payment of 49

simple scarab
#

got it. having a look.

#

are you talking about the $150 in the upcoming invoice?

runic flame
#

okay i got it. i think it is because every time invoice.created occured i create another invoice_item

i prevent using status changes in my project

#

case "invoice.created":
const invoiceCreated = event.data.object;

            // Then define and call a function to handle the event invoice.created
            const subscription_id = invoiceCreated.subscription;

            const stripeDetail = await commonDao.getStripeDetail({subscriptionId : subscription_id})

            if(stripeDetail){
                //creating new invoice list 
                await stripeHelper.createInvoiceItem({ customer: stripeDetail.customerId, price: stripeDetail.implementationPriceId});
                await commonDao.updateStripeDetail(stripeDetail.id)
            }
        break;

this is code of it

#

check it on my sub_1P14i0Cz4DYWbcETm4cMzL3J

simple scarab
#

okay i got it. i think it is because every time invoice.created occured i create another invoice_item
yes possible. looks like you only want to add the invoice item the first time the Subscription is created? in the case you can listen to customer.subscription.created event.

runic flame
#

Thanks for Help @simple scarab

runic flame
#

which webhook event is usefull for checking payement deduction ???

simple scarab
#

what do you mean by" payment deduction"? that the payment was successful?

#

for Subscription it's invoice.paid

runic flame
#

does they care failure like
1.customer doesn't have enough amount
2.incorrect card entry.
3. Card Expiration

simple scarab
#

I don't understand your question, sorry. can you clarify?

runic flame
#

for Example on customer billing date is 5April
but customer's card get Expired on 4April