Braintree 在连续交易中拒绝 Discover 卡

Braintree rejects Discover cards on consecutive transactions

背景

我们正在执行以下方法以向用户收费并在 Braintree 保险库中存储 his/her 信息:

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

后来,我们还冻结了用户的信用卡作为保证金。

所有信用卡都适用于大多数信用卡。但是,当我们尝试对 Discover 卡进行此类安全保留时,我们的交易会因 "Processor Declined" 或 "Declined" 错误而被拒绝。请注意,上面将用户帐户存储在保险库中并向信用卡收费的初始交易已成功执行。只是后来的安全保留交易被拒绝了。

问题

为什么这种行为只发生在 Discover 卡片上?如何解决?

它与 Discover 卡验证过程有某种关系。他们要求在交易中包含 CVV 和邮政编码。

根据 Braintree 支持:上述请求中的选项必须包括:add_billing_address_to_payment_method => 如下所示:

:options => {
  :submit_for_settlement => false,
  :store_in_vault_on_success => true,
  :add_billing_address_to_payment_method => true
}

此外,在申请更换信用卡时(如果需要),应添加:billing_address信息:

Braintree::CreditCard.create(
  :customer_id => "#{user_id}",
  :number => cc_number,
  :expiration_date => "#{expiration_month}/#{expiration_year}",
  :cardholder_name => cardholder_name,
  :cvv => cvv,
  :billing_address => {
    :street_address => street_address,
    :extended_address => extended_address,
    :locality => city,
    :region => state,
    :postal_code => zip
  },
  :options => {
    :make_default => true
  }
)