Module: SolidusNexio::NexioData

Extended by:
NexioData
Included in:
NexioData
Defined in:
app/services/solidus_nexio/nexio_data.rb

Instance Method Summary collapse

Instance Method Details

#one_time_token(order:, user:, options: {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/services/solidus_nexio/nexio_data.rb', line 7

def one_time_token(order:, user:, options: {})
  acc = build_config.merge(options)

  if order
    add_order_data(acc, order)
    add_customer_data(acc, order.user || user)
  else
    add_customer_data(acc, user)
  end

  acc.delete(:customer) if acc[:customer].blank?

  acc
end

#purchase(order) ⇒ Object



22
23
24
25
26
27
28
# File 'app/services/solidus_nexio/nexio_data.rb', line 22

def purchase(order)
  acc = build_config
  add_order_data(acc, order)
  add_order_cart(acc, order)
  add_customer_data(acc, order)
  acc
end