Search code examples
recurly

Card number verification during trial


I would like to offer a free trial of a subscription plan to users, and I would like to avoid users simply canceling the trial before the end and restarting again. So I would like to offer the trial only if the card is valid and hasn't been used before.

Is there a way through recurly to detect if a card number has been used before?

Additionally, what's the recommended way to verify cards through the api?


Solution

  • There is no way to detect if a card number has been used before. Perhaps validating using address or IP address could be a partial viable solution for limiting serial signups.

    If you want to verify that the card is valid, Recurly will run a verification on the card once it's been saved to an account.

    If you want to verify that card number is valid, use Recurly.js's recurly.validate.cardNumber, which validates a credit card number via luhn algorithm:

    recurly.validate.cardNumber('4111-1111-1111-1111'); --> true