#arsalan-chagefailed
1 messages · Page 1 of 1 (latest)
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.
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
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
what we usually suggest is you update the trial_endof an active subscription to ~5 minutes in the future. When the trial ends it will generate a recurring invoice which follows the same exact pattern as regular recurring invoices so that's useful for testing (https://stripe.com/docs/billing/invoices/subscription#subscription-renewal)
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)
what would be the reason for invoice to return null ?
what's thech-xxxcharge 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!
hmm let me do it again right now. and send you one.
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
whats the current stable API I should use ?
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
great
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
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 ?
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
you should read https://stripe.com/docs/api/versioning and the link I posted above in detail to understand what the API version means and what it effects