Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/mindee/v1/parsing/standard/payment_details_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@ module Parsing
module Standard
# Represents payment details for invoices and receipts
class PaymentDetailsField < BaseField
# The account number.
# @return [String, nil]
attr_reader :account_number
# The full IBAN.
# @return [String, nil]
attr_reader :iban
# The routing number.
# @return [String, nil]
attr_reader :routing_number
# The SWIFT value.
# @return [String, nil]
attr_reader :swift
# The UK and Irish sort code (6 digits).
# @return [String, nil]
attr_reader :sort_code

# @param prediction [Hash]
# @param page_id [Integer, nil]
Expand All @@ -26,6 +33,7 @@ def initialize(prediction, page_id, reconstructed: false)
@iban = prediction['iban']
@routing_number = prediction['routing_number']
@swift = prediction['swift']
@sort_code = prediction['sort_code']
Comment thread
ianardee marked this conversation as resolved.
Resolved
end

# @return [String]
Expand All @@ -35,6 +43,7 @@ def to_s
out_str << "#{@iban}; " if @iban
out_str << "#{@routing_number}; " if @routing_number
out_str << "#{@swift}; " if @swift
out_str << "#{@sort_code}; " if @sort_code
out_str.strip
end
end
Expand Down
1 change: 1 addition & 0 deletions sig/mindee/v1/parsing/standard/payment_details_field.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Mindee
attr_reader iban: String?
attr_reader routing_number: String?
attr_reader swift: String?
attr_reader sort_code: String?

def initialize: (Hash[String | Symbol, untyped], Integer?, ?reconstructed: bool) -> void

Expand Down
Loading