Creating Subscription with a trial of 1 hour raises card error

32 views
Skip to first unread message

Liam Krewer

unread,
May 11, 2016, 10:37:18 AM5/11/16
to Stripe API Discussion
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

Remi J.

unread,
May 11, 2016, 10:45:25 AM5/11/16
to api-d...@lists.stripe.com
Hey Liam,

To give you the short answer though, when you create a subscription with a trial, we will reject that subscription if we think the card can't be charged in the future. This is to avoid you creating a subscription with a trial now when we know the charge will fail at the end of the trial.

This would be a better question for our support team though as it's more specific to your account and declines and not really an API issue or a thread about a feature request. You can contact support here [1] if you want more details.

All the best,
Remi


--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

Liam Krewer

unread,
May 11, 2016, 10:50:25 AM5/11/16
to Stripe API Discussion
Hi Remi,

Thank you for the prompt response.

Why isn't the card detected as fraudulent when it is added to the customer? This would seem the logical time to do so if you can tell a card is fraudulent without charging it.
In my case I already asked the customer to enter their card again, after this occurred the first time. It didn't reject the card then either, but caused the same error response the next day.

Are there any other potential errors I need to check for when creating the trial subscription, or is this the only scenario?

Regards,
Liam

Remi J.

unread,
May 11, 2016, 10:52:10 AM5/11/16
to api-d...@lists.stripe.com
Hey Liam,

As far as I know this is the only scenario! I'd recommend going through support instead though and provide concrete examples of failed requests if you want more details!

All the best,
Thomas

--
Reply all
Reply to author
Forward
0 new messages