README in exact4r-0.9.1 vs README in exact4r-0.9.2

- old
+ new

@@ -114,14 +114,82 @@ :password => "YYYYYY" }) rf_resp = transporter.submit(rf_req) raise "Refund failed: #{rf_resp.exact_resp_code}, #{rf_resp.exact_message}" unless rf_resp.approved? end + +=4. Using the AVS API + +Allowable AVS params are: + +- :avs_street_address => "7501ELMST." +- :avs_unit_no => "801" +- :avs_po_box => nil # P.O. Box or street address may be specified, but not both +- :avs_postal_code => "90210" +- :avs_test_flag => "X" # AVS test flag (optional) + + +===Test Flags +In order to simulate an AVS response in the test environment, set the :+avs_test_flag+ to the AVS result code you would like +returned. The AVS result is a one-character response that indicates the degree of match for the provided address. +The following AVS responses are currently supported: + +===North American Response Codes + AVS Code - ABS Definition - Explanation +- X - Exact match, 9 digit zip - Street Address, and 9 digit ZIP Code match +- Y - Exact match, 5 digit zip - Street Address, and 5 digit ZIP Code match +- A - Partial match - Street Address matches, ZIP Code does not +- W - Partial match - ZIP Code matches, Street Address does not +- Z - Partial match - 5 digit ZIP Code match only +- N - No match - No Address or ZIP Code match +- U - Unavailable - Address information is unavailable for that account number, or the card issuer does not support +- G - Service Not supported, non-US Issuer does not participate +- R - Retry - Issuer system unavailable, retry later +- E - Not a mail or phone order +- S - Service not supported + +===International Response Codes + AVS Code - ABS Definition and Explanation +- G - Global non-AVS participant +- B - Address matches only +- C - Address and Postal Code do not match +- D - Address and Postal Code match +- F - Address and Postal Code match (UK only) +- I - Address information not verified for international transaction +- M - Address and Postal Code match +- P - Postal Code matches only + +===Code Sample + avs_params = { + :avs_test_flag => 'N', + :avs_street_address => '123BROWNSTREET', + :avs_unit_no => '4, + :avs_po_box => nil, + :avs_postal_code => '902101234' + } + + tx_params = { + :transaction_type => :purchase, + :amount => 10.50, + :cardholder_name => "Simon Brown", + :cc_number => "4111111111111111", + :cc_expiry => "1012", + :gateway_id => "XXXXXXX", + :password => "YYYYYY" + }.merge(avs_params) + + request = EWS::Transaction::Request.new(tx_params) -== Rake tasks + transporter = EWS::Transporter.new("https://api.e-xact.com/") + response = transporter.submit(request) + + response.cc_verification_str1.should == "N123BROWNSTREET4902101234" + response.avs.should == N + += Rake tasks -spec - Run all test in spec/ folder (default) +test + Run all tests (default) rdoc Generate rdoc html in doc/ gem