class StarkBank::Invoice::Payment

# Payment object

When an Invoice is paid, its InvoicePayment sub-resource will become available. It carries all the available information about the invoice payment.

## Attributes (return-only):

Attributes

account_number[R]
account_type[R]
amount[R]
bank_code[R]
branch_code[R]
end_to_end_id[R]
method[R]
name[R]
tax_id[R]

Public Class Methods

new(name:, tax_id:, bank_code:, branch_code:, account_number:, account_type:, amount:, end_to_end_id:, method:) click to toggle source
# File lib/invoice/payment.rb, line 25
def initialize(name:, tax_id:, bank_code:, branch_code:, account_number:, account_type:, amount:, end_to_end_id:, method:)
    @name = name
    @tax_id = tax_id
    @bank_code = bank_code
    @branch_code = branch_code
    @account_number = account_number
    @account_type = account_type
    @amount = amount
    @end_to_end_id = end_to_end_id
    @method = method
end
resource() click to toggle source
# File lib/invoice/payment.rb, line 37
def self.resource
    {
        sub_resource_name: 'Payment',
        sub_resource_maker: proc { |json|
            Payment.new(
                name: json['name'],
                tax_id: json['tax_id'],
                bank_code: json['bank_code'],
                branch_code: json['branch_code'],
                account_number: json['account_number'],
                account_type: json['account_type'],
                amount: json['amount'],
                end_to_end_id: json['end_to_end_id'],
                method: json['method']
            )
        }
    }
end