0
私はrubyアプリケーションにbraintree支払いを実装しようとしていますが、すべてうまくいくようですが、fail_on_duplicate_payment_method_cardをオプションとして渡すと無効なキーが表示されます:options [fail_on_duplicate_payment_method_card]ruby on rails braintreeが重複した支払い方法で失敗する
result = Braintree::PaymentMethod.create(
:customer_id => current_user.customer_cim_id,
:payment_method_nonce => 'fake-valid-amex-nonce',
:cardholder_name => "#{current_user.first_name} #{current_user.last_name}",
:options => {
:make_default => true,
:fail_on_duplicate_payment_method_card => true
}
)
if result.success?
customer = Braintree::Customer.find(current_user.customer_cim_id)
puts customer.id
puts customer.payment_methods[0].token
else
p result.errors
end