Class: DPay::TransactionRefund

Inherits:
Object
  • Object
show all
Defined in:
lib/dpay/payment/transaction_refund.rb,
sig/dpay/payment/transaction_refund.rbs

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ TransactionRefund

Returns a new instance of TransactionRefund.

Parameters:

  • data (Hash[String, untyped])


11
12
13
14
15
16
17
18
19
# File 'lib/dpay/payment/transaction_refund.rb', line 11

def initialize(data)
  @raw = data
  @payment_id = Internal::Coerce.string(data["payment_id"]) || ""
  @value = Internal::Coerce.money(data["value"])
  @status = Internal::Coerce.string(data["status"]) || TransactionStatus::PAID
  @creation_date = Internal::Coerce.string(data["creation_date"])
  @payment_date = Internal::Coerce.string(data["payment_date"])
  freeze
end

Instance Attribute Details

#creation_dateString? (readonly)

Returns the value of attribute creation_date.

Returns:

  • (String, nil)


5
6
7
# File 'lib/dpay/payment/transaction_refund.rb', line 5

def creation_date
  @creation_date
end

#payment_dateString? (readonly)

Returns the value of attribute payment_date.

Returns:

  • (String, nil)


5
6
7
# File 'lib/dpay/payment/transaction_refund.rb', line 5

def payment_date
  @payment_date
end

#payment_idString (readonly)

Returns the value of attribute payment_id.

Returns:

  • (String)


5
6
7
# File 'lib/dpay/payment/transaction_refund.rb', line 5

def payment_id
  @payment_id
end

#rawHash[String, untyped] (readonly)

Returns the value of attribute raw.

Returns:

  • (Hash[String, untyped])


5
6
7
# File 'lib/dpay/payment/transaction_refund.rb', line 5

def raw
  @raw
end

#statusString (readonly)

Returns the value of attribute status.

Returns:

  • (String)


5
6
7
# File 'lib/dpay/payment/transaction_refund.rb', line 5

def status
  @status
end

#valueMoney (readonly)

Returns the value of attribute value.

Returns:



5
6
7
# File 'lib/dpay/payment/transaction_refund.rb', line 5

def value
  @value
end

Class Method Details

.from_api(data) ⇒ TransactionRefund

Parameters:

  • data (Hash[String, untyped])

Returns:



7
8
9
# File 'lib/dpay/payment/transaction_refund.rb', line 7

def self.from_api(data)
  new(data)
end