lib/active_merchant/billing/gateways/efsnet.rb in yetanothernguyen-activemerchant-1.16.0 vs lib/active_merchant/billing/gateways/efsnet.rb in yetanothernguyen-activemerchant-1.21.0

- old
+ new

@@ -58,11 +58,11 @@ end def void(identification, options = {}) requires!(options, :order_id) original_transaction_id, original_transaction_amount = identification.split(";") - commit(:void_transaction, {:reference_number => format_reference_number(options[:order_id]), :transaction_ID => original_transaction_id}) + commit(:void_transaction, {:reference_number => format_reference_number(options[:order_id]), :transaction_id => original_transaction_id}) end def voice_authorize(money, authorization_code, creditcard, options = {}) options[:authorization_number] = authorization_code request = build_credit_card_request(money, creditcard, options) @@ -88,11 +88,11 @@ post = { :reference_number => format_reference_number(options[:order_id]), :transaction_amount => amount(money), :original_transaction_amount => original_transaction_amount, - :original_transaction_ID => original_transaction_id, + :original_transaction_id => original_transaction_id, :client_ip_address => options[:ip] } end def build_credit_card_request(money, creditcard, options = {}) @@ -189,11 +189,11 @@ root.attributes["StoreKey"] = options[:password] root.attributes["ApplicationID"] = 'ot 1.0' transaction = root.add_element(action.to_s.camelize) actions[action].each do |key| - transaction.add_element(key.to_s.camelize).text = parameters[key] unless parameters[key].blank? + transaction.add_element(key).text = parameters[key.underscore.to_sym] unless parameters[key.underscore.to_sym].blank? end xml.to_s end @@ -215,21 +215,21 @@ def actions ACTIONS end - CREDIT_CARD_FIELDS = [:authorization_number, :client_ip_address, :billing_address, :billing_city, :billing_state, :billing_postal_code, :billing_country, :billing_name, :card_verification_value, :expiration_month, :expiration_year, :reference_number, :transaction_amount, :account_number ] + CREDIT_CARD_FIELDS = %w(AuthorizationNumber ClientIpAddress BillingAddress BillingCity BillingState BillingPostalCode BillingCountry BillingName CardVerificationValue ExpirationMonth ExpirationYear ReferenceNumber TransactionAmount AccountNumber ) ACTIONS = { :credit_card_authorize => CREDIT_CARD_FIELDS, :credit_card_charge => CREDIT_CARD_FIELDS, :credit_card_voice_authorize => CREDIT_CARD_FIELDS, :credit_card_capture => CREDIT_CARD_FIELDS, - :credit_card_credit => CREDIT_CARD_FIELDS << :original_transaction_amount, - :credit_card_refund => [:reference_number, :transaction_amount, :original_transaction_amount, :original_transaction_ID, :client_ip_address], - :void_transaction => [:reference_number, :transaction_ID], - :credit_card_settle => [:reference_number, :transaction_amount, :original_transaction_amount, :original_transaction_ID, :client_ip_address], - :system_check => [:system_check], + :credit_card_credit => CREDIT_CARD_FIELDS + ["OriginalTransactionAmount"], + :credit_card_refund => %w(ReferenceNumber TransactionAmount OriginalTransactionAmount OriginalTransactionID ClientIpAddress), + :void_transaction => %w(ReferenceNumber TransactionID), + :credit_card_settle => %w(ReferenceNumber TransactionAmount OriginalTransactionAmount OriginalTransactionID ClientIpAddress), + :system_check => %w(SystemCheck), } end end end