For discussing the development and integration of subscription-enabled shops using Shopify's Subscription APIs.
Hi everyone!
I'm trying to renew a subscription for free, but I'm encountering an `UNEXPECTED_ERROR` error code in the created billing attempt. This issue occurs for both Bogus Testing Gateway and Stripe (test mode). However, as soon as I update the subscription contract so that its total is larger than $0, the renewal can be completed successfully (using the same payment method that previously failed).
Is it impossible to create a billing attempt when the subscription's total is equal to $0?
Here are the steps to replicate the issue:
1. Create a subscription contract.
2. Add a 100% manual discount for all line items.
3. Add a free shipping discount.
4. Create a billing attempt.
This results in the following error in the billing attempt object:
{
"errorCode": "UNEXPECTED_ERROR",
"errorMessage": "There was a problem processing the payment for this billing attempt"
}
If there's no payment to be collected what would be the purpose of making a billing attempt? My best guess is that the payment provider is blocking this transaction from going through. For example, Stripe enforces a minimum charge of USD $0.50.
I am creating a billing attempt because it seems to be the only way to place an order for a subscription. I had considered manually creating an order, but it appears impossible to replicate the anchors on the subscription's delivery policy.
Ideally, there would be a way to place an order and skip the billing attempt, but as far as I know, there is none.
Yeah a BillingAttempt could be used to bill $0 for a prepaid subscription, it's really more of a DoThingPerTermsOfSubscriptionContract action than an actual bill.
It is possible to create a BA with a $0 cost. If you're just testing I'd use Shopify Payments in test mode. I'd bet that its got something to do with the payment gateways you're using. I didn't know that you could test subscriptions with the Bogus Gateway (thought it had to be one of the valid gateways). I believe Stripe will let you but obviously there's something not working there either. Perhaps remove bogus gateway and then try Stripe. And if that doesnt work remove stripe and I bet it'll work with Shopify Payments in test mode.
also - make sure this flag is `true` on your shop and you're not missing something else.. `eligibleForSubscriptions` (though it should be if you're able to get to check out with a subscription product in the cart)
I will definitely check this with Shopify Payments. I've also tested Stripe, which failed when the total was $0 but went through normally when the subscription total was $9.99. Anyway, it would be great if there was a way to support all subscription payment methods, but it's still better than nothing!
You can use the Bogus Gateway if you enable PayPal (with automated payments accepted), otherwise you will get an error that there are no payment methods available.
Edit: I can confirm that Shopify Payments works in this case.
I've also had this problem creating BillingAttempts after changing the price of a product after purchasing a subscription during testing. I.E. the price of my product was $0.00 for testing, changed it to $12.99 for testing, and now I'm having this error.
Figured out that my issue was BillingAttempts being created while another for the same contract was pending