How to simulate a failed billing attempt?

Brian_S
Excursionist
12 0 4

Hi - I'm working webhook handlers for a Shopify app that will leverage the new Subscriptions APIs. I would like to run a production env test of a failed billing attempt (to trigger the `subscription_billing_attempts/failure` webhook) but I can't seem to configure a scenario where that happens. 

In order to test this out, I created a subscription contract buy purchasing a subscription product on my dev store with a valid card. Then I triggered a payment method update email, clicked the link in the email and tried updating the card to one that would trigger a failed billing attempt. I've read through the test mode docs and tried the following: 

  • 4242424242424241 (incorrect number) but when I do this I'm unable to save the changes to the card bc I immediately get an error on the update page ("Failed to update your payment details. Please try again")
  • 4000000000000002 (card declined) same thing happens as with the incorrect number card
  • The invalid month, year, expiry do the same thing as expected
  • 4000000000000259 (disputed transaction) The disputed transaction card number lets me update the card number but when I attempt a new billing attempt it's successful which is what's expected for that card. (of course I get an immediate dispute but that's unrelated to what I'm testing)

 

Anybody have any recommendations on how to trigger a failed subscription billing attempt other than manually sending my webhook handler mock data? 

 

Thanks in advance for any help!

0 Likes
MajoMFR
Tourist
6 0 0

Hi,
I am currently facing the same scenario but I haven't got anything yet. The thing is that there is BillingAttempt event in docs but it not in events in dropdown list when we create a webhook.
If you have anything related to that kindly share.

0 Likes
B_A
New Member
4 0 0

I've run in to the same issue and it doesn't seem like there is much help out there. The only thing I can think of is to set the expiration date to expire in the current month and then wait for it to expire. Not very efficient given there are currently 27 days left in this month, but it's all I have.

0 Likes