0
이유를 찾을 수 없습니다. 그것은 단지 작동하지 않습니다. 38 : ''에서 : 그ActiveMerchant 응답은 paypal에 대해 StandardError를 제공합니다.
test.rb과 같은 오류가 필드가 길거나 짧은 서버 허용 (StandardError)에 비해 나는 경우
require "rubygems"
require "active_merchant" # 1.44
ActiveMerchant::Billing::Base.mode = :test
credit_card = ActiveMerchant::Billing::CreditCard.new(
:brand => 'Discover',
:number => "6011290531695840",
:month => 10,
:year => 2019,
:first_name => "Andrew",
:last_name => "Buyer",
:verification_value => '123'
)
gateway = ActiveMerchant::Billing::TrustCommerceGateway.new(
:login => 'andrew.nashkolniy-facilitator_api1.gmail.com',
:password => 'TB6WUMTVUGYC6YAM'
)
amount = 100
if credit_card.validate.empty?
response = gateway.authorize(amount, credit_card, :ip => "127.0.0.1")
if response.success?
gateway.capture(1000, response.authorization)
else
raise StandardError, response.message
end
else
puts "Error: credit card is not valid."
end