gpt4 book ai didi

ruby - 活跃的 ruby 商人

转载 作者:太空宇宙 更新时间:2023-11-03 16:36:03 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
An invalid merchant configuration in Paypal with rails

我正在玩 Active Merchant gem。我用了Rails cast(144)我创建了一个 ruby​​ 文件 (credit_card.rb):

require "rubygems"
require "active_merchant"

ActiveMerchant::Billing::Base.mode = :test

gateway = ActiveMerchant::Billing::PaypalGateway.new(
:login => "seller_1316503855_biz_api1.agileblaze111.com",
:password => "********",
:signature => "A5llddES-nIiDc8WBuZMOtm6yM2oANQrerVY20ty0ZxeN-izmKjwDtR0"
)

credit_card = ActiveMerchant::Billing::CreditCard.new(
:type => "visa",
:number => "4234609806354393",
:verification_value => "123",
:month => '9',
:year => '2016',
:first_name => "shamith",
:last_name => "c"
)

billing_address = {
:name => "John Smith",
:address1 => '123 First St.',
:address2 => '33333',
:city => 'Los Angeles',
:state => 'CA',
:country => 'US',
:zip => '90068',
:phone => '310-555-1234'
}

billing_address1 = {
:name => 'Test User',
:company => '',
:address1 => '123 S Main St',
:address2 => '',
:city => 'Akron',
:state => 'OH',
:country => 'US',
:zip => '44333',
:phone => '(310)555-5555'
}


if credit_card.valid?
puts "Credit Card is valid"
response=gateway.purchase(1000,credit_card,:ip=>"127.0.0.1",:billing_address=>billing_address1)
if response.success?
puts "Purchased"
else
puts "Error:#{response.message}"
end
else
puts "Error: credit card is not valid. #{credit_card.errors.full_messages.join('. ')}"end

我执行 $ ruby​​ credit_card.rb 并得到以下错误:

Error: This transaction cannot be processed due to an invalid merchant configuration.

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com