Class: Nfe::TaxCoupon::Payment
- Inherits:
-
Data
- Object
- Data
- Nfe::TaxCoupon::Payment
- Defined in:
- lib/nfe/resources/dto/consumer_invoice_query/tax_coupon.rb,
sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs
Overview
Payment group for the coupon (+pgto+). pay_back is the change/troco
(vTroco); payment_details holds one entry per payment method.
Instance Attribute Summary collapse
-
#pay_back ⇒ Object
readonly
Returns the value of attribute pay_back.
-
#payment_details ⇒ Array[Nfe::TaxCoupon::PaymentDetail?]
readonly
Returns the value of attribute payment_details.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Payment
constructor
A new instance of Payment.
Constructor Details
#initialize ⇒ Payment
Returns a new instance of Payment.
92 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 92
def initialize: (pay_back: untyped, payment_details: Array[Nfe::TaxCoupon::PaymentDetail?]) -> void
|
Instance Attribute Details
#pay_back ⇒ Object (readonly)
Returns the value of attribute pay_back.
87 88 89 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 87 def pay_back @pay_back end |
#payment_details ⇒ Array[Nfe::TaxCoupon::PaymentDetail?] (readonly)
Returns the value of attribute payment_details.
88 89 90 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 88 def payment_details @payment_details end |
Class Method Details
.from_api(payload) ⇒ Nfe::TaxCoupon::Payment?
150 151 152 153 154 155 156 157 |
# File 'lib/nfe/resources/dto/consumer_invoice_query/tax_coupon.rb', line 150 def self.from_api(payload) return nil if payload.nil? new( pay_back: payload["payBack"], payment_details: (payload["paymentDetails"] || []).map { |d| PaymentDetail.from_api(d) } ) end |
.new ⇒ instance
91 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 91
def self.new: (pay_back: untyped, payment_details: Array[Nfe::TaxCoupon::PaymentDetail?]) -> instance
|