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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +78 -0
- data/Gemfile.lock +14 -14
- data/README.md +78 -0
- data/VERSION +1 -1
- data/lib/genesis_ruby/api/constants/currencies/iso4217.rb +6 -0
- data/lib/genesis_ruby/api/constants/non_financial/kyc/document_types.rb +49 -0
- data/lib/genesis_ruby/api/constants/non_financial/kyc/genders.rb +22 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/african_mobile_operators.rb +37 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_owner.rb +24 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_subtype.rb +24 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/customer_identification/customer_identification_type.rb +63 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/digital_asset_types.rb +31 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/externally_processed.rb +22 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/processing_type.rb +22 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/sca_exemptions.rb +25 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/online_banking/iframe_targets.rb +26 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/purpose_of_payment.rb +136 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/source_of_funds.rb +34 -0
- data/lib/genesis_ruby/api/mixins/requests/digital_asset_type_attributes.rb +26 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/african_mobile_attributes.rb +30 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/beneficiary_attributes.rb +38 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/cards/tokenization_params_attributes.rb +36 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/customer_account_attributes.rb +21 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/customer_identification_attributes.rb +82 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/gift_cards_attributes.rb +26 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/online_banking_payments/payer_attributes.rb +65 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/preauthorization_attributes.rb +25 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/purpose_of_payment_attributes.rb +29 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/source_of_funds_attributes.rb +38 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/travel_data/airline_itinerary_attributes.rb +1 -1
- data/lib/genesis_ruby/api/mixins/requests/non_financial/fx/id_attributes.rb +28 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/fx/tier_id_attributes.rb +28 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/customer_information_attributes.rb +62 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/mode_attributes.rb +24 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/tokenization/card_data_attributes.rb +62 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/tokenization/token_attributes.rb +23 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/tokenization/tokenization_attributes.rb +51 -0
- data/lib/genesis_ruby/api/request.rb +7 -0
- data/lib/genesis_ruby/api/requests/base/consumer.rb +24 -0
- data/lib/genesis_ruby/api/requests/base/financial.rb +10 -1
- data/lib/genesis_ruby/api/requests/base/financials/credit_card.rb +9 -9
- data/lib/genesis_ruby/api/requests/base/financials/south_american_payments.rb +11 -14
- data/lib/genesis_ruby/api/requests/base/non_financial/kyc/base.rb +33 -0
- data/lib/genesis_ruby/api/requests/base/reference.rb +3 -3
- data/lib/genesis_ruby/api/requests/financial/Preauthorizations/incremental_authorize.rb +24 -0
- data/lib/genesis_ruby/api/requests/financial/cards/authorize.rb +5 -1
- data/lib/genesis_ruby/api/requests/financial/cards/authorize3d.rb +5 -1
- data/lib/genesis_ruby/api/requests/financial/cards/bancontact.rb +8 -9
- data/lib/genesis_ruby/api/requests/financial/cards/credit.rb +39 -0
- data/lib/genesis_ruby/api/requests/financial/cards/payout.rb +72 -0
- data/lib/genesis_ruby/api/requests/financial/cards/sale.rb +3 -1
- data/lib/genesis_ruby/api/requests/financial/cards/sale3d.rb +3 -1
- data/lib/genesis_ruby/api/requests/financial/cash_payments/cash.rb +13 -14
- data/lib/genesis_ruby/api/requests/financial/cash_payments/pix.rb +23 -25
- data/lib/genesis_ruby/api/requests/financial/crypto/bit_pay/payout.rb +52 -0
- data/lib/genesis_ruby/api/requests/financial/crypto/bit_pay/refund.rb +36 -0
- data/lib/genesis_ruby/api/requests/financial/crypto/bit_pay/sale.rb +55 -0
- data/lib/genesis_ruby/api/requests/financial/gift_cards/fashioncheque.rb +47 -0
- data/lib/genesis_ruby/api/requests/financial/gift_cards/intersolve.rb +46 -0
- data/lib/genesis_ruby/api/requests/financial/gift_cards/tcs.rb +47 -0
- data/lib/genesis_ruby/api/requests/financial/mobile/african_mobile_sale.rb +81 -0
- data/lib/genesis_ruby/api/requests/financial/mobile/apple_pay.rb +18 -20
- data/lib/genesis_ruby/api/requests/financial/mobile/google_pay.rb +20 -24
- data/lib/genesis_ruby/api/requests/financial/mobile/russian_mobile_sale.rb +55 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/banco_do_brasil.rb +11 -14
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/eps.rb +9 -10
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/idebit/pay_in.rb +11 -18
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/insta_debit/pay_in.rb +61 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/insta_debit/pay_out.rb +24 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/multibanco.rb +48 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/my_bank.rb +47 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/online_banking/pay_in.rb +17 -18
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/online_banking/pay_out.rb +33 -38
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/pay_u.rb +61 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/post_finance.rb +53 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/safety_pay.rb +57 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/sofort.rb +63 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/trustly_sale.rb +75 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/upi.rb +54 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/wechat.rb +11 -14
- data/lib/genesis_ruby/api/requests/financial/sdd/sale.rb +13 -17
- data/lib/genesis_ruby/api/requests/financial/void.rb +12 -5
- data/lib/genesis_ruby/api/requests/financial/vouchers/neosurf.rb +61 -0
- data/lib/genesis_ruby/api/requests/financial/wallets/alipay.rb +10 -13
- data/lib/genesis_ruby/api/requests/financial/wallets/pay_pal.rb +18 -20
- data/lib/genesis_ruby/api/requests/non_financial/consumers/create.rb +44 -0
- data/lib/genesis_ruby/api/requests/non_financial/consumers/disable.rb +40 -0
- data/lib/genesis_ruby/api/requests/non_financial/consumers/enable.rb +40 -0
- data/lib/genesis_ruby/api/requests/non_financial/consumers/get_cards.rb +40 -0
- data/lib/genesis_ruby/api/requests/non_financial/consumers/retrieve.rb +40 -0
- data/lib/genesis_ruby/api/requests/non_financial/consumers/update.rb +45 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/chargeback/date_range.rb +82 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/chargeback/transaction.rb +52 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/reports/date_range.rb +108 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/reports/transaction.rb +52 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/retrieval/date_range.rb +81 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/retrieval/transaction.rb +52 -0
- data/lib/genesis_ruby/api/requests/non_financial/fx/get_rate.rb +55 -0
- data/lib/genesis_ruby/api/requests/non_financial/fx/get_rates.rb +53 -0
- data/lib/genesis_ruby/api/requests/non_financial/fx/get_tier.rb +53 -0
- data/lib/genesis_ruby/api/requests/non_financial/fx/get_tiers.rb +35 -0
- data/lib/genesis_ruby/api/requests/non_financial/fx/search_rate.rb +61 -0
- data/lib/genesis_ruby/api/requests/non_financial/kyc/consumer_registration/create.rb +99 -0
- data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/date_range.rb +68 -0
- data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/post_date_range.rb +72 -0
- data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/transaction.rb +48 -0
- data/lib/genesis_ruby/api/requests/non_financial/sca/checker.rb +77 -0
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/cryptogram.rb +46 -0
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/delete_token.rb +43 -0
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/detokenize.rb +43 -0
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/get_card.rb +43 -0
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/tokenize.rb +45 -0
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/update_token.rb +45 -0
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/validate_token.rb +43 -0
- data/lib/genesis_ruby/api/requests/wpf/create.rb +3 -1
- data/lib/genesis_ruby/configuration.rb +4 -0
- data/lib/genesis_ruby/dependencies.rb +2 -0
- data/lib/genesis_ruby/utils/country.rb +272 -0
- data/lib/genesis_ruby/utils/formatters/response/formats/timestamp.rb +1 -1
- data/lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb +1 -4
- data/lib/genesis_ruby/version.rb +1 -1
- metadata +87 -2
@@ -0,0 +1,53 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module NonFinancial
|
5
|
+
module Fx
|
6
|
+
# This call is used to return all rates for Tier
|
7
|
+
class GetRates < Base::Versioned
|
8
|
+
|
9
|
+
include Api::Mixins::Requests::NonFinancial::Fx::TierIdAttributes
|
10
|
+
|
11
|
+
# Get Rates initialization
|
12
|
+
def initialize(configuration, _builder_interface = nil)
|
13
|
+
super configuration
|
14
|
+
|
15
|
+
self.request_path = 'fx/tiers/:tier_id/rates'
|
16
|
+
end
|
17
|
+
|
18
|
+
protected
|
19
|
+
|
20
|
+
# Override default Versioned Network configuration
|
21
|
+
def init_configuration
|
22
|
+
super
|
23
|
+
|
24
|
+
init_get_configuration
|
25
|
+
end
|
26
|
+
|
27
|
+
# Fetch request field validations
|
28
|
+
def init_field_validations
|
29
|
+
super
|
30
|
+
|
31
|
+
required_fields.push *tier_id_required_fields
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get Rates request structure
|
35
|
+
def request_structure
|
36
|
+
{}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Override API endpoint with provided ID
|
40
|
+
def process_request_parameters
|
41
|
+
super
|
42
|
+
|
43
|
+
request_path.sub!(':tier_id', tier_id)
|
44
|
+
|
45
|
+
init_api_gateway_configuration request_path: "#{version}/#{request_path}", include_token: false
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module NonFinancial
|
5
|
+
module Fx
|
6
|
+
# This call is used to return information about selected Tier for your merchant
|
7
|
+
class GetTier < Base::Versioned
|
8
|
+
|
9
|
+
include Api::Mixins::Requests::NonFinancial::Fx::IdAttributes
|
10
|
+
|
11
|
+
# Get Tier initialization
|
12
|
+
def initialize(configuration, _builder_interface = nil)
|
13
|
+
super configuration
|
14
|
+
|
15
|
+
self.request_path = 'fx/tiers/:id'
|
16
|
+
end
|
17
|
+
|
18
|
+
protected
|
19
|
+
|
20
|
+
# Override default Versioned Network configuration
|
21
|
+
def init_configuration
|
22
|
+
super
|
23
|
+
|
24
|
+
init_get_configuration
|
25
|
+
end
|
26
|
+
|
27
|
+
# Fetch request field validations
|
28
|
+
def init_field_validations
|
29
|
+
super
|
30
|
+
|
31
|
+
required_fields.push *id_required_fields
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get Tier request structure
|
35
|
+
def request_structure
|
36
|
+
{}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Override API endpoint with provided ID
|
40
|
+
def process_request_parameters
|
41
|
+
super
|
42
|
+
|
43
|
+
request_path.sub!(':id', id)
|
44
|
+
|
45
|
+
init_api_gateway_configuration request_path: "#{version}/#{request_path}", include_token: false
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module NonFinancial
|
5
|
+
module Fx
|
6
|
+
# This call is used to return all Tiers that are related to your account
|
7
|
+
class GetTiers < Base::Versioned
|
8
|
+
|
9
|
+
# Get Tiers initialization
|
10
|
+
def initialize(configuration, _builder_interface = nil)
|
11
|
+
super configuration
|
12
|
+
|
13
|
+
self.request_path = 'fx/tiers'
|
14
|
+
end
|
15
|
+
|
16
|
+
protected
|
17
|
+
|
18
|
+
# Override default Versioned Network configuration
|
19
|
+
def init_configuration
|
20
|
+
super
|
21
|
+
|
22
|
+
init_get_configuration
|
23
|
+
end
|
24
|
+
|
25
|
+
# Get Tiers request structure
|
26
|
+
def request_structure
|
27
|
+
{}
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module NonFinancial
|
5
|
+
module Fx
|
6
|
+
# This call is used to return information about selected Rate by currency pair
|
7
|
+
class SearchRate < Base::Versioned
|
8
|
+
|
9
|
+
include Api::Mixins::Requests::NonFinancial::Fx::TierIdAttributes
|
10
|
+
|
11
|
+
attr_writer :source_currency, :target_currency
|
12
|
+
|
13
|
+
# Search Rate initialization
|
14
|
+
def initialize(configuration, _builder_interface = nil)
|
15
|
+
super configuration
|
16
|
+
|
17
|
+
self.request_path = 'fx/tiers/:tier_id/rates/search'
|
18
|
+
end
|
19
|
+
|
20
|
+
# Source currency
|
21
|
+
def source_currency
|
22
|
+
@source_currency.to_s.upcase
|
23
|
+
end
|
24
|
+
|
25
|
+
# Target currency
|
26
|
+
def target_currency
|
27
|
+
@target_currency.to_s.upcase
|
28
|
+
end
|
29
|
+
|
30
|
+
protected
|
31
|
+
|
32
|
+
# Fetch request field validations
|
33
|
+
def init_field_validations
|
34
|
+
super
|
35
|
+
|
36
|
+
required_fields.push *tier_id_required_fields, *%i[source_currency target_currency]
|
37
|
+
end
|
38
|
+
|
39
|
+
# Search Rate request structure
|
40
|
+
def request_structure
|
41
|
+
{
|
42
|
+
source_currency: source_currency,
|
43
|
+
target_currency: target_currency
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Override API endpoint with provided ID
|
48
|
+
def process_request_parameters
|
49
|
+
super
|
50
|
+
|
51
|
+
request_path.sub!(':tier_id', tier_id)
|
52
|
+
|
53
|
+
init_api_gateway_configuration request_path: "#{version}/#{request_path}", include_token: false
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module NonFinancial
|
5
|
+
module Kyc
|
6
|
+
module ConsumerRegistration
|
7
|
+
# Create Consumer Registration Request class for KYC Non-Financial API services
|
8
|
+
class Create < Api::Requests::Base::NonFinancial::Kyc::Base
|
9
|
+
|
10
|
+
include Api::Mixins::Requests::NonFinancial::Kyc::CustomerInformationAttributes
|
11
|
+
|
12
|
+
attr_accessor :session_id, :customer_unique_id, :transaction_unique_id, :customer_phone_number,
|
13
|
+
:service_language, :security_code, :service_type, :customer_username,
|
14
|
+
:customer_registration_date, :customer_registration_ip_address,
|
15
|
+
:customer_registration_device_id, :third_party_device_id, :device_fingerprint,
|
16
|
+
:bonus_code, :bonus_submission_date, :bonus_amount, :merchant_website,
|
17
|
+
:how_did_you_hear, :affiliate_id, :rule_context
|
18
|
+
attr_writer :profile_action_type, :device_fingerprint_type, :profile_current_status, :industry_type
|
19
|
+
|
20
|
+
# Initializes the Create Consumer Registration Request
|
21
|
+
def initialize(configuration, _builder_interface = nil)
|
22
|
+
super configuration
|
23
|
+
|
24
|
+
self.request_path = 'create_consumer'
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns device_fingerprint_type as an integer
|
28
|
+
def device_fingerprint_type
|
29
|
+
@device_fingerprint_type&.to_i
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns profile_action_type as an integer
|
33
|
+
def profile_action_type
|
34
|
+
@profile_action_type&.to_i
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns profile_current_status as an integer
|
38
|
+
def profile_current_status
|
39
|
+
@profile_current_status&.to_i
|
40
|
+
end
|
41
|
+
|
42
|
+
# Returns industry_type as an integer
|
43
|
+
def industry_type
|
44
|
+
@industry_type&.to_i
|
45
|
+
end
|
46
|
+
|
47
|
+
protected
|
48
|
+
|
49
|
+
# Sets the request field validations
|
50
|
+
def init_field_validations # rubocop:disable Metrics/MethodLength
|
51
|
+
super
|
52
|
+
|
53
|
+
required_fields.push *%i[
|
54
|
+
customer_information_structure
|
55
|
+
customer_unique_id
|
56
|
+
customer_registration_date
|
57
|
+
customer_registration_ip_address
|
58
|
+
] + customer_information_required_fields
|
59
|
+
|
60
|
+
field_values.merge! device_fingerprint_type: [1, 2, 3],
|
61
|
+
profile_action_type: [1, 2],
|
62
|
+
profile_current_status: [0, 1, 2, 3],
|
63
|
+
industry_type: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
64
|
+
field_values.merge! customer_information_required_field_values
|
65
|
+
end
|
66
|
+
|
67
|
+
# Defines the request structure
|
68
|
+
def request_structure # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
69
|
+
{
|
70
|
+
session_id: session_id,
|
71
|
+
customer_username: customer_username,
|
72
|
+
customer_unique_id: customer_unique_id,
|
73
|
+
customer_registration_date: customer_registration_date,
|
74
|
+
customer_registration_ip_address: customer_registration_ip_address,
|
75
|
+
customer_registration_device_id: customer_registration_device_id,
|
76
|
+
customer_information: customer_information_structure,
|
77
|
+
third_party_device_id: third_party_device_id,
|
78
|
+
device_fingerprint: device_fingerprint,
|
79
|
+
device_fingerprint_type: device_fingerprint_type,
|
80
|
+
profile_action_type: profile_action_type,
|
81
|
+
profile_current_status: profile_current_status,
|
82
|
+
bonus_code: bonus_code,
|
83
|
+
bonus_submission_date: bonus_submission_date,
|
84
|
+
bonus_amount: bonus_amount,
|
85
|
+
merchant_website: merchant_website,
|
86
|
+
industry_type: industry_type,
|
87
|
+
how_did_you_hear: how_did_you_hear,
|
88
|
+
affiliate_id: affiliate_id,
|
89
|
+
rule_context: rule_context
|
90
|
+
}
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/externally_processed'
|
2
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/processing_type'
|
3
|
+
|
4
|
+
module GenesisRuby
|
5
|
+
module Api
|
6
|
+
module Requests
|
7
|
+
module NonFinancial
|
8
|
+
module ProcessedTransactions
|
9
|
+
# Date range based processed transaction retrieval allows you to fetch information for
|
10
|
+
# all processed transactions for a given merchant within a given date range.
|
11
|
+
class DateRange < Request
|
12
|
+
|
13
|
+
include Api::Mixins::Requests::NonFinancial::DateAttributes
|
14
|
+
include Api::Mixins::Requests::NonFinancial::PagingAttributes
|
15
|
+
|
16
|
+
attr_accessor :externally_processed, :processing_type
|
17
|
+
|
18
|
+
# Start of the requested date range
|
19
|
+
def start_date
|
20
|
+
@start_date&.strftime GenesisRuby::Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
21
|
+
end
|
22
|
+
|
23
|
+
# End of the requested date range
|
24
|
+
def end_date
|
25
|
+
@end_date&.strftime GenesisRuby::Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
26
|
+
end
|
27
|
+
|
28
|
+
protected
|
29
|
+
|
30
|
+
# Processed Transactions API DateRange request configuration
|
31
|
+
def init_configuration
|
32
|
+
init_xml_configuration
|
33
|
+
@api_config.parser_skip_root_node = false
|
34
|
+
|
35
|
+
init_api_gateway_configuration request_path: 'processed_transactions/by_date', include_token: false
|
36
|
+
end
|
37
|
+
|
38
|
+
# Processed Transactions API DateRange field validations
|
39
|
+
def init_field_validations
|
40
|
+
super
|
41
|
+
|
42
|
+
required_fields.push *%i[start_date]
|
43
|
+
field_values.merge! externally_processed: Constants::Transactions::Parameters::NonFinancial::
|
44
|
+
ExternallyProcessed.all,
|
45
|
+
processing_type: Constants::Transactions::Parameters::NonFinancial::
|
46
|
+
ProcessingType.all
|
47
|
+
end
|
48
|
+
|
49
|
+
# Processed Transactions API DateRange request structure
|
50
|
+
def populate_structure
|
51
|
+
@tree_structure = {
|
52
|
+
processed_transaction_request: {
|
53
|
+
start_date: start_date,
|
54
|
+
end_date: end_date,
|
55
|
+
externally_processed: externally_processed,
|
56
|
+
processing_type: processing_type,
|
57
|
+
page: page,
|
58
|
+
per_page: per_page
|
59
|
+
}
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/externally_processed'
|
2
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/processing_type'
|
3
|
+
|
4
|
+
module GenesisRuby
|
5
|
+
module Api
|
6
|
+
module Requests
|
7
|
+
module NonFinancial
|
8
|
+
module ProcessedTransactions
|
9
|
+
# Post Date range based processed transaction retrieval allows you to fetch information for
|
10
|
+
# all processed transactions for a given merchant within a given post date range.
|
11
|
+
class PostDateRange < Request
|
12
|
+
|
13
|
+
include Api::Mixins::Requests::NonFinancial::DateAttributes
|
14
|
+
include Api::Mixins::Requests::NonFinancial::PagingAttributes
|
15
|
+
|
16
|
+
attr_accessor :batch_number, :batch_slip_number, :deposit_slip_number, :externally_processed,
|
17
|
+
:processing_type
|
18
|
+
|
19
|
+
# Start of the requested date range
|
20
|
+
def start_date
|
21
|
+
@start_date&.strftime GenesisRuby::Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
22
|
+
end
|
23
|
+
|
24
|
+
# End of the requested date range
|
25
|
+
def end_date
|
26
|
+
@end_date&.strftime GenesisRuby::Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
27
|
+
end
|
28
|
+
|
29
|
+
protected
|
30
|
+
|
31
|
+
# Processed Transactions API DateRange request configuration
|
32
|
+
def init_configuration
|
33
|
+
init_xml_configuration
|
34
|
+
@api_config.parser_skip_root_node = false
|
35
|
+
|
36
|
+
init_api_gateway_configuration request_path: 'processed_transactions/by_post_date', include_token: false
|
37
|
+
end
|
38
|
+
|
39
|
+
# Processed Transactions API DateRange field validations
|
40
|
+
def init_field_validations
|
41
|
+
super
|
42
|
+
|
43
|
+
required_fields.push *%i[start_date]
|
44
|
+
field_values.merge! externally_processed: Constants::Transactions::Parameters::NonFinancial::
|
45
|
+
ExternallyProcessed.all,
|
46
|
+
processing_type: Constants::Transactions::Parameters::NonFinancial::
|
47
|
+
ProcessingType.all
|
48
|
+
end
|
49
|
+
|
50
|
+
# Processed Transactions API DateRange request structure
|
51
|
+
def populate_structure # rubocop:disable Metrics/MethodLength
|
52
|
+
@tree_structure = {
|
53
|
+
processed_transaction_request: {
|
54
|
+
start_date: start_date,
|
55
|
+
end_date: end_date,
|
56
|
+
batch_number: batch_number,
|
57
|
+
batch_slip_number: batch_slip_number,
|
58
|
+
deposit_slip_number: deposit_slip_number,
|
59
|
+
externally_processed: externally_processed,
|
60
|
+
processing_type: processing_type,
|
61
|
+
page: page,
|
62
|
+
per_page: per_page
|
63
|
+
}
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module NonFinancial
|
5
|
+
module ProcessedTransactions
|
6
|
+
# Single processed transaction retrieval allows to get a certain processed transaction by
|
7
|
+
# its ARN or by passing its unique ID.
|
8
|
+
class Transaction < Request
|
9
|
+
|
10
|
+
attr_accessor :arn, :unique_id
|
11
|
+
|
12
|
+
protected
|
13
|
+
|
14
|
+
# Processed Transactions API Transaction request configuration
|
15
|
+
def init_configuration
|
16
|
+
init_xml_configuration
|
17
|
+
|
18
|
+
init_api_gateway_configuration request_path: 'processed_transactions', include_token: false
|
19
|
+
end
|
20
|
+
|
21
|
+
# Processed Transactions API Transaction custom validations
|
22
|
+
def check_requirements
|
23
|
+
unless arn.nil? ^ unique_id.nil?
|
24
|
+
raise(
|
25
|
+
ParameterError,
|
26
|
+
'Either ARN or unique ID field has to be set, not both'
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
super
|
31
|
+
end
|
32
|
+
|
33
|
+
# Processed Transactions API Transaction request structure
|
34
|
+
def populate_structure
|
35
|
+
@tree_structure = {
|
36
|
+
processed_transaction_request: {
|
37
|
+
arn: arn,
|
38
|
+
unique_id: unique_id
|
39
|
+
}
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/sca_exemptions'
|
2
|
+
|
3
|
+
module GenesisRuby
|
4
|
+
module Api
|
5
|
+
module Requests
|
6
|
+
module NonFinancial
|
7
|
+
module Sca
|
8
|
+
# SCA Checker call is used for the determination whether SCA is required
|
9
|
+
class Checker < Base::Versioned
|
10
|
+
|
11
|
+
include Api::Mixins::Requests::Financial::MotoAttributes
|
12
|
+
|
13
|
+
attr_reader :mit, :card_number
|
14
|
+
attr_accessor :transaction_amount, :transaction_currency, :recurring_type, :transaction_exemption
|
15
|
+
|
16
|
+
# SCA Checker constructor
|
17
|
+
def initialize(configuration, _builder_interface = nil)
|
18
|
+
super configuration
|
19
|
+
|
20
|
+
self.request_path = "sca/checker/#{configuration.token}"
|
21
|
+
end
|
22
|
+
|
23
|
+
# Full card number or first 6 digits
|
24
|
+
def card_number=(value)
|
25
|
+
unless value.nil? || value.to_s =~ /\A\d{6,16}\Z/
|
26
|
+
raise(
|
27
|
+
InvalidArgumentError,
|
28
|
+
'Invalid value for card_number. Allowed only digits with min length 6 and max length 16'
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
@card_number = value.to_s
|
33
|
+
end
|
34
|
+
|
35
|
+
# Signifies whether a MIT (merchant initiated transaction) is performed
|
36
|
+
def mit=(value)
|
37
|
+
allowed_options attribute: __method__,
|
38
|
+
value: value,
|
39
|
+
allowed: [true, false],
|
40
|
+
allow_empty: true,
|
41
|
+
error_message: 'Accepts only boolean values'
|
42
|
+
end
|
43
|
+
|
44
|
+
protected
|
45
|
+
|
46
|
+
# SCA Checker field validations
|
47
|
+
def init_field_validations
|
48
|
+
super
|
49
|
+
|
50
|
+
required_fields.push *%i[card_number transaction_amount transaction_currency]
|
51
|
+
field_values.merge! transaction_currency: Constants::Currencies::Iso4217.all.map(&:upcase),
|
52
|
+
recurring_type: [Constants::Transactions::Parameters::Recurring::Types::
|
53
|
+
INITIAL,
|
54
|
+
Constants::Transactions::Parameters::Recurring::Types::
|
55
|
+
SUBSEQUENT],
|
56
|
+
transaction_exemption: Constants::Transactions::Parameters::ScaExemptions.all
|
57
|
+
end
|
58
|
+
|
59
|
+
# SCA Checker request structure
|
60
|
+
def request_structure
|
61
|
+
{
|
62
|
+
card_number: card_number,
|
63
|
+
transaction_amount: transform_amount(transaction_amount, transaction_currency).to_i,
|
64
|
+
transaction_currency: transaction_currency,
|
65
|
+
moto: moto,
|
66
|
+
mit: mit,
|
67
|
+
recurring_type: recurring_type,
|
68
|
+
transaction_exemption: transaction_exemption
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module NonFinancial
|
5
|
+
module Tokenization
|
6
|
+
# Get cryptogram on behalf of a token that will be used for the authorization
|
7
|
+
class Cryptogram < Base::Versioned
|
8
|
+
|
9
|
+
include Api::Mixins::Requests::NonFinancial::Tokenization::TokenAttributes
|
10
|
+
include Api::Mixins::Requests::NonFinancial::Tokenization::TokenizationAttributes
|
11
|
+
|
12
|
+
attr_accessor :transaction_reference
|
13
|
+
|
14
|
+
def initialize(configuration, builder_interface = Builder::XML)
|
15
|
+
super configuration, builder_interface
|
16
|
+
|
17
|
+
self.request_path = 'cryptogram'
|
18
|
+
end
|
19
|
+
|
20
|
+
protected
|
21
|
+
|
22
|
+
# Cryptogram field validations
|
23
|
+
def init_field_validations
|
24
|
+
super
|
25
|
+
|
26
|
+
required_fields.push *tokenization_required_fields, *%i[token transaction_reference]
|
27
|
+
end
|
28
|
+
|
29
|
+
# API Request structure
|
30
|
+
def request_structure
|
31
|
+
{
|
32
|
+
cryptogram_request: tokenization_attributes_structure.merge(
|
33
|
+
{
|
34
|
+
token: token,
|
35
|
+
transaction_reference: transaction_reference
|
36
|
+
}
|
37
|
+
)
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module NonFinancial
|
5
|
+
module Tokenization
|
6
|
+
# Deletes a token
|
7
|
+
class DeleteToken < Base::Versioned
|
8
|
+
|
9
|
+
include Api::Mixins::Requests::NonFinancial::Tokenization::TokenAttributes
|
10
|
+
include Api::Mixins::Requests::NonFinancial::Tokenization::TokenizationAttributes
|
11
|
+
|
12
|
+
def initialize(configuration, builder_interface = Builder::XML)
|
13
|
+
super configuration, builder_interface
|
14
|
+
|
15
|
+
self.request_path = 'delete_token'
|
16
|
+
end
|
17
|
+
|
18
|
+
protected
|
19
|
+
|
20
|
+
# Delete Token field validations
|
21
|
+
def init_field_validations
|
22
|
+
super
|
23
|
+
|
24
|
+
required_fields.push *tokenization_required_fields, *%i[token]
|
25
|
+
end
|
26
|
+
|
27
|
+
# API Request structure
|
28
|
+
def request_structure
|
29
|
+
{
|
30
|
+
delete_token_request: tokenization_attributes_structure.merge(
|
31
|
+
{
|
32
|
+
token: token
|
33
|
+
}
|
34
|
+
)
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|