lib/active_merchant/billing/gateways/sage_pay.rb in activemerchant-1.75.0 vs lib/active_merchant/billing/gateways/sage_pay.rb in activemerchant-1.76.0

- old
+ new

@@ -35,17 +35,24 @@ :electron => "UKE", :diners_club => "DC", :jcb => "JCB" } - AVS_CVV_CODE = { + AVS_CODE = { "NOTPROVIDED" => nil, "NOTCHECKED" => 'X', "MATCHED" => 'Y', "NOTMATCHED" => 'N' } + CVV_CODE = { + "NOTPROVIDED" => 'S', + "NOTCHECKED" => 'X', + "MATCHED" => 'M', + "NOTMATCHED" => 'N' + } + OPTIONAL_REQUEST_FIELDS = { paypal_callback_url: :PayPalCallbackURL, basket: :Basket, gift_aid_payment: :GiftAidPayment , apply_avscv2: :ApplyAVSCV2 , @@ -346,13 +353,13 @@ Response.new(response["Status"] == APPROVED, message_from(response), response, :test => test?, :authorization => authorization_from(response, parameters, action), :avs_result => { - :street_match => AVS_CVV_CODE[ response["AddressResult"] ], - :postal_match => AVS_CVV_CODE[ response["PostCodeResult"] ], + :street_match => AVS_CODE[ response["AddressResult"] ], + :postal_match => AVS_CODE[ response["PostCodeResult"] ], }, - :cvv_result => AVS_CVV_CODE[ response["CV2Result"] ] + :cvv_result => CVV_CODE[ response["CV2Result"] ] ) end def authorization_from(response, params, action) case action