Hi,
I'm using the Stripe Ruby library in a Rails app. Currently on API version is 2015-02-18 (I know, I will get around to upgrading once there aren't any urgent tasks on my todo list).
Every day I check for users who are in a local trial (no subscription in stripe, only customer and card) which is expiring that day. Then I subscribe them to their selected plan with a 1 hour trial. This is done so as to avoid having to handle any errors in this task, and instead let the webhook endpoint do the heavy lifting.
But now I've had a customer who raises an error due to a bad card
Here is an example post to create the subscription on a customer with a card:
- {
plan: "plan_name" - quantity: "1",
- tax_percent: "0.0",
- trial_end: "1462781705"
}
And the response
{
error: {
message: "Your card was declined",
type: "card_error",
param: "card",
code: "card_decline",
decline_code: "fraudulent" }
}
Previously such an error would have only been raised either on card entry or when the trial expires and the card is charged.
Regards,
Liam