Module: SolidusNexio::Mappings

Extended by:
Mappings
Included in:
Mappings
Defined in:
app/services/solidus_nexio/mappings.rb

Constant Summary collapse

TRANSACTION_STATUS_TO_STATE =
{
  3 => 'pending',
  9 => 'completed',
  10 => 'completed',
  11 => 'pending',
  20 => 'completed',
  30 => 'failed',
  32 => 'failed',
  39 => 'void',
  40 => 'void'
}.freeze

Instance Method Summary collapse

Instance Method Details

#payment_state(status) ⇒ Object



19
20
21
# File 'app/services/solidus_nexio/mappings.rb', line 19

def payment_state(status)
  TRANSACTION_STATUS_TO_STATE.fetch(status, 'invalid')
end

#settled?(status) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/services/solidus_nexio/mappings.rb', line 23

def settled?(status)
  status == 20
end