Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 故障排除活动商户退货“;失败,出现500内部服务器错误;_Ruby On Rails_Rubygems_Activemerchant - Fatal编程技术网

Ruby on rails 故障排除活动商户退货“;失败,出现500内部服务器错误;

Ruby on rails 故障排除活动商户退货“;失败,出现500内部服务器错误;,ruby-on-rails,rubygems,activemerchant,Ruby On Rails,Rubygems,Activemerchant,下面的代码 purchase = @order.authorize_payment(@credit_card, options) is_success = purchase.success? if is_success ... else flash[:notice] = "!! " + purchase.message + "" + purchase.params['missingField'].to_s redi

下面的代码

purchase = @order.authorize_payment(@credit_card, options) is_success = purchase.success? if is_success ... else flash[:notice] = "!! " + purchase.message + "
" + purchase.params['missingField'].to_s redirect_to :action => :payment, :id => @order.id end 购买=@order.authorize\u付款(@credit\u卡,选项) _success=purchase.success? 如果你成功了 ... 其他的 flash[:notice]=“!!”+purchase.message+“
”+ purchase.params['missingField']发送至 重定向到:action=>:payment,:id=>@order.id 结束 结果在我的flash中出现“!!失败,内部服务器错误为500”[:注意]。没有stacktrace,没有Web服务器错误,我只知道purchase.message被填充,purchase.success?这是错误的

我真的不知道如何解决这个问题。我认为这可能是一个ssl要求,但我既看不到soap请求,也无法测试与cybersource(我的支付网关)的基本连接

我使用此代码建立网关(在config.after\u初始化do之后):

ActiveMerchant::Billing::Base.mode=:生产#:测试 ActiveMerchant::Billing::CreditCard.require\u verification\u value=false ActiveMerchant::Billing::CyberSourceGateway.wireddump_device=File.new(File.join([Rails.root,“log”,“cybersource.log”]),“a”)#不工作(!) #我们需要打开一个外部文件来获取密码 mypassphrase=File.open('/var/www/foo/shared/passphrase.txt')。读取 OrderTransaction.gateway=ActiveMerchant::Billing::CyberSourceGateway.new(:login=>'Vxxxxxx', :password=>mypassphrase.to_, :test=>false, :vat注册号=>“您的vat注册号”, #设置您有税务实体存在的州/省 :nexus=>“嘎哦”, #不想使用AVS,所以即使AVS失败也要继续处理 :ignore_avs=>true, #不想使用CVV,所以即使CVV失败也要继续处理 :ignore_cvv=>true, :money\u format=>:美元 ) 我可以查看soap请求吗?有没有办法测试其中的一部分?非常感谢您的帮助

最好的


蒂姆

所以,反应很晚,但

我在CyberSourceGateway上做了大量工作,目前查看CyberSourceGateway的SOAP请求/响应的唯一方法是打开gem并对其进行编辑

如果修改lib/active_merchant/billing/gateways/cybersource.rb的提交方法,可以执行以下操作:

def commit(request, options)
    puts "*** POSTING TO: #{test? ? TEST_URL : LIVE_URL}"
    request =  build_request(request, options)
    puts "*** POSTING:"
    puts request
    begin
         post_response = ssl_post(test? ? TEST_URL : LIVE_URL, request)
    rescue ActiveMerchant::ResponseError => e
      puts "ERROR!"
      puts e.response
    end
    puts post_response

如果有一种方法可以在不经历麻烦的情况下获得响应,那就太好了。我将看看是否有一种方法可以通过返回的响应对象向上传递该信息,并将其添加到我的fork中。

因此,响应延迟,但

我在CyberSourceGateway上做了大量工作,目前查看CyberSourceGateway的SOAP请求/响应的唯一方法是打开gem并对其进行编辑

如果修改lib/active_merchant/billing/gateways/cybersource.rb的提交方法,可以执行以下操作:

def commit(request, options)
    puts "*** POSTING TO: #{test? ? TEST_URL : LIVE_URL}"
    request =  build_request(request, options)
    puts "*** POSTING:"
    puts request
    begin
         post_response = ssl_post(test? ? TEST_URL : LIVE_URL, request)
    rescue ActiveMerchant::ResponseError => e
      puts "ERROR!"
      puts e.response
    end
    puts post_response

如果有一种方法可以在不经历麻烦的情况下得到回应,那就太好了,我将查看是否有方法通过返回的响应对象向上传递该信息,并将其添加到我的fork中。

ActiveMerchant::Billing::CyberSourceGateway.logger=您的\u logger

ActiveMerchant::Billing::CyberSourceGateway.logger=您的\u logger

否,没有错误或异常,仅@order.authorize\u payment的success属性为false。所以我很想得到stacktrace。从操作系统或ruby的角度来看,没有错误。我能得到的唯一反馈是flash中的错误消息,这不是很有帮助。flash[:notice]=purchase.errors.full_messages.join('),这不起作用,但我通过在桌面上运行生产模式并调试代码修复了问题。不,没有错误或异常,仅@order.authorize\u payment的success属性为false。所以我很想得到stacktrace。从操作系统或ruby的角度来看,没有错误。我能得到的唯一反馈是flash中的错误消息,这不是很有帮助。flash[:notice]=purchase.errors.full_messages.join(',)不起作用,但是我通过在桌面上运行生产模式并调试代码解决了这个问题。你知道cybersource为什么发送500响应吗?你知道cybersource为什么发送500响应吗?