2016-08-03 6 views
0

수 있습니다점점 오류 - 필드는 길거나 짧은 서버가 아닌이었다 내가 activemerchet를 사용하지만 오류 필드가 길거나 짧은 서버가 아닌이었다 받고 페이팔 지불 게이트웨이를 구현하기 위해 노력하고

수 있습니다 내가 프로 계좌의 신탁 계정을 사용하고 있습니다. 본인은 SO 질문을 보았다하지만

require 'rubygems' 
    require 'active_merchant' 
    ActiveMerchant::Billing::Base.mode = :test 

    gateway = ActiveMerchant::Billing::TrustCommerceGateway.new(
       :login => '[email protected]', 
       :password => 'my_password', 
       :signature => 'my_signature') 

    credit_card = ActiveMerchant::Billing::CreditCard.new(
        :first_name   => 'f_name', 
        :last_name   => 'l_name', 
        :number    => '4032034467080704', 
        :month    => '9', 
        :year    => '2021', 
        :verification_value => '123', 
        :brand => 'VISA' 
        ) 

    AMOUNT = 1000 
     def purchase_options 
     { 
      ip: "127.0.0.1", 
      billing_address: { 
       name:  "Flaying Cakes", 
       address1: "123 5th Av.", 
       city:  "New York", 
       state:  "NY", 
       country: "US", 
       zip:  "10001" 
      } 
     } 
     end 

if credit_card.validate.empty? 
    response = gateway.purchase(AMOUNT, credit_card, purchase_options) 
    if response.success? 
     puts "Successfully charged to the credit card #{credit_card.display_number}" 
    else 
     raise StandardError, response.message 
    end 
else 
    puts "credit card is not valid #{credit_card.errors.full_messages.join(". ")}" 
end 

답변

0

도움이 아니었다 나는

gateway = ActiveMerchant::Billing::PaypalGateway.new 


gateway = ActiveMerchant::Billing::TrustCommerceGateway.new

을 변경하고 그것을 잘 작동했다.