#ahjaydog-expand

1 messages ยท Page 1 of 1 (latest)

sly whale
#

๐Ÿ‘‹ Happy to help

magic onyx
#

For event.type == 'invoice.payment_failed': I was wondering to expand on subscription

#

Or should I just make another API call using stripe.Subscription.retrieve(event.data.object.subscription) or stripe.Invoice.retrieve(event.data.object.id,expand=[subscription]) ?

sly whale
magic onyx
#

ok so there is no way to do stripe.Event.retrieve("evt_1LCxSgIeTJrsS1rekQWa7dWn",expand=[subscription]) ?

sly whale
#

let me check

magic onyx
#

ok

sly whale
#

that's currently not possible; the expand will only be on invoice retrieval call

magic onyx
#

ok thanks

#

is there a test card to test for failed invoices?

#

or this event.type == 'invoice.payment_failed'

sly whale
#

are you looking to have invoice event with subscription failed or just normal invoice without subscription?

magic onyx
#

both

#

I will probably do if invoice_id == None: and if invoice_id != None: to tell the difference between subscription and one time invoice

sly whale
magic onyx
#

What would the command be?

sly whale
#

For example, stripe trigger invoice.payment_failed

magic onyx
#

I don't provide an invoice id?

#

I want to see it in action on the dashboard to see what happens if possible

#

or how would i do it in test clocks?

#

I was able to do it for a subscription in test clock by removing the card then fast forwarding time

sly whale
magic onyx
#

ok hold on let me see

sly whale
#

For subscription invoice, you can use the test card with "Decline after attaching"

#

For non-subscription invoice, you can use any decline test card

magic onyx
#

the command trigger worked

#

ok i'll try those too

#

thank you

sly whale
#

No problem! Happy to help ๐Ÿ™‚