Class: ActiveMerchant::Billing::EpsilonConvenienceStoreGateway

Inherits:
EpsilonBaseGateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/epsilon_convenience_store.rb

Constant Summary collapse

RESPONSE_KEYS =
DEFAULT_RESPONSE_KEYS + [
  :convenience_store_limit_date,
  :convenience_store_payment_slip_url,
  :company_code,
]

Constants inherited from EpsilonBaseGateway

ActiveMerchant::Billing::EpsilonBaseGateway::DEFAULT_RESPONSE_KEYS

Instance Method Summary collapse

Instance Method Details

#purchase(amount, payment_method, detail = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/active_merchant/billing/gateways/epsilon_convenience_store.rb', line 11

def purchase(amount, payment_method, detail = {})
  params = {
    contract_code:  self.contract_code,
    user_id:        detail[:user_id],
    user_name:      detail[:user_name],
    user_mail_add:  detail[:user_email],
    item_code:      detail[:item_code],
    item_name:      detail[:item_name],
    order_number:   detail[:order_number],
    st_code:        '00100-0000-0000',
    mission_code:   EpsilonMissionCode::PURCHASE,
    item_price:     amount,
    process_code:   1,
    xml:            1,
    conveni_code:   payment_method.code,
    user_tel:       payment_method.phone_number,
    user_name_kana: payment_method.name,
  }

  params[:memo1] = detail[:memo1] if detail.has_key?(:memo1)
  params[:memo2] = detail[:memo2] if detail.has_key?(:memo2)

  commit('receive_order3.cgi', params, RESPONSE_KEYS)
end