mercredi 12 août 2015

Braintree rejects Discover cards on consecutive transactions

Background

We are executing the below method in order to charge a user and store his/her information in Braintree vault:

def store_in_vault
  Braintree::Transaction.sale(:amount => amount,
  :credit_card => {
    :cardholder_name => cardholder_name,
    :number => credit_card_number,
    :expiration_date => "#{credit_card_expiration_month}/#{credit_card_expiration_year}",
    :cvv => credit_card_cvv
  },
  :customer => {
    :id => user.id,
    :first_name => user.first_name,
    :last_name => user.last_name,
    :email => user.email,
    :phone => user.phone_main
  },
  :billing => {
    :first_name => user.first_name,
    :last_name => user.last_name,
    :street_address => street_address,
    :extended_address => extended_address,
    :locality => city,
    :region => state,
    :postal_code => zip,
    :country_code_numeric => country
  },
  :options => {
    :submit_for_settlement => false,
    :store_in_vault_on_success => true
  })
end

Later, we also put a hold on user's credit card as a security deposit.

All works well for most of the credit cards. However, when we try to put such security hold on Discover cards our transaction gets rejected with "Processor Declined" or "Declined" error. Note, that the initial transaction above to store user account in vault and charging credit card executes successfully. Just the later security hold transaction gets rejected.

Questions

Why this behavior happens only to Discover cards? How to fix it?

Thanks a lot!

Aucun commentaire:

Enregistrer un commentaire