ruby on rails - Troubleshooting Active Merchant returning "Failed with 500 Internal Server Error" -
the following code
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
results in "!! failed 500 internal server error" in flash[:notice]. there no stacktrace, no webserver error, know purchase.message populated , purchase.success? false.
i @ loss figure out how troubleshoot this. think might ssl requirement, can't either see soap request, or test basic connectivity cybersource (my payment gateway).
i establish gateway code (after config.after_initialize do):
activemerchant::billing::base.mode = :production # :test activemerchant::billing::creditcard.require_verification_value = false activemerchant::billing::cybersourcegateway.wiredump_device = file.new(file.join([rails.root, "log", "cybersource.log"]), "a") # doesn't work (!) # need open external file password mypassphrase = file.open('/var/www/foo/shared/passphrase.txt').read ordertransaction.gateway = activemerchant::billing::cybersourcegateway.new(:login => 'vxxxxxxx', :password => mypassphrase.to_s, :test => false, :vat_reg_number => 'your vat registration number', # sets states/provinces have physical presense tax purposes :nexus => "ga oh", # don‘t want use avs continue processing if avs have failed :ignore_avs => true, # don‘t want use cvv continue processing if cvv have failed :ignore_cvv => true, :money_format => :dollars )
can see soap request? there ways test part of this? appreciated.
best,
tim
so, late response but...
i've done amount of work cybersource gateway, , way see soap request/response of cybersource gateway open gem , edit it.
if modify commit method of lib/active_merchant/billing/gateways/cybersource.rb, can this:
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
it nice if there way response without going through hassle, i'll see if there's way pass information through response object that's returned , add fork.
Comments
Post a Comment