Class: PaymentsApi::PaymentDetails
- Defined in:
- lib/payments_api/models/payment_details.rb
Overview
Payment Information Data
Instance Attribute Summary collapse
-
#memo ⇒ String
Memo from Originator to Beneficiary.
-
#payment_reference ⇒ String
Payment Reference Information.
-
#purpose_of_payment ⇒ String
Purpose of payment.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(purpose_of_payment = nil, memo = nil, payment_reference = nil) ⇒ PaymentDetails
constructor
A new instance of PaymentDetails.
Methods inherited from BaseModel
Constructor Details
#initialize(purpose_of_payment = nil, memo = nil, payment_reference = nil) ⇒ PaymentDetails
Returns a new instance of PaymentDetails.
30 31 32 33 34 35 36 |
# File 'lib/payments_api/models/payment_details.rb', line 30 def initialize(purpose_of_payment = nil, memo = nil, payment_reference = nil) @purpose_of_payment = purpose_of_payment @memo = memo @payment_reference = payment_reference end |
Instance Attribute Details
#memo ⇒ String
Memo from Originator to Beneficiary
15 16 17 |
# File 'lib/payments_api/models/payment_details.rb', line 15 def memo @memo end |
#payment_reference ⇒ String
Payment Reference Information. Typically includes FI to FI notes
19 20 21 |
# File 'lib/payments_api/models/payment_details.rb', line 19 def payment_reference @payment_reference end |
#purpose_of_payment ⇒ String
Purpose of payment
11 12 13 |
# File 'lib/payments_api/models/payment_details.rb', line 11 def purpose_of_payment @purpose_of_payment end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/payments_api/models/payment_details.rb', line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. purpose_of_payment = hash['purposeOfPayment'] memo = hash['memo'] payment_reference = hash['paymentReference'] # Create object from extracted values. PaymentDetails.new(purpose_of_payment, memo, payment_reference) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 28 |
# File 'lib/payments_api/models/payment_details.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['purpose_of_payment'] = 'purposeOfPayment' @_hash['memo'] = 'memo' @_hash['payment_reference'] = 'paymentReference' @_hash end |