lib/active_merchant/billing/gateways/epsilon.rb in active_merchant-epsilon-0.9.4 vs lib/active_merchant/billing/gateways/epsilon.rb in active_merchant-epsilon-0.10.0

- old
+ new

@@ -17,10 +17,11 @@ terminate_recurring: 'receive_order3.cgi', void: 'cancel_payment.cgi', find_user: 'get_user_info.cgi', change_recurring_amount: 'change_amount_payment.cgi', find_order: 'getsales2.cgi', + capture: 'sales_payment.cgi', }.freeze self.supported_cardtypes = [:visa, :master, :american_express, :discover] def purchase(amount, credit_card, detail = {}) @@ -49,10 +50,11 @@ xml: 1, } params[:memo1] = detail[:memo1] if detail.has_key?(:memo1) params[:memo2] = detail[:memo2] if detail.has_key?(:memo2) + params[:kari_flag] = detail[:capture] ? 2 : 1 if detail.has_key?(:capture) commit(PATHS[:registered_purchase], params) end def recurring(amount, credit_card, detail = {}) @@ -81,10 +83,11 @@ xml: 1, } params[:memo1] = detail[:memo1] if detail.has_key?(:memo1) params[:memo2] = detail[:memo2] if detail.has_key?(:memo2) + params[:kari_flag] = detail[:capture] ? 2 : 1 if detail.has_key?(:capture) commit(PATHS[:registered_recurring], params) end def cancel_recurring(user_id:, item_code:) @@ -180,10 +183,19 @@ ] commit(PATHS[:find_order], params, response_keys) end + def capture(order_number) + params = { + contract_code: self.contract_code, + order_number: order_number, + } + + commit(PATHS[:capture], params) + end + private def billing_params(amount, payment_method, detail) params = { contract_code: self.contract_code, @@ -206,9 +218,10 @@ user_agent: "#{ActiveMerchant::Epsilon}-#{ActiveMerchant::Epsilon::VERSION}", } params[:memo1] = detail[:memo1] if detail.has_key?(:memo1) params[:memo2] = detail[:memo2] if detail.has_key?(:memo2) + params[:kari_flag] = detail[:capture] ? 2 : 1 if detail.has_key?(:capture) if detail.has_key?(:token) params[:token] = detail[:token] params.delete(:card_number) params.delete(:expire_y)