genesis_ruby 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +78 -0
  3. data/Gemfile.lock +14 -14
  4. data/README.md +78 -0
  5. data/VERSION +1 -1
  6. data/lib/genesis_ruby/api/constants/currencies/iso4217.rb +6 -0
  7. data/lib/genesis_ruby/api/constants/non_financial/kyc/document_types.rb +49 -0
  8. data/lib/genesis_ruby/api/constants/non_financial/kyc/genders.rb +22 -0
  9. data/lib/genesis_ruby/api/constants/transactions/parameters/african_mobile_operators.rb +37 -0
  10. data/lib/genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_owner.rb +24 -0
  11. data/lib/genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_subtype.rb +24 -0
  12. data/lib/genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_type.rb +63 -0
  13. data/lib/genesis_ruby/api/constants/transactions/parameters/digital_asset_types.rb +31 -0
  14. data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/externally_processed.rb +22 -0
  15. data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/processing_type.rb +22 -0
  16. data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/sca_exemptions.rb +25 -0
  17. data/lib/genesis_ruby/api/constants/transactions/parameters/online_banking/iframe_targets.rb +26 -0
  18. data/lib/genesis_ruby/api/constants/transactions/parameters/purpose_of_payment.rb +136 -0
  19. data/lib/genesis_ruby/api/constants/transactions/parameters/source_of_funds.rb +34 -0
  20. data/lib/genesis_ruby/api/mixins/requests/digital_asset_type_attributes.rb +26 -0
  21. data/lib/genesis_ruby/api/mixins/requests/financial/african_mobile_attributes.rb +30 -0
  22. data/lib/genesis_ruby/api/mixins/requests/financial/beneficiary_attributes.rb +38 -0
  23. data/lib/genesis_ruby/api/mixins/requests/financial/cards/tokenization_params_attributes.rb +36 -0
  24. data/lib/genesis_ruby/api/mixins/requests/financial/customer_account_attributes.rb +21 -0
  25. data/lib/genesis_ruby/api/mixins/requests/financial/customer_identification_attributes.rb +82 -0
  26. data/lib/genesis_ruby/api/mixins/requests/financial/gift_cards_attributes.rb +26 -0
  27. data/lib/genesis_ruby/api/mixins/requests/financial/online_banking_payments/payer_attributes.rb +65 -0
  28. data/lib/genesis_ruby/api/mixins/requests/financial/preauthorization_attributes.rb +25 -0
  29. data/lib/genesis_ruby/api/mixins/requests/financial/purpose_of_payment_attributes.rb +29 -0
  30. data/lib/genesis_ruby/api/mixins/requests/financial/source_of_funds_attributes.rb +38 -0
  31. data/lib/genesis_ruby/api/mixins/requests/financial/travel_data/airline_itinerary_attributes.rb +1 -1
  32. data/lib/genesis_ruby/api/mixins/requests/non_financial/fx/id_attributes.rb +28 -0
  33. data/lib/genesis_ruby/api/mixins/requests/non_financial/fx/tier_id_attributes.rb +28 -0
  34. data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/customer_information_attributes.rb +62 -0
  35. data/lib/genesis_ruby/api/mixins/requests/non_financial/mode_attributes.rb +24 -0
  36. data/lib/genesis_ruby/api/mixins/requests/non_financial/tokenization/card_data_attributes.rb +62 -0
  37. data/lib/genesis_ruby/api/mixins/requests/non_financial/tokenization/token_attributes.rb +23 -0
  38. data/lib/genesis_ruby/api/mixins/requests/non_financial/tokenization/tokenization_attributes.rb +51 -0
  39. data/lib/genesis_ruby/api/request.rb +7 -0
  40. data/lib/genesis_ruby/api/requests/base/consumer.rb +24 -0
  41. data/lib/genesis_ruby/api/requests/base/financial.rb +10 -1
  42. data/lib/genesis_ruby/api/requests/base/financials/credit_card.rb +9 -9
  43. data/lib/genesis_ruby/api/requests/base/financials/south_american_payments.rb +11 -14
  44. data/lib/genesis_ruby/api/requests/base/non_financial/kyc/base.rb +33 -0
  45. data/lib/genesis_ruby/api/requests/base/reference.rb +3 -3
  46. data/lib/genesis_ruby/api/requests/financial/Preauthorizations/incremental_authorize.rb +24 -0
  47. data/lib/genesis_ruby/api/requests/financial/cards/authorize.rb +5 -1
  48. data/lib/genesis_ruby/api/requests/financial/cards/authorize3d.rb +5 -1
  49. data/lib/genesis_ruby/api/requests/financial/cards/bancontact.rb +8 -9
  50. data/lib/genesis_ruby/api/requests/financial/cards/credit.rb +39 -0
  51. data/lib/genesis_ruby/api/requests/financial/cards/payout.rb +72 -0
  52. data/lib/genesis_ruby/api/requests/financial/cards/sale.rb +3 -1
  53. data/lib/genesis_ruby/api/requests/financial/cards/sale3d.rb +3 -1
  54. data/lib/genesis_ruby/api/requests/financial/cash_payments/cash.rb +13 -14
  55. data/lib/genesis_ruby/api/requests/financial/cash_payments/pix.rb +23 -25
  56. data/lib/genesis_ruby/api/requests/financial/crypto/bit_pay/payout.rb +52 -0
  57. data/lib/genesis_ruby/api/requests/financial/crypto/bit_pay/refund.rb +36 -0
  58. data/lib/genesis_ruby/api/requests/financial/crypto/bit_pay/sale.rb +55 -0
  59. data/lib/genesis_ruby/api/requests/financial/gift_cards/fashioncheque.rb +47 -0
  60. data/lib/genesis_ruby/api/requests/financial/gift_cards/intersolve.rb +46 -0
  61. data/lib/genesis_ruby/api/requests/financial/gift_cards/tcs.rb +47 -0
  62. data/lib/genesis_ruby/api/requests/financial/mobile/african_mobile_sale.rb +81 -0
  63. data/lib/genesis_ruby/api/requests/financial/mobile/apple_pay.rb +18 -20
  64. data/lib/genesis_ruby/api/requests/financial/mobile/google_pay.rb +20 -24
  65. data/lib/genesis_ruby/api/requests/financial/mobile/russian_mobile_sale.rb +55 -0
  66. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/banco_do_brasil.rb +11 -14
  67. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/eps.rb +9 -10
  68. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/idebit/pay_in.rb +11 -18
  69. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/insta_debit/pay_in.rb +61 -0
  70. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/insta_debit/pay_out.rb +24 -0
  71. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/multibanco.rb +48 -0
  72. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/my_bank.rb +47 -0
  73. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/online_banking/pay_in.rb +17 -18
  74. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/online_banking/pay_out.rb +33 -38
  75. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/pay_u.rb +61 -0
  76. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/post_finance.rb +53 -0
  77. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/safety_pay.rb +57 -0
  78. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/sofort.rb +63 -0
  79. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/trustly_sale.rb +75 -0
  80. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/upi.rb +54 -0
  81. data/lib/genesis_ruby/api/requests/financial/online_banking_payments/wechat.rb +11 -14
  82. data/lib/genesis_ruby/api/requests/financial/sdd/sale.rb +13 -17
  83. data/lib/genesis_ruby/api/requests/financial/void.rb +12 -5
  84. data/lib/genesis_ruby/api/requests/financial/vouchers/neosurf.rb +61 -0
  85. data/lib/genesis_ruby/api/requests/financial/wallets/alipay.rb +10 -13
  86. data/lib/genesis_ruby/api/requests/financial/wallets/pay_pal.rb +18 -20
  87. data/lib/genesis_ruby/api/requests/non_financial/consumers/create.rb +44 -0
  88. data/lib/genesis_ruby/api/requests/non_financial/consumers/disable.rb +40 -0
  89. data/lib/genesis_ruby/api/requests/non_financial/consumers/enable.rb +40 -0
  90. data/lib/genesis_ruby/api/requests/non_financial/consumers/get_cards.rb +40 -0
  91. data/lib/genesis_ruby/api/requests/non_financial/consumers/retrieve.rb +40 -0
  92. data/lib/genesis_ruby/api/requests/non_financial/consumers/update.rb +45 -0
  93. data/lib/genesis_ruby/api/requests/non_financial/fraud/chargeback/date_range.rb +82 -0
  94. data/lib/genesis_ruby/api/requests/non_financial/fraud/chargeback/transaction.rb +52 -0
  95. data/lib/genesis_ruby/api/requests/non_financial/fraud/reports/date_range.rb +108 -0
  96. data/lib/genesis_ruby/api/requests/non_financial/fraud/reports/transaction.rb +52 -0
  97. data/lib/genesis_ruby/api/requests/non_financial/fraud/retrieval/date_range.rb +81 -0
  98. data/lib/genesis_ruby/api/requests/non_financial/fraud/retrieval/transaction.rb +52 -0
  99. data/lib/genesis_ruby/api/requests/non_financial/fx/get_rate.rb +55 -0
  100. data/lib/genesis_ruby/api/requests/non_financial/fx/get_rates.rb +53 -0
  101. data/lib/genesis_ruby/api/requests/non_financial/fx/get_tier.rb +53 -0
  102. data/lib/genesis_ruby/api/requests/non_financial/fx/get_tiers.rb +35 -0
  103. data/lib/genesis_ruby/api/requests/non_financial/fx/search_rate.rb +61 -0
  104. data/lib/genesis_ruby/api/requests/non_financial/kyc/consumer_registration/create.rb +99 -0
  105. data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/date_range.rb +68 -0
  106. data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/post_date_range.rb +72 -0
  107. data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/transaction.rb +48 -0
  108. data/lib/genesis_ruby/api/requests/non_financial/sca/checker.rb +77 -0
  109. data/lib/genesis_ruby/api/requests/non_financial/tokenization/cryptogram.rb +46 -0
  110. data/lib/genesis_ruby/api/requests/non_financial/tokenization/delete_token.rb +43 -0
  111. data/lib/genesis_ruby/api/requests/non_financial/tokenization/detokenize.rb +43 -0
  112. data/lib/genesis_ruby/api/requests/non_financial/tokenization/get_card.rb +43 -0
  113. data/lib/genesis_ruby/api/requests/non_financial/tokenization/tokenize.rb +45 -0
  114. data/lib/genesis_ruby/api/requests/non_financial/tokenization/update_token.rb +45 -0
  115. data/lib/genesis_ruby/api/requests/non_financial/tokenization/validate_token.rb +43 -0
  116. data/lib/genesis_ruby/api/requests/wpf/create.rb +3 -1
  117. data/lib/genesis_ruby/configuration.rb +4 -0
  118. data/lib/genesis_ruby/dependencies.rb +2 -0
  119. data/lib/genesis_ruby/utils/country.rb +272 -0
  120. data/lib/genesis_ruby/utils/formatters/response/formats/timestamp.rb +1 -1
  121. data/lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb +1 -4
  122. data/lib/genesis_ruby/version.rb +1 -1
  123. metadata +87 -2
@@ -0,0 +1,136 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Constants
4
+ module Transactions
5
+ module Parameters
6
+ # Purpose of Payment
7
+ class PurposeOfPayment
8
+
9
+ extend Mixins::Constants::Common
10
+
11
+ # Interest
12
+ ISINTE = 'ISINTE'.freeze
13
+
14
+ # Income tax
15
+ ISINTX = 'ISINTX'.freeze
16
+
17
+ # Investment
18
+ ISINVS = 'ISINVS'.freeze
19
+
20
+ # Labor insurance
21
+ ISLBRI = 'ISLBRI'.freeze
22
+
23
+ # License fee
24
+ ISLICF = 'ISLICF'.freeze
25
+
26
+ # Life insurance
27
+ ISLIFI = 'ISLIFI'.freeze
28
+
29
+ # Loan
30
+ ISLOAN = 'ISLOAN'.freeze
31
+
32
+ # Medical services
33
+ ISMDCS = 'ISMDCS'.freeze
34
+
35
+ # Mobile P2B payment
36
+ ISMP2B = 'ISMP2B'.freeze
37
+
38
+ # Mobile P2P payment
39
+ ISMP2P = 'ISMP2P'.freeze
40
+
41
+ # Mobile top up
42
+ ISMTUP = 'ISMTUP'.freeze
43
+
44
+ # Not otherwise specified
45
+ ISNOWS = 'ISNOWS'.freeze
46
+
47
+ # Other
48
+ ISOTHR = 'ISOTHR'.freeze
49
+
50
+ # Transaction is related to a payment of other telecom related bill
51
+ ISOTLC = 'ISOTLC'.freeze
52
+
53
+ # Payroll
54
+ ISPAYR = 'ISPAYR'.freeze
55
+
56
+ # Contribution to pension fund
57
+ ISPEFC = 'ISPEFC'.freeze
58
+
59
+ # Pension payment
60
+ ISPENS = 'ISPENS'.freeze
61
+
62
+ # Payment of telephone bill
63
+ ISPHON = 'ISPHON'.freeze
64
+
65
+ # Property insurance
66
+ ISPPTI = 'ISPPTI'.freeze
67
+
68
+ # Transaction is for general rental/lease
69
+ ISRELG = 'ISRELG'.freeze
70
+
71
+ # The payment of rent
72
+ ISRENT = 'ISRENT'.freeze
73
+
74
+ # Payment for railway transport related business
75
+ ISRLWY = 'ISRLWY'.freeze
76
+
77
+ # Royalties
78
+ ISROYA = 'ISROYA'.freeze
79
+
80
+ # Salary payment
81
+ ISSALA = 'ISSALA'.freeze
82
+
83
+ # Payment to savings/retirement account
84
+ ISSAVG = 'ISSAVG'.freeze
85
+
86
+ # Securities
87
+ ISSECU = 'ISSECU'.freeze
88
+
89
+ # Social security benefit
90
+ ISSSBE = 'ISSSBE'.freeze
91
+
92
+ # Study
93
+ ISSTDY = 'ISSTDY'.freeze
94
+
95
+ # Subscription
96
+ ISSUBS = 'ISSUBS'.freeze
97
+
98
+ # Supplier payment
99
+ ISSUPP = 'ISSUPP'.freeze
100
+
101
+ # Refund of a tax payment or obligation
102
+ ISTAXR = 'ISTAXR'.freeze
103
+
104
+ # Tax payment
105
+ ISTAXS = 'ISTAXS'.freeze
106
+
107
+ # Transaction is related to a payment of telecommunications related bill
108
+ ISTBIL = 'ISTBIL'.freeze
109
+
110
+ # Trade services operation
111
+ ISTRAD = 'ISTRAD'.freeze
112
+
113
+ # Treasury payment
114
+ ISTREA = 'ISTREA'.freeze
115
+
116
+ # Payment for travel
117
+ ISTRPT = 'ISTRPT'.freeze
118
+
119
+ # Utility bill payment
120
+ ISUBIL = 'ISUBIL'.freeze
121
+
122
+ # Value added tax payment
123
+ ISVATX = 'ISVATX'.freeze
124
+
125
+ # With holding
126
+ ISWHLD = 'ISWHLD'.freeze
127
+
128
+ # Payment of water bill
129
+ ISWTER = 'ISWTER'.freeze
130
+
131
+ end
132
+ end
133
+ end
134
+ end
135
+ end
136
+ end
@@ -0,0 +1,34 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Constants
4
+ module Transactions
5
+ module Parameters
6
+ # Source of Funds
7
+ class SourceOfFunds
8
+
9
+ extend Mixins::Constants::Common
10
+
11
+ # Source of Funds Credit
12
+ CREDIT = 'credit'.freeze
13
+
14
+ # Source of Funds Debit
15
+ DEBIT = 'debit'.freeze
16
+
17
+ # Source of Funds Prepaid
18
+ PREPAID = 'prepaid'.freeze
19
+
20
+ # Source of Funds Cash
21
+ CASH = 'cash'.freeze
22
+
23
+ # Source of Funds Other Debit Account
24
+ OTHER_DEBIT_ACCOUNT = 'other_debit_account'.freeze
25
+
26
+ # Source of funds Other Credit Account
27
+ OTHER_CREDIT_ACCOUNT = 'other_credit_account'.freeze
28
+
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,26 @@
1
+ require 'genesis_ruby/api/constants/transactions/parameters/digital_asset_types'
2
+
3
+ module GenesisRuby
4
+ module Api
5
+ module Mixins
6
+ module Requests
7
+ # Digital Asset Type Attributes mixin
8
+ module DigitalAssetTypeAttributes
9
+
10
+ attr_reader :digital_asset_type
11
+
12
+ # When performing crypto currency transaction with a VISA card there is an option
13
+ # to specify the digital asset type for detailed identification of the current crypto
14
+ # currency transaction
15
+ def digital_asset_type=(value)
16
+ allowed_options attribute: __method__,
17
+ allowed: GenesisRuby::Api::Constants::Transactions::Parameters::DigitalAssetTypes.all,
18
+ value: value,
19
+ allow_empty: true
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,30 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # African Mobile Attributes mixin
7
+ module AfricanMobileAttributes
8
+
9
+ attr_reader :target, :operator
10
+
11
+ # Number of the Paybill for which the transaction is intended
12
+ def target=(value)
13
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 20
14
+ end
15
+
16
+ # Name of the Mobile network operator which should process the transaction
17
+ def operator=(value)
18
+ allowed_options attribute: __method__,
19
+ allowed:
20
+ GenesisRuby::Api::Constants::Transactions::Parameters::AfricanMobileOperators.all,
21
+ value: value.to_s.upcase,
22
+ allow_empty: false
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,38 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # The beneficiary parameters attributes
7
+ module BeneficiaryAttributes
8
+
9
+ attr_accessor :beneficiary_name
10
+ attr_reader :beneficiary_document_id, :beneficiary_pix_key
11
+
12
+ # The Document ID of the beneficiary, such as CPF or CNPJ for Brazilian entities
13
+ def beneficiary_document_id=(value)
14
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 14
15
+ end
16
+
17
+ # The PIX key associated with the beneficiary
18
+ def beneficiary_pix_key=(value)
19
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 36
20
+ end
21
+
22
+ protected
23
+
24
+ # Beneficiary parameters structure
25
+ def beneficiary_parameters_structure
26
+ {
27
+ name: beneficiary_name,
28
+ document_id: beneficiary_document_id,
29
+ pix_key: beneficiary_pix_key
30
+ }
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,36 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module Cards
7
+ # Tokenization Params Attributes mixin
8
+ module TokenizationParamsAttributes
9
+
10
+ attr_accessor :tokenization_tavv
11
+ attr_reader :tokenization_eci
12
+
13
+ # Electronic Commerce Indicator (ECI) is a value that is returned from the Directory Server
14
+ # (Visa, MasterCard, etc.) to indicate the authentication results of your customer’s
15
+ # credit card payment on 3D Secure
16
+ def tokenization_eci=(value)
17
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 2
18
+ end
19
+
20
+ protected
21
+
22
+ # Tokenization Params Attributes Structure
23
+ def tokenization_params_attributes_structure
24
+ {
25
+ eci: tokenization_eci,
26
+ tavv: tokenization_tavv
27
+ }
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,21 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # Customer Account Attributes
7
+ module CustomerAccountAttributes
8
+
9
+ attr_reader :customer_account_id
10
+
11
+ # Customer account id parameter validation
12
+ def customer_account_id=(value)
13
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 20
14
+ end
15
+
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,82 @@
1
+ require 'genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_owner'
2
+ require 'genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_type'
3
+ require 'genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_subtype'
4
+ require 'genesis_ruby/utils/country'
5
+
6
+ module GenesisRuby
7
+ module Api
8
+ module Mixins
9
+ module Requests
10
+ module Financial
11
+ # Customer Identification Attributes
12
+ module CustomerIdentificationAttributes
13
+
14
+ attr_accessor :customer_identification_document_id
15
+
16
+ attr_reader :customer_identification_owner, :customer_identification_type,
17
+ :customer_identification_subtype, :customer_identification_issuing_country
18
+
19
+ # Customer Identification Owner
20
+ def customer_identification_owner=(value)
21
+ allowed_options(
22
+ attribute: __method__,
23
+ allowed:
24
+ GenesisRuby::Api::Constants::Transactions::Parameters::CustomerIdentification::CustomerIdentificationOwner.all, # rubocop:disable Layout/LineLength
25
+ value: value,
26
+ error_message: 'Invalid data for Customer Identification Document Owner',
27
+ allow_empty: true
28
+ )
29
+ end
30
+
31
+ # Customer Identification Type
32
+ def customer_identification_type=(value)
33
+ allowed_options(
34
+ attribute: __method__,
35
+ allowed:
36
+ GenesisRuby::Api::Constants::Transactions::Parameters::CustomerIdentification::CustomerIdentificationType.all, # rubocop:disable Layout/LineLength
37
+ value: value,
38
+ error_message: 'Invalid data for Customer Identification Document Type',
39
+ allow_empty: true
40
+ )
41
+ end
42
+
43
+ # Customer Identification Issuing Country
44
+ def customer_identification_issuing_country=(value)
45
+ allowed_options(
46
+ attribute: __method__,
47
+ allowed: GenesisRuby::Utils::Country::COUNTRIES.keys,
48
+ value: value,
49
+ error_message: 'Invalid country code for Document issuer country',
50
+ allow_empty: true
51
+ )
52
+ end
53
+
54
+ # Customer Identification Document Subtype
55
+ def customer_identification_subtype=(value)
56
+ allowed_options(
57
+ attribute: __method__,
58
+ allowed: GenesisRuby::Api::Constants::Transactions::Parameters::CustomerIdentification::CustomerIdentificationSubtype.all, # rubocop:disable Layout/LineLength
59
+ value: value,
60
+ error_message: 'Invalid value for Customer Identification Document Subtype',
61
+ allow_empty: true
62
+ )
63
+ end
64
+
65
+ protected
66
+
67
+ def customer_identification_attributes_structure
68
+ {
69
+ owner: customer_identification_owner,
70
+ type: customer_identification_type,
71
+ subtype: customer_identification_subtype,
72
+ document_id: customer_identification_document_id,
73
+ issuing_country: customer_identification_issuing_country
74
+ }
75
+ end
76
+
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,26 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # Gift Cards Attributes mixin
7
+ module GiftCardsAttributes
8
+
9
+ attr_reader :card_number, :cvv
10
+
11
+ # Gift card number
12
+ def card_number=(value)
13
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, min: 19, max: 21
14
+ end
15
+
16
+ # Verification code of the gift card
17
+ def cvv=(value)
18
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, min: 5, max: 8
19
+ end
20
+
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,65 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ module OnlineBankingPayments
7
+ # Payer attributes
8
+ module PayerAttributes
9
+
10
+ attr_reader :payer_document_id, :payer_bank_code, :payer_bank_account_number,
11
+ :payer_bank_branch, :payer_bank_account_verification_digit,
12
+ :payer_bank_phone_number
13
+
14
+ # Payer document ID
15
+ def payer_document_id=(value)
16
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 16
17
+ end
18
+
19
+ # The bank code used to process the transaction
20
+ def payer_bank_code=(value)
21
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 12
22
+ end
23
+
24
+ # The payer's bank account number
25
+ def payer_bank_account_number=(value)
26
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 33
27
+ end
28
+
29
+ # The name of the bank branch where the account is held
30
+ def payer_bank_branch=(value)
31
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 11
32
+ end
33
+
34
+ # Single digit verification code assigned by the external provider,
35
+ # used to validate the bank account
36
+ def payer_bank_account_verification_digit=(value)
37
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 1
38
+ end
39
+
40
+ # The payer's bank contact phone number
41
+ def payer_bank_phone_number=(value)
42
+ limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 11
43
+ end
44
+
45
+ protected
46
+
47
+ # Payer parameters structure
48
+ def payer_parameters_structure
49
+ {
50
+ document_id: payer_document_id,
51
+ bank_code: payer_bank_code,
52
+ bank_account_number: payer_bank_account_number,
53
+ bank_branch: payer_bank_branch,
54
+ bank_account_verification_digit: payer_bank_account_verification_digit,
55
+ bank_phone_number: payer_bank_phone_number
56
+ }
57
+ end
58
+
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,25 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module Financial
6
+ # Mixin Preauthorization Attributes
7
+ module PreauthorizationAttributes
8
+
9
+ attr_reader :preauthorization
10
+
11
+ # Preauthorization setter
12
+ def preauthorization=(value)
13
+ allowed_options attribute: __method__,
14
+ allowed: [true, false],
15
+ value: value,
16
+ allow_empty: true,
17
+ error_message: 'Accepts only boolean values'
18
+ end
19
+
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,29 @@
1
+ require 'genesis_ruby/api/constants/transactions/parameters/purpose_of_payment'
2
+
3
+ module GenesisRuby
4
+ module Api
5
+ module Mixins
6
+ module Requests
7
+ module Financial
8
+ # Purpose of Payment Attributes
9
+ module PurposeOfPaymentAttributes
10
+
11
+ attr_reader :purpose_of_payment
12
+
13
+ # Purpose of Payment setter
14
+ def purpose_of_payment=(value)
15
+ allowed_options(
16
+ attribute: __method__,
17
+ allowed: GenesisRuby::Api::Constants::Transactions::Parameters::PurposeOfPayment.all,
18
+ value: value,
19
+ error_message: 'Invalid data for Purpose of Payment',
20
+ allow_empty: true
21
+ )
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,38 @@
1
+ require 'genesis_ruby/api/constants/transactions/parameters/source_of_funds'
2
+
3
+ module GenesisRuby
4
+ module Api
5
+ module Mixins
6
+ module Requests
7
+ module Financial
8
+ # Source of Funds Attributes
9
+ module SourceOfFundsAttributes
10
+
11
+ attr_reader :source_of_funds
12
+
13
+ # Source of Funds setter
14
+ def source_of_funds=(value)
15
+ allowed_options(
16
+ attribute: __method__,
17
+ allowed: GenesisRuby::Api::Constants::Transactions::Parameters::SourceOfFunds.all,
18
+ value: value,
19
+ error_message: 'Invalid data for Source of Funds',
20
+ allow_empty: true
21
+ )
22
+ end
23
+
24
+ protected
25
+
26
+ # Source of Funds attributes structure
27
+ def source_of_funds_attributes_structure
28
+ {
29
+ source_of_funds: source_of_funds
30
+ }
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -135,7 +135,7 @@ module GenesisRuby
135
135
  end
136
136
 
137
137
  # Attributes Structure
138
- def airline_attributes_structure # rubocop:disable RSpec/MethodLength
138
+ def airline_attributes_structure # rubocop:disable Metrics/MethodLength
139
139
  {
140
140
  ticket_number: travel_aid_ticket_number,
141
141
  passenger_name: travel_aid_passenger_name,
@@ -0,0 +1,28 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module NonFinancial
6
+ module Fx
7
+ # ID Attributes mixin
8
+ module IdAttributes
9
+
10
+ attr_writer :id
11
+
12
+ # Tier ID
13
+ def id
14
+ @id.to_s
15
+ end
16
+
17
+ # Required fields
18
+ def id_required_fields
19
+ [:id]
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module GenesisRuby
2
+ module Api
3
+ module Mixins
4
+ module Requests
5
+ module NonFinancial
6
+ module Fx
7
+ # Tier ID Attributes mixin
8
+ module TierIdAttributes
9
+
10
+ attr_writer :tier_id
11
+
12
+ # Identification of the tier
13
+ def tier_id
14
+ @tier_id.to_s
15
+ end
16
+
17
+ # Required fields
18
+ def tier_id_required_fields
19
+ [:tier_id]
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end