#arsalan-chagefailed

1 messages · Page 1 of 1 (latest)

spice palm
#

chargefailed*

#

@uncut kiln well there will only an invoice field in the charge.failed event if the Charge itself was created from an Invoice(which they don't have to be)

#

seems to me the easiest way to test this is to run stripe trigger invoice.payment_failed if you have stripe-cli installed! should do what you need.

uncut kiln
#

I am able to test using the exact way you mentioned, whats the procedure to make some payment to compulsory based on an invoice ? My product is monthly subscription here

#

are the invoices only performed from subsequent subscriptions and not from the first one ? because I tested on the first subscription payment

spice palm
#

some payment to compulsory based on an invoice ?
I don't understand this sorry

#

in any case are you asking how to test the recurring payments?

#

unfortunately there's not good way, since the minimum billing period is a day

uncut kiln
#

my goal is to mimic a payment, which fails, and then we get a retry link, which user clicks so that he can simply retry payment. support guys here told the above method I used, but only problem is that invoice is returning null. what would be the reason for invoice to return null ? (keep in mind the user is subscribing for monthly charges for the first time)

spice palm
#

what would be the reason for invoice to return null ?
what's the ch-xxx charge ID where you saw it was null?

#

also I answered that question earlier :

well there will only an invoice field in the charge.failed event if the Charge itself was created from an Invoice(which they don't have to be)
but looking at the charge itself should help clear things up!

uncut kiln
#

hmm let me do it again right now. and send you one.

uncut kiln
#

evt_3JZCPlAn6KHFw7ob0KdSTRn3 is the charge event

#

thanks for waiting

spice palm
#

you're using a 2014 API version which is related

#

in that version if the first payment of the subscription fails no invoice is created which is why it's null

uncut kiln
#

whats the current stable API I should use ?

spice palm
#

in more recent versions an invoice would be created : https://stripe.com/docs/upgrades#2019-03-14

creating a subscription succeeds even when the first payment fails. The subscription will be created in an incomplete status, where it will remain for up to 23 hours. During that time period, it can be moved into an active state by paying the first invoice. If no successful payment is made, the subscription will move into a final incomplete_expired state. Updates to a non-incomplete subscription that require a payment will also succeed regardless of the payment status. Prior to this version, all creations or updates would fail if the corresponding payment failed

uncut kiln
#

great

spice palm
#

they're all stable and ideally you should use the latest but you should read that page to understand what that means and how the upgrade works

uncut kiln
#

alright thanks. I will be using it right away and testing it

#

dude I am using "stripe": "^8.170.0" that was published 25 days ago

#

is API version different thing ?

spice palm
#

yes it's completely different

#

that's just the version of our stripe-node library, the library is not connected to the API version on your account

uncut kiln
#

ok thanks

#

can you just point out how to set API version to current ? is it set in the stripe portal or do I have to install something ?

#

nevermind got it . thanks