genesis_ruby 0.3.2 → 0.4.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/README.md +169 -1
- data/VERSION +1 -1
- data/lib/genesis_ruby/api/constants/non_financial/alternatives/alipay/merchant_types.rb +26 -0
- data/lib/genesis_ruby/api/constants/non_financial/alternatives/alipay/site_types.rb +26 -0
- data/lib/genesis_ruby/api/constants/non_financial/kyc/bank_account_types.rb +24 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/foreign_retailer_indicators.rb +24 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/funding/person_types.rb +26 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/purpose_of_payments.rb +46 -19
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/sender_account_number_types.rb +14 -17
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/source_of_funds.rb +9 -18
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/types.rb +31 -4
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/enhanced_statement_response_fields.rb +39 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/response_fields.rb +2 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/statement_order_by_fields.rb +31 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/statement_response_fields.rb +14 -13
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/{processing_type.rb → scopes.rb} +4 -3
- data/lib/genesis_ruby/api/constants/transactions/parameters/purpose_of_payment.rb +117 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/purpose_of_payment_values.rb +267 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/wallets/e_wallet/payment_types.rb +46 -0
- data/lib/genesis_ruby/api/constants/transactions.rb +9 -0
- data/lib/genesis_ruby/api/mixins/requests/customer_address/billing_info_attributes.rb +3 -1
- data/lib/genesis_ruby/api/mixins/requests/financial/cards/credential_on_file_transaction_link_attributes.rb +83 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/commercial_card_attributes.rb +143 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/funding_attributes.rb +32 -3
- data/lib/genesis_ruby/api/mixins/requests/financial/marketplace_data_attributes.rb +179 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/money_transfer_payout_attributes.rb +49 -46
- data/lib/genesis_ruby/api/mixins/requests/financial/order_attributes.rb +36 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/purpose_of_payment_attributes.rb +14 -4
- data/lib/genesis_ruby/api/mixins/requests/financial/refund/bank_attributes.rb +41 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/refund/beneficiary_attributes.rb +31 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/refund/travel_ticket_attributes.rb +52 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/force_threeds_attributes.rb +29 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/alternatives/alipay/site_information_attributes.rb +57 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/date_time_from_to_attributes.rb +102 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/background_checks_attributes.rb +31 -10
- data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/verification_document_attributes.rb +49 -7
- data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/verification_instructions_attributes.rb +90 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/reconcile_order_attributes.rb +30 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/scope_attributes.rb +29 -0
- data/lib/genesis_ruby/api/mixins/requests/restricted_setter.rb +12 -0
- data/lib/genesis_ruby/api/mixins/requests/scheme_tokenized_attributes.rb +35 -0
- data/lib/genesis_ruby/api/requests/base/financials/credit_card.rb +1 -12
- data/lib/genesis_ruby/api/requests/base/graphql.rb +7 -0
- data/lib/genesis_ruby/api/requests/base/non_financial/billing_api/abstract_statement.rb +226 -0
- data/lib/genesis_ruby/api/requests/base/non_financial/billing_api/base.rb +39 -37
- data/lib/genesis_ruby/api/requests/base/non_financial/reconcile/base.rb +45 -0
- data/lib/genesis_ruby/api/requests/financial/async_refund.rb +41 -0
- data/lib/genesis_ruby/api/requests/financial/cards/authorize.rb +43 -24
- data/lib/genesis_ruby/api/requests/financial/cards/authorize3d.rb +13 -1
- data/lib/genesis_ruby/api/requests/financial/cards/payout.rb +21 -5
- data/lib/genesis_ruby/api/requests/financial/cards/sale.rb +42 -23
- data/lib/genesis_ruby/api/requests/financial/cards/sale3d.rb +13 -1
- data/lib/genesis_ruby/api/requests/financial/mobile/apple_pay.rb +5 -1
- data/lib/genesis_ruby/api/requests/financial/mobile/google_pay.rb +6 -2
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/my_bank.rb +1 -1
- data/lib/genesis_ruby/api/requests/financial/refund.rb +20 -35
- data/lib/genesis_ruby/api/requests/financial/sdd/sale.rb +6 -1
- data/lib/genesis_ruby/api/requests/financial/wallets/e_wallet.rb +72 -0
- data/lib/genesis_ruby/api/requests/non_financial/alternatives/alipay/register_merchant.rb +147 -0
- data/lib/genesis_ruby/api/requests/non_financial/billing_api/enhanced_statement.rb +46 -0
- data/lib/genesis_ruby/api/requests/non_financial/billing_api/statement.rb +12 -137
- data/lib/genesis_ruby/api/requests/non_financial/billing_api/transactions.rb +4 -2
- data/lib/genesis_ruby/api/requests/non_financial/fraud/chargeback/date_range.rb +10 -19
- data/lib/genesis_ruby/api/requests/non_financial/fraud/rdr/date_range.rb +91 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/rdr/transaction.rb +54 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/retrieval/date_range.rb +10 -19
- data/lib/genesis_ruby/api/requests/non_financial/kyc/verifications/bank_account.rb +76 -0
- data/lib/genesis_ruby/api/requests/non_financial/kyc/verifications/create.rb +31 -4
- data/lib/genesis_ruby/api/requests/non_financial/payment_authorizations/date_range.rb +124 -0
- data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/date_range.rb +8 -15
- data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/post_date_range.rb +12 -18
- data/lib/genesis_ruby/api/requests/non_financial/reconcile/date_range.rb +29 -4
- data/lib/genesis_ruby/api/requests/non_financial/reconcile/order.rb +40 -0
- data/lib/genesis_ruby/api/requests/non_financial/reconcile/transaction.rb +1 -15
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/cryptogram.rb +3 -1
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/tokenize.rb +3 -1
- data/lib/genesis_ruby/api/requests/wpf/create.rb +4 -0
- data/lib/genesis_ruby/api/requests/wpf/reconcile.rb +11 -4
- data/lib/genesis_ruby/api/requests/wpf/reconcile_by_date.rb +62 -0
- data/lib/genesis_ruby/api/requests/wpf/reconcile_by_order.rb +38 -0
- data/lib/genesis_ruby/builders/graphql.rb +95 -40
- data/lib/genesis_ruby/dependencies.rb +2 -0
- data/lib/genesis_ruby/utils/money/format.rb +2 -1
- data/lib/genesis_ruby/utils/transactions/financial_types.rb +3 -2
- data/lib/genesis_ruby/utils/transactions/references/refundable_types.rb +2 -1
- data/lib/genesis_ruby/utils/transactions/wpf_types.rb +1 -1
- data/lib/genesis_ruby/version.rb +1 -1
- metadata +40 -35
- data/.kiro/specs/f2025112509-add_managed_recurring_api/.config.kiro +0 -1
- data/.kiro/specs/f2025112509-add_managed_recurring_api/design.md +0 -332
- data/.kiro/specs/f2025112509-add_managed_recurring_api/requirements.md +0 -91
- data/.kiro/specs/f2025112509-add_managed_recurring_api/tasks.md +0 -139
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/.config.kiro +0 -1
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/design.md +0 -148
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/requirements.md +0 -81
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/tasks.md +0 -48
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/.config.kiro +0 -1
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/design.md +0 -112
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/requirements.md +0 -74
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/tasks.md +0 -38
- data/.kiro/specs/f2025112609_update_payee_request_params/design.md +0 -86
- data/.kiro/specs/f2025112609_update_payee_request_params/requirements.md +0 -86
- data/.kiro/specs/f2025112609_update_payee_request_params/tasks.md +0 -40
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/.config.kiro +0 -1
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/design.md +0 -246
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/requirements.md +0 -287
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/tasks.md +0 -76
- data/.kiro/specs/f2025112614-add_money_transfer_payout_attributes_to_payout_rq/design.md +0 -84
- data/.kiro/specs/f2025112614-add_money_transfer_payout_attributes_to_payout_rq/requirements.md +0 -88
- data/.kiro/specs/f2025112614-add_money_transfer_payout_attributes_to_payout_rq/tasks.md +0 -38
- data/.kiro/steering/product.md +0 -15
- data/.kiro/steering/spec-folder-naming.md +0 -16
- data/.kiro/steering/structure.md +0 -96
- data/.kiro/steering/tech.md +0 -66
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -176
- data/Rakefile +0 -24
- data/genesis_ruby.gemspec +0 -47
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/externally_processed.rb +0 -24
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/scopes'
|
|
4
|
+
|
|
5
|
+
module GenesisRuby
|
|
6
|
+
module Api
|
|
7
|
+
module Requests
|
|
8
|
+
module NonFinancial
|
|
9
|
+
module PaymentAuthorizations
|
|
10
|
+
# Date range based Payment Authorizations retrieval allows you to fetch a paginated list of payment
|
|
11
|
+
# authorizations created and/or authorized within a given date range.
|
|
12
|
+
class DateRange < Api::Request
|
|
13
|
+
|
|
14
|
+
include Api::Mixins::Requests::NonFinancial::DateAttributes
|
|
15
|
+
include Api::Mixins::Requests::NonFinancial::PagingAttributes
|
|
16
|
+
include Api::Mixins::Requests::NonFinancial::ScopeAttributes
|
|
17
|
+
|
|
18
|
+
# Maximum allowed records per page
|
|
19
|
+
MAX_PER_PAGE = 500
|
|
20
|
+
|
|
21
|
+
# Start of the requested creation date range
|
|
22
|
+
def start_date
|
|
23
|
+
@start_date&.strftime Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# End of the requested creation date range
|
|
27
|
+
def end_date
|
|
28
|
+
@end_date&.strftime Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Start of the requested authorization date range
|
|
32
|
+
def auth_start_date
|
|
33
|
+
@auth_start_date&.strftime Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Start of the requested authorization date range
|
|
37
|
+
def auth_start_date=(value)
|
|
38
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# End of the requested authorization date range
|
|
42
|
+
def auth_end_date
|
|
43
|
+
@auth_end_date&.strftime Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# End of the requested authorization date range
|
|
47
|
+
def auth_end_date=(value)
|
|
48
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
protected
|
|
52
|
+
|
|
53
|
+
# Payment Authorizations API DateRange request configuration
|
|
54
|
+
def init_configuration
|
|
55
|
+
init_xml_configuration
|
|
56
|
+
init_api_gateway_configuration request_path: 'payment_authorizations/by_date', include_token: false
|
|
57
|
+
@api_config.parser_skip_root_node = false
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Payment Authorizations API DateRange field validations
|
|
61
|
+
def init_field_validations
|
|
62
|
+
super
|
|
63
|
+
|
|
64
|
+
required_fields.push *%i[scope]
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Payment Authorizations API DateRange custom field validations
|
|
68
|
+
def check_requirements
|
|
69
|
+
validate_start_dates
|
|
70
|
+
validate_range_order :start_date, :end_date
|
|
71
|
+
validate_range_order :auth_start_date, :auth_end_date
|
|
72
|
+
validate_per_page
|
|
73
|
+
|
|
74
|
+
super
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Payment Authorizations API DateRange request structure
|
|
78
|
+
def populate_structure # rubocop:disable Metrics/MethodLength
|
|
79
|
+
@tree_structure = {
|
|
80
|
+
payment_authorization_request: {
|
|
81
|
+
start_date: start_date,
|
|
82
|
+
end_date: end_date,
|
|
83
|
+
auth_start_date: auth_start_date,
|
|
84
|
+
auth_end_date: auth_end_date,
|
|
85
|
+
page: page,
|
|
86
|
+
per_page: per_page,
|
|
87
|
+
scope: scope
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
private
|
|
93
|
+
|
|
94
|
+
# At least one of start_date or auth_start_date is required
|
|
95
|
+
def validate_start_dates
|
|
96
|
+
return unless @start_date.nil? && @auth_start_date.nil?
|
|
97
|
+
|
|
98
|
+
raise ParameterError, 'At least one of start_date or auth_start_date fields has to be set.'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# End of a date range cannot be on an earlier calendar day than its start
|
|
102
|
+
def validate_range_order(start_attribute, end_attribute)
|
|
103
|
+
start_value = instance_variable_get "@#{start_attribute}"
|
|
104
|
+
end_value = instance_variable_get "@#{end_attribute}"
|
|
105
|
+
|
|
106
|
+
return if start_value.nil? || end_value.nil?
|
|
107
|
+
return if end_value.to_date >= start_value.to_date
|
|
108
|
+
|
|
109
|
+
raise ParameterError, "#{start_attribute} cannot be later than #{end_attribute}."
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Per page cannot exceed the maximum allowed records
|
|
113
|
+
def validate_per_page
|
|
114
|
+
return if per_page.nil? || per_page <= MAX_PER_PAGE
|
|
115
|
+
|
|
116
|
+
raise ParameterError, "per_page cannot be greater than #{MAX_PER_PAGE}."
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/
|
|
4
|
-
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/processing_type'
|
|
3
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/scopes'
|
|
5
4
|
|
|
6
5
|
module GenesisRuby
|
|
7
6
|
module Api
|
|
@@ -14,8 +13,7 @@ module GenesisRuby
|
|
|
14
13
|
|
|
15
14
|
include Api::Mixins::Requests::NonFinancial::DateAttributes
|
|
16
15
|
include Api::Mixins::Requests::NonFinancial::PagingAttributes
|
|
17
|
-
|
|
18
|
-
attr_accessor :externally_processed, :processing_type
|
|
16
|
+
include Api::Mixins::Requests::NonFinancial::ScopeAttributes
|
|
19
17
|
|
|
20
18
|
# Start of the requested date range
|
|
21
19
|
def start_date
|
|
@@ -41,23 +39,18 @@ module GenesisRuby
|
|
|
41
39
|
def init_field_validations
|
|
42
40
|
super
|
|
43
41
|
|
|
44
|
-
required_fields.push *%i[start_date]
|
|
45
|
-
field_values.merge! externally_processed: Constants::Transactions::Parameters::NonFinancial::
|
|
46
|
-
ExternallyProcessed.all,
|
|
47
|
-
processing_type: Constants::Transactions::Parameters::NonFinancial::
|
|
48
|
-
ProcessingType.all
|
|
42
|
+
required_fields.push *%i[start_date scope]
|
|
49
43
|
end
|
|
50
44
|
|
|
51
45
|
# Processed Transactions API DateRange request structure
|
|
52
46
|
def populate_structure
|
|
53
47
|
@tree_structure = {
|
|
54
48
|
processed_transaction_request: {
|
|
55
|
-
start_date:
|
|
56
|
-
end_date:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
per_page: per_page
|
|
49
|
+
start_date: start_date,
|
|
50
|
+
end_date: end_date,
|
|
51
|
+
scope: scope,
|
|
52
|
+
page: page,
|
|
53
|
+
per_page: per_page
|
|
61
54
|
}
|
|
62
55
|
}
|
|
63
56
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/
|
|
4
|
-
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/processing_type'
|
|
3
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/scopes'
|
|
5
4
|
|
|
6
5
|
module GenesisRuby
|
|
7
6
|
module Api
|
|
@@ -14,9 +13,9 @@ module GenesisRuby
|
|
|
14
13
|
|
|
15
14
|
include Api::Mixins::Requests::NonFinancial::DateAttributes
|
|
16
15
|
include Api::Mixins::Requests::NonFinancial::PagingAttributes
|
|
16
|
+
include Api::Mixins::Requests::NonFinancial::ScopeAttributes
|
|
17
17
|
|
|
18
|
-
attr_accessor :batch_number, :batch_slip_number, :deposit_slip_number
|
|
19
|
-
:processing_type
|
|
18
|
+
attr_accessor :batch_number, :batch_slip_number, :deposit_slip_number
|
|
20
19
|
|
|
21
20
|
# Start of the requested date range
|
|
22
21
|
def start_date
|
|
@@ -42,26 +41,21 @@ module GenesisRuby
|
|
|
42
41
|
def init_field_validations
|
|
43
42
|
super
|
|
44
43
|
|
|
45
|
-
required_fields.push *%i[start_date]
|
|
46
|
-
field_values.merge! externally_processed: Constants::Transactions::Parameters::NonFinancial::
|
|
47
|
-
ExternallyProcessed.all,
|
|
48
|
-
processing_type: Constants::Transactions::Parameters::NonFinancial::
|
|
49
|
-
ProcessingType.all
|
|
44
|
+
required_fields.push *%i[start_date scope]
|
|
50
45
|
end
|
|
51
46
|
|
|
52
47
|
# Processed Transactions API DateRange request structure
|
|
53
48
|
def populate_structure # rubocop:disable Metrics/MethodLength
|
|
54
49
|
@tree_structure = {
|
|
55
50
|
processed_transaction_request: {
|
|
56
|
-
start_date:
|
|
57
|
-
end_date:
|
|
58
|
-
batch_number:
|
|
59
|
-
batch_slip_number:
|
|
60
|
-
deposit_slip_number:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
per_page: per_page
|
|
51
|
+
start_date: start_date,
|
|
52
|
+
end_date: end_date,
|
|
53
|
+
batch_number: batch_number,
|
|
54
|
+
batch_slip_number: batch_slip_number,
|
|
55
|
+
deposit_slip_number: deposit_slip_number,
|
|
56
|
+
scope: scope,
|
|
57
|
+
page: page,
|
|
58
|
+
per_page: per_page
|
|
65
59
|
}
|
|
66
60
|
}
|
|
67
61
|
end
|
|
@@ -8,10 +8,15 @@ module GenesisRuby
|
|
|
8
8
|
# Date range based reconciliation allows you to fetch information for all payment transactions from
|
|
9
9
|
# a terminal within a given date range.
|
|
10
10
|
# The response is paginated, each request will return 100 entries max.
|
|
11
|
-
class DateRange < Api::
|
|
11
|
+
class DateRange < Api::Requests::Base::NonFinancial::Reconcile::Base
|
|
12
12
|
|
|
13
13
|
include Api::Mixins::Requests::NonFinancial::DateAttributes
|
|
14
14
|
|
|
15
|
+
# Maximum range between start_date and end_date in days
|
|
16
|
+
MAX_RANGE_DAYS = 7
|
|
17
|
+
# Maximum range between start_date and end_date in days, when Smart Router is used
|
|
18
|
+
MAX_RANGE_DAYS_SMART_ROUTER = 1
|
|
19
|
+
|
|
15
20
|
attr_reader :page
|
|
16
21
|
|
|
17
22
|
# The page within the paginated result, defaults to 1
|
|
@@ -21,15 +26,35 @@ module GenesisRuby
|
|
|
21
26
|
|
|
22
27
|
protected
|
|
23
28
|
|
|
29
|
+
# The Reconcile API path
|
|
30
|
+
def request_path
|
|
31
|
+
'reconcile/by_date'
|
|
32
|
+
end
|
|
33
|
+
|
|
24
34
|
# Set Gateway API configuration
|
|
25
35
|
def init_configuration
|
|
26
|
-
|
|
27
|
-
init_api_gateway_configuration request_path: 'reconcile/by_date'
|
|
36
|
+
super
|
|
28
37
|
@api_config.parser_skip_root_node = false
|
|
29
38
|
end
|
|
30
39
|
|
|
31
40
|
def init_field_validations
|
|
32
|
-
required_fields.push *%i[start_date]
|
|
41
|
+
required_fields.push *%i[start_date end_date]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Validate the requirements and the date range
|
|
45
|
+
def check_requirements
|
|
46
|
+
super
|
|
47
|
+
validate_date_range
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# End date should not be before the start date and the range should not exceed the allowed maximum
|
|
51
|
+
def validate_date_range
|
|
52
|
+
raise ParameterError, 'End Date should not be before Start Date!' if @end_date < @start_date
|
|
53
|
+
|
|
54
|
+
max_days = smart_router_active? ? MAX_RANGE_DAYS_SMART_ROUTER : MAX_RANGE_DAYS
|
|
55
|
+
return unless (@end_date - @start_date) > max_days
|
|
56
|
+
|
|
57
|
+
raise ParameterError, "Max difference between start_date and end_date is #{max_days} day(s)!"
|
|
33
58
|
end
|
|
34
59
|
|
|
35
60
|
# API Request structure
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module NonFinancial
|
|
7
|
+
module Reconcile
|
|
8
|
+
# Reconcile by order returns all payment transactions associated with a merchant order identifier
|
|
9
|
+
# in a single, un-paginated response.
|
|
10
|
+
class Order < Api::Requests::Base::NonFinancial::Reconcile::Base
|
|
11
|
+
|
|
12
|
+
include Mixins::Requests::NonFinancial::ReconcileOrderAttributes
|
|
13
|
+
|
|
14
|
+
protected
|
|
15
|
+
|
|
16
|
+
# The Reconcile API path
|
|
17
|
+
def request_path
|
|
18
|
+
'reconcile/by_order'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Required fields
|
|
22
|
+
def init_field_validations
|
|
23
|
+
required_fields.push *%i[order_id]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# API Request structure
|
|
27
|
+
def populate_structure
|
|
28
|
+
@tree_structure = {
|
|
29
|
+
reconcile: {
|
|
30
|
+
order_id: order_id
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -8,26 +8,12 @@ module GenesisRuby
|
|
|
8
8
|
# Reconcile can be used to retrieve data about a transaction.
|
|
9
9
|
# This can be useful if you want to retrieve information about a transaction whose status is timeout,
|
|
10
10
|
# which returned an error or has changed eg. has beed chargebacked.
|
|
11
|
-
class Transaction < Api::
|
|
12
|
-
|
|
13
|
-
include Mixins::Requests::SmartRouterAttributes
|
|
11
|
+
class Transaction < Api::Requests::Base::NonFinancial::Reconcile::Base
|
|
14
12
|
|
|
15
13
|
attr_accessor :arn, :transaction_id, :unique_id
|
|
16
14
|
|
|
17
15
|
protected
|
|
18
16
|
|
|
19
|
-
# Set Gateway API configuration
|
|
20
|
-
def init_configuration
|
|
21
|
-
init_xml_configuration
|
|
22
|
-
init_api_gateway_configuration request_path: 'reconcile'
|
|
23
|
-
init_api_smart_router_configuration if @configuration.force_smart_routing
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# Initialize Smart Router endpoint
|
|
27
|
-
def init_api_smart_router_configuration
|
|
28
|
-
api_config.url = build_request_url({ subdomain: 'smart_router', path: 'reconcile' })
|
|
29
|
-
end
|
|
30
|
-
|
|
31
17
|
# API Request structure
|
|
32
18
|
def populate_structure
|
|
33
19
|
@tree_structure = {
|
|
@@ -10,6 +10,7 @@ module GenesisRuby
|
|
|
10
10
|
|
|
11
11
|
include Api::Mixins::Requests::NonFinancial::Tokenization::TokenAttributes
|
|
12
12
|
include Api::Mixins::Requests::NonFinancial::Tokenization::TokenizationAttributes
|
|
13
|
+
include Api::Mixins::Requests::SchemeTokenizedAttributes
|
|
13
14
|
|
|
14
15
|
attr_accessor :transaction_reference
|
|
15
16
|
|
|
@@ -35,7 +36,8 @@ module GenesisRuby
|
|
|
35
36
|
{
|
|
36
37
|
token: token,
|
|
37
38
|
transaction_reference: transaction_reference
|
|
38
|
-
}
|
|
39
|
+
},
|
|
40
|
+
scheme_tokenized_attributes_structure
|
|
39
41
|
)
|
|
40
42
|
}
|
|
41
43
|
end
|
|
@@ -12,6 +12,7 @@ module GenesisRuby
|
|
|
12
12
|
|
|
13
13
|
include Api::Mixins::Requests::NonFinancial::Tokenization::CardDataAttributes
|
|
14
14
|
include Api::Mixins::Requests::NonFinancial::Tokenization::TokenizationAttributes
|
|
15
|
+
include Api::Mixins::Requests::SchemeTokenizedAttributes
|
|
15
16
|
|
|
16
17
|
def initialize(configuration, builder_interface = Builder::XML)
|
|
17
18
|
super configuration, builder_interface
|
|
@@ -34,7 +35,8 @@ module GenesisRuby
|
|
|
34
35
|
tokenize_request: tokenization_attributes_structure.merge(
|
|
35
36
|
{
|
|
36
37
|
card_data: card_data_attributes_structure
|
|
37
|
-
}
|
|
38
|
+
},
|
|
39
|
+
scheme_tokenized_attributes_structure
|
|
38
40
|
)
|
|
39
41
|
}
|
|
40
42
|
end
|
|
@@ -21,8 +21,10 @@ module GenesisRuby
|
|
|
21
21
|
include Mixins::Requests::Financial::DynamicDescriptorAttributes
|
|
22
22
|
include Mixins::Requests::Financial::FundingAttributes
|
|
23
23
|
include Mixins::Requests::Financial::NotificationAttributes
|
|
24
|
+
include Mixins::Requests::Financial::OrderAttributes
|
|
24
25
|
include Mixins::Requests::Financial::PaymentAttributes
|
|
25
26
|
include Mixins::Requests::Financial::PendingPaymentAttributes
|
|
27
|
+
include Mixins::Requests::Financial::PurposeOfPaymentAttributes
|
|
26
28
|
include Mixins::Requests::Financial::RiskAttributes
|
|
27
29
|
include Mixins::Requests::Financial::Threeds::Version2::WpfAttributes
|
|
28
30
|
include Mixins::Requests::WpfRemindersAttributes
|
|
@@ -186,6 +188,7 @@ module GenesisRuby
|
|
|
186
188
|
},
|
|
187
189
|
threeds_v2_params: threeds_v2_wpf_attributes_structure,
|
|
188
190
|
web_payment_form_id: web_payment_form_id,
|
|
191
|
+
order_id: order_id,
|
|
189
192
|
recurring_category: recurring_category,
|
|
190
193
|
dynamic_descriptor_params: dynamic_descriptor_structure,
|
|
191
194
|
risk_params: risk_parameters_structure,
|
|
@@ -194,6 +197,7 @@ module GenesisRuby
|
|
|
194
197
|
scheme_tokenized: scheme_tokenized,
|
|
195
198
|
reminders: pay_later ? reminders_structure : [],
|
|
196
199
|
funding: funding_attributes_structure,
|
|
200
|
+
purpose_of_payment: purpose_of_payment,
|
|
197
201
|
digital_asset_type: digital_asset_type
|
|
198
202
|
}
|
|
199
203
|
}
|
|
@@ -9,7 +9,7 @@ module GenesisRuby
|
|
|
9
9
|
# which returned an error or has changed eg. has beed chargebacked.
|
|
10
10
|
class Reconcile < Request
|
|
11
11
|
|
|
12
|
-
attr_accessor :unique_id
|
|
12
|
+
attr_accessor :unique_id, :arn, :transaction_id
|
|
13
13
|
|
|
14
14
|
protected
|
|
15
15
|
|
|
@@ -19,15 +19,22 @@ module GenesisRuby
|
|
|
19
19
|
@api_config.url = build_request_url subdomain: 'wpf', path: 'wpf/reconcile'
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
# At least one of unique_id, arn or transaction_id is required
|
|
23
|
+
def check_requirements
|
|
24
|
+
super
|
|
25
|
+
|
|
26
|
+
return unless %i[unique_id arn transaction_id].all? { |field| null_or_empty_field? field }
|
|
27
|
+
|
|
28
|
+
raise ParameterError, 'One of unique_id, arn or transaction_id is required!'
|
|
24
29
|
end
|
|
25
30
|
|
|
26
31
|
# WPF Reconcile request structure
|
|
27
32
|
def populate_structure
|
|
28
33
|
@tree_structure = {
|
|
29
34
|
wpf_reconcile: {
|
|
30
|
-
unique_id:
|
|
35
|
+
unique_id: unique_id,
|
|
36
|
+
arn: arn,
|
|
37
|
+
transaction_id: transaction_id
|
|
31
38
|
}
|
|
32
39
|
}
|
|
33
40
|
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module Wpf
|
|
7
|
+
# Reconcile by date range returns the WPF payments created within a given date range.
|
|
8
|
+
# The response is paginated.
|
|
9
|
+
class ReconcileByDate < Request
|
|
10
|
+
|
|
11
|
+
include Mixins::Requests::NonFinancial::DateAttributes
|
|
12
|
+
|
|
13
|
+
attr_reader :page, :records_per_page
|
|
14
|
+
|
|
15
|
+
# The page within the paginated result
|
|
16
|
+
def page=(value)
|
|
17
|
+
parse_int attribute: __method__, value: value, allow_empty: true
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# The number of records per page
|
|
21
|
+
def records_per_page=(value)
|
|
22
|
+
parse_int attribute: __method__, value: value, allow_empty: true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
protected
|
|
26
|
+
|
|
27
|
+
# Define WPF Reconcile by Date request configuration
|
|
28
|
+
def init_configuration
|
|
29
|
+
init_xml_configuration
|
|
30
|
+
@api_config.url = build_request_url subdomain: 'wpf', path: 'wpf/reconcile/by_date'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def init_field_validations
|
|
34
|
+
required_fields.push *%i[start_date]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# End date, when given, should not be before the start date
|
|
38
|
+
def check_requirements
|
|
39
|
+
super
|
|
40
|
+
|
|
41
|
+
return unless @end_date && @end_date < @start_date
|
|
42
|
+
|
|
43
|
+
raise ParameterError, 'End Date should not be before Start Date!'
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# WPF Reconcile by Date request structure
|
|
47
|
+
def populate_structure
|
|
48
|
+
@tree_structure = {
|
|
49
|
+
wpf_reconcile: {
|
|
50
|
+
start_date: start_date,
|
|
51
|
+
end_date: end_date,
|
|
52
|
+
page: page,
|
|
53
|
+
records_per_page: records_per_page
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module Wpf
|
|
7
|
+
# Reconcile by order returns all WPF payments associated with a merchant order identifier
|
|
8
|
+
# in a single, un-paginated response.
|
|
9
|
+
class ReconcileByOrder < Request
|
|
10
|
+
|
|
11
|
+
include Mixins::Requests::NonFinancial::ReconcileOrderAttributes
|
|
12
|
+
|
|
13
|
+
protected
|
|
14
|
+
|
|
15
|
+
# Define WPF Reconcile by Order request configuration
|
|
16
|
+
def init_configuration
|
|
17
|
+
init_xml_configuration
|
|
18
|
+
@api_config.url = build_request_url subdomain: 'wpf', path: 'wpf/reconcile/by_order'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def init_field_validations
|
|
22
|
+
required_fields.push *%i[order_id]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# WPF Reconcile by Order request structure
|
|
26
|
+
def populate_structure
|
|
27
|
+
@tree_structure = {
|
|
28
|
+
wpf_reconcile: {
|
|
29
|
+
order_id: order_id
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|