Last active
August 29, 2015 14:03
-
-
Save theinventor/0a65586aa8966e21bf7b to your computer and use it in GitHub Desktop.
usaepay code spike
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> #<ActiveMerchant::Billing::Response:0x007fb45c9c7878 @params={"run_sale_return"=>{"acs_url"=>nil, "auth_amount"=>"0", "auth_code"=>"000000", "avs_result"=>"No AVS response (Typically no AVS data sent or swiped transaction)", "avs_result_code"=>nil, "batch_num"=>"1", "batch_ref_num"=>"108410", "card_code_result"=>"No CVV2/CVC data available for transaction.", "card_code_result_code"=>nil, "card_level_result"=>"Unknown Code ", "card_level_result_code"=>nil, "conversion_rate"=>"0", "converted_amount"=>"0", "converted_amount_currency"=>nil, "cust_num"=>"0", "error"=>"Invalid Card Number (1)", "error_code"=>"11", "is_duplicate"=>"false", "payload"=>nil, "ref_num"=>"60056770", "result"=>"Error", "result_code"=>"E", "status"=>"Pending", "status_code"=>"P", "vpas_result_code"=>nil}}, @message={"acs_url"=>nil, "auth_amount"=>"0", "auth_code"=>"000000", "avs_result"=>"No AVS response (Typically no AVS data sent or swiped transaction)", "avs_result_code"=>nil, "batch_num"=>"1", "batch_ref_num"=>"108410", "card_code_result"=>"No CVV2/CVC data available for transaction.", "card_code_result_code"=>nil, "card_level_result"=>"Unknown Code ", "card_level_result_code"=>nil, "conversion_rate"=>"0", "converted_amount"=>"0", "converted_amount_currency"=>nil, "cust_num"=>"0", "error"=>"Invalid Card Number (1)", "error_code"=>"11", "is_duplicate"=>"false", "payload"=>nil, "ref_num"=>"60056770", "result"=>"Error", "result_code"=>"E", "status"=>"Pending", "status_code"=>"P", "vpas_result_code"=>nil}, @success=false, @test=true, @authorization="60056770", @fraud_review=nil, @avs_result={"code"=>nil, "message"=>nil, "street_match"=>nil, "postal_match"=>nil}, @cvv_result={"code"=>nil, "message"=>nil}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def usa_epay_swipe_code_spike | |
@gateway = ActiveMerchant::Billing::UsaEpayGateway.new login: '_KEY', password: '1234', software_id: 'ABC123' | |
credit_card = nil | |
billing_address = { | |
:first_name => 'John', | |
:last_name => 'Smith', | |
:company => 'ABC COrp', | |
:address => '123 ANy', | |
:address1 => '123 line1', | |
:city => 'Kirkland', | |
:state => 'WA', | |
:zip => '98034', | |
:country => 'USA', | |
:phone_number => '4255555555' | |
} | |
credit_card_data_options = { | |
magnetic_stripe: "%B4000100011112224^DOE/JOHN^1803101000000000020000831000000?" | |
} | |
customer_info = {address: {}, billing_address: billing_address, credit_card_data_options: credit_card_data_options, email: 'troy@foo.com' } | |
response = @gateway.purchase(1000, credit_card, customer_info) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment