2
votes

I want to validate a credit card number in braintree without creating customer account. If the card valid means then only i will do some logic.

I have 3 step registration. In that first step i have to validate card details. 3rd step only i will save all the necessary details.

1
If you're storing credit card details in your step 3, then I hope that you're fully PCI compliantMark Baker
What level of card validation do you need? Simply checking that the card number isn't random digits? Use the Luhn formulaMark Baker
@Mark Baker : for some credit card i check whether it is 12 or 16 digit number. But during create braintree credit account it shows invalid card details. i want to validate without create braintree credit account.Sathish M

1 Answers

1
votes

I work at Braintree. If you have more questions or are looking for more help with your integration, please get in touch with our support team.

Consider using Braintree's Drop-in Payment UI, which will do a client side validation of the credit card.

Otherwise, you have to create or update a credit card, directly or indirectly, in order to run a card verification:

result = Braintree::Customer.create(
  :first_name => "Fred",
  :last_name => "Jones",
  :credit_card => {
    :cardholder_name => "Fred Jones",
    :number => "4111111111111111",
    :cvv => "123",
    :expiration_date => "05/2020",
    :options => {
      :verify_card => true
    }
  }
)