Class: Payhub::Payment

Inherits:
Struct
  • Object
show all
Defined in:
lib/payhub/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#amount_minorObject

Returns the value of attribute amount_minor

Returns:

  • (Object)

    the current value of amount_minor



6
7
8
# File 'lib/payhub/types.rb', line 6

def amount_minor
  @amount_minor
end

#currencyObject

Returns the value of attribute currency

Returns:

  • (Object)

    the current value of currency



6
7
8
# File 'lib/payhub/types.rb', line 6

def currency
  @currency
end

#hosted_checkout_urlObject

Returns the value of attribute hosted_checkout_url

Returns:

  • (Object)

    the current value of hosted_checkout_url



6
7
8
# File 'lib/payhub/types.rb', line 6

def hosted_checkout_url
  @hosted_checkout_url
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



6
7
8
# File 'lib/payhub/types.rb', line 6

def id
  @id
end

#merchant_order_refObject

Returns the value of attribute merchant_order_ref

Returns:

  • (Object)

    the current value of merchant_order_ref



6
7
8
# File 'lib/payhub/types.rb', line 6

def merchant_order_ref
  @merchant_order_ref
end

#next_actionObject

Returns the value of attribute next_action

Returns:

  • (Object)

    the current value of next_action



6
7
8
# File 'lib/payhub/types.rb', line 6

def next_action
  @next_action
end

#pspObject

Returns the value of attribute psp

Returns:

  • (Object)

    the current value of psp



6
7
8
# File 'lib/payhub/types.rb', line 6

def psp
  @psp
end

#psp_refObject

Returns the value of attribute psp_ref

Returns:

  • (Object)

    the current value of psp_ref



6
7
8
# File 'lib/payhub/types.rb', line 6

def psp_ref
  @psp_ref
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



6
7
8
# File 'lib/payhub/types.rb', line 6

def status
  @status
end

Class Method Details

.from_raw(raw) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/payhub/types.rb', line 11

def self.from_raw(raw)
  new(
    id: raw["id"].to_s,
    status: raw["status"].to_s,
    psp: raw["psp"].to_s,
    psp_ref: raw["psp_ref"],
    next_action: Payhub::NextAction.decode(raw["next_action"]),
    amount_minor: raw["amount_minor"].to_i,
    currency: raw["currency"].to_s,
    merchant_order_ref: raw["merchant_order_ref"].to_s,
    hosted_checkout_url: raw["hosted_checkout_url"]
  )
end