#leonardo89-cards

1 messages · Page 1 of 1 (latest)

fallow socket
#

👋 happy to help

#

if you want to replace a card you'd have to manually detach the old one and add the new one

jagged trail
#

mm

#

perfect thanks @fallow socket

fallow socket
#

let me know if you need any more help

jagged trail
#

yes

#

my friend I have another doubt

#

if I cancel a subscription, in the last invoice property from the subscription object from the event customer.subscription.delete are the drafted invoice

#

???

#

let me explain better

#
  1. cancel subscription
#
  1. I receive webhook event customer.subscription.deleted
#
  1. Get latest invoice from subscription object send inside the event
#

Question: Is this latest invoice the draft invoice created when I cancel the subscription

#

?????

fallow socket
#

I'm not sure to be honest

#

at that point I think the last invoice is created and the Subscription object's latest_invoice should be updated with the final invoice

#

but I need to test it to be a 100% sure

jagged trail
#

ok if you have an answer later can you please let me know???

fallow socket
#

yes I'm trying to test it as we speak

jagged trail
#

perfect

#

please let me know

#

thank you so much

fallow socket
#

ok so I have a couple of answers for you

#

but first a quick question, do you need proration?

#

and are you creating metered usage subscriptions?

#

@jagged trail if the answer to both of these questions is no, then the latest_invoice on the subscription object you get on the customer.subscription.deleted event will be the last invoice that the customer paid which is the that of the current billing period

jagged trail
#

no I don't need a proration, and yes I'm creating metered subscription

#

if the customer cancel the subscription before end of billing period

#

I need to charge the usage during the period

fallow socket
#

then you'll have to record the usage before the cancellation

jagged trail
#

yes, Im currently doing

#

actually when I cancel the subscription

#

I'm setting the invoice_now att to true

#

so a draft invoice is created when I cancel the subscription

#

the doubt is

fallow socket
#

do you have the request id? here's how you can find it

jagged trail
#

this is the evt id

#

evt_1LIFIsGyos0XH35lOpd2J4ag

#

request ID

#

req_JRdASARpS2wvop

#

I confirmed

fallow socket
#

I just checked

jagged trail
#

the last invoice value from subscription sent in the event

fallow socket
#

yes

jagged trail
#

is the draft

#

yea

#

thanks

fallow socket
#

sorry it took me a while to get there

jagged trail
#

no problem

#

thank you

fallow socket
#

I'll have to step away for now, so I'll archive the thread