Method: Faker::Invoice.creditor_reference

Defined in:
lib/faker/default/invoice.rb

.creditor_reference(ref: '') ⇒ String

Produces a random valid reference according to the International bank slip reference en.wikipedia.org/wiki/Creditor_Reference

Examples:

Faker::Invoice.creditor_reference #=> "RF34118592570724925498"

Parameters:

  • (defaults to: '')

    Specifies reference base.

Returns:



34
35
36
37
38
# File 'lib/faker/default/invoice.rb', line 34

def creditor_reference(ref: '')
  ref = reference if ref.empty?

  "RF#{iban_checksum('RF', ref)}#{ref}"
end