-1

背景

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

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卡上设置此类安全保留时,我们的交易会因“处理器被拒绝”或“被拒绝”错误而被拒绝。请注意,上述将用户帐户存储在保险库中并对信用卡收费的初始交易成功执行。只是后来的安全保留交易被拒绝。

问题

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

4

1 回答 1

0

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

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

: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
  }
)
于 2015-09-05T19:41:09.667 回答