genesis_ruby 0.1.7 → 0.1.9
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 +41 -0
- data/Gemfile.lock +45 -39
- data/README.md +246 -0
- data/VERSION +1 -1
- data/lib/genesis_ruby/api/constants/transactions/parameters/cash_payments/company_types.rb +45 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/cash_payments/genders.rb +27 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/cash_payments/marital_statuses.rb +39 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/mobile/apple_pay/payment_subtypes.rb +29 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/mobile/google_pay/payment_subtypes.rb +29 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/online_banking/bank_code_currencies.rb +128 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/online_banking/bank_codes.rb +600 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/online_banking/payment_types.rb +36 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/wallets/pay_pal/payment_types.rb +31 -0
- data/lib/genesis_ruby/api/mixins/requests/attribute_validation.rb +138 -4
- data/lib/genesis_ruby/api/mixins/requests/birth_date_attributes.rb +22 -0
- data/lib/genesis_ruby/api/mixins/requests/customer_address/billing_info_attributes.rb +11 -10
- data/lib/genesis_ruby/api/mixins/requests/customer_address/customer_info_attributes.rb +1 -1
- data/lib/genesis_ruby/api/mixins/requests/customer_address/shipping_info_attributes.rb +11 -10
- data/lib/genesis_ruby/api/mixins/requests/financial/cards/credit_card_attributes.rb +7 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/cards/recurring/managed_recurring_attributes.rb +21 -20
- data/lib/genesis_ruby/api/mixins/requests/financial/cards/recurring/managed_recurring_indian_card_attributes.rb +15 -39
- data/lib/genesis_ruby/api/mixins/requests/financial/cards/recurring/recurring_type_attributes.rb +15 -9
- data/lib/genesis_ruby/api/mixins/requests/financial/cards/tokenization_attributes.rb +9 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/consumer_identifier_attributes.rb +26 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/mobile/apple_pay_token_attributes.rb +51 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/mobile/google_pay_token_attributes.rb +50 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/online_banking_payments/virtual_payment_address_attributes.rb +27 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/browser.rb +11 -22
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/card_holder_account.rb +81 -49
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/common_attributes.rb +23 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/control.rb +13 -26
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/merchant_risk.rb +21 -58
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/purchase.rb +8 -11
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/sdk.rb +10 -10
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/version2/wpf_attributes.rb +9 -0
- data/lib/genesis_ruby/api/request.rb +4 -2
- data/lib/genesis_ruby/api/requests/base/financials/credit_card.rb +6 -4
- data/lib/genesis_ruby/api/requests/base/financials/south_american_payments.rb +59 -0
- data/lib/genesis_ruby/api/requests/base/reference.rb +3 -2
- data/lib/genesis_ruby/api/requests/financial/cards/argencard.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cards/aura.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cards/authorize.rb +10 -2
- data/lib/genesis_ruby/api/requests/financial/cards/authorize3d.rb +19 -10
- data/lib/genesis_ruby/api/requests/financial/cards/cabal.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cards/cencosud.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cards/elo.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cards/naranja.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cards/nativa.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cards/sale.rb +10 -2
- data/lib/genesis_ruby/api/requests/financial/cards/sale3d.rb +19 -10
- data/lib/genesis_ruby/api/requests/financial/cards/tarjeta_shopping.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cards/threeds/v2/method_continue.rb +2 -2
- data/lib/genesis_ruby/api/requests/financial/cash_payments/baloto.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cash_payments/banco_de_occidente.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cash_payments/boleto.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cash_payments/efecty.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cash_payments/oxxo.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cash_payments/pago_facil.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/cash_payments/pix.rb +92 -0
- data/lib/genesis_ruby/api/requests/financial/cash_payments/redpagos.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/mobile/apple_pay.rb +91 -0
- data/lib/genesis_ruby/api/requests/financial/mobile/google_pay.rb +108 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/bancomer.rb +33 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/bradesco.rb +33 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/davivienda.rb +34 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/itau.rb +33 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/online_banking/pay_in.rb +157 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/pse.rb +33 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/rapi_pago.rb +33 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/santander.rb +33 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/webpay.rb +33 -0
- data/lib/genesis_ruby/api/requests/financial/void.rb +2 -2
- data/lib/genesis_ruby/api/requests/financial/wallets/pay_pay.rb +65 -0
- data/lib/genesis_ruby/api/requests/non_financial/reconcile/date_range.rb +2 -2
- data/lib/genesis_ruby/api/requests/wpf/create.rb +11 -15
- data/lib/genesis_ruby/api/requests/wpf/reconcile.rb +2 -2
- data/lib/genesis_ruby/dependencies.rb +1 -0
- data/lib/genesis_ruby/utils/common.rb +26 -0
- data/lib/genesis_ruby/version.rb +1 -1
- metadata +46 -3
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module Cards
|
|
6
|
+
# Aura is a local Brazilian credit card.
|
|
7
|
+
class Aura < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Aura transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::AURA
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed Billing Countries for Aura transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(BR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -32,8 +32,16 @@ module GenesisRuby
|
|
|
32
32
|
GenesisRuby::Api::Constants::Transactions::AUTHORIZE
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
# Request Field validations
|
|
36
|
+
def init_field_validations
|
|
37
|
+
super
|
|
38
|
+
|
|
39
|
+
field_values.merge! managed_recurring_field_values, recurring_type_field_values_validation_structure
|
|
40
|
+
|
|
41
|
+
field_value_dependencies.merge! required_tokenization_fields_conditional, required_cc_fields_conditional,
|
|
42
|
+
required_recurring_managed_type_field_conditional
|
|
43
|
+
|
|
44
|
+
return unless recurring_type == Constants::Transactions::Parameters::Recurring::Types::SUBSEQUENT
|
|
37
45
|
|
|
38
46
|
self.required_fields = recurring_type_subsequent_required_request_attributes
|
|
39
47
|
end
|
|
@@ -28,16 +28,6 @@ module GenesisRuby
|
|
|
28
28
|
include Mixins::Requests::Financial::Threeds::Version2::CommonAttributes
|
|
29
29
|
include Mixins::Requests::Financial::TravelData::TravelAttributes
|
|
30
30
|
|
|
31
|
-
# Specifies the recurring type of transaction
|
|
32
|
-
def recurring_type=(value)
|
|
33
|
-
allowed_values = [
|
|
34
|
-
GenesisRuby::Api::Constants::Transactions::Parameters::Recurring::Types::INITIAL,
|
|
35
|
-
GenesisRuby::Api::Constants::Transactions::Parameters::Recurring::Types::MANAGED
|
|
36
|
-
]
|
|
37
|
-
|
|
38
|
-
allowed_options attribute: __method__, allowed: allowed_values, value: value, allow_empty: true
|
|
39
|
-
end
|
|
40
|
-
|
|
41
31
|
protected
|
|
42
32
|
|
|
43
33
|
# Authorize 3D Transaction Type
|
|
@@ -45,6 +35,25 @@ module GenesisRuby
|
|
|
45
35
|
GenesisRuby::Api::Constants::Transactions::AUTHORIZE_3D
|
|
46
36
|
end
|
|
47
37
|
|
|
38
|
+
# Request Field validations
|
|
39
|
+
def init_field_validations
|
|
40
|
+
super
|
|
41
|
+
|
|
42
|
+
field_values.merge! managed_recurring_field_values,
|
|
43
|
+
recurring_type_initial_field_values_validation_structure, threeds_field_validations
|
|
44
|
+
|
|
45
|
+
field_value_dependencies.merge! required_tokenization_fields_conditional, required_cc_fields_conditional,
|
|
46
|
+
required_recurring_managed_type_field_conditional,
|
|
47
|
+
threeds_field_conditional_validations
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Special validations upon document building
|
|
51
|
+
def check_requirements
|
|
52
|
+
validate_threeds_card_holder_dates
|
|
53
|
+
|
|
54
|
+
super
|
|
55
|
+
end
|
|
56
|
+
|
|
48
57
|
# Authorize 3D transaction request parameters
|
|
49
58
|
def payment_transaction_structure # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
|
50
59
|
super.merge(
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module Cards
|
|
6
|
+
# Cabal is a local debit/credit card brand in Argentina which can be used for online purchases.
|
|
7
|
+
class Cabal < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Cabal transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::CABAL
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for Cabal transaction type
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(AR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module Cards
|
|
6
|
+
# Cencosud is a local credit card in Argentina
|
|
7
|
+
class Cencosud < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Cencosud transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::CENCOSUD
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for Cencosud transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(AR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module Cards
|
|
6
|
+
# Elo is a local Brazilian payment card.
|
|
7
|
+
class Elo < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Elo transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::ELO
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for Elo transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(BR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module Cards
|
|
6
|
+
# Naranja is a local credit card issued in Argentina which can be used for purchases over the internet.
|
|
7
|
+
class Naranja < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Naranja transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::NARANJA
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for Naranja transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(AR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module Cards
|
|
6
|
+
# Nativa is an Argentinian credit card provided by the National Bank of Argentina.
|
|
7
|
+
class Nativa < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Nativa transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::NATIVA
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for Nativa transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(AR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -31,8 +31,16 @@ module GenesisRuby
|
|
|
31
31
|
GenesisRuby::Api::Constants::Transactions::SALE
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
# Request Field validations
|
|
35
|
+
def init_field_validations
|
|
36
|
+
super
|
|
37
|
+
|
|
38
|
+
field_values.merge! managed_recurring_field_values, recurring_type_field_values_validation_structure
|
|
39
|
+
|
|
40
|
+
field_value_dependencies.merge! required_tokenization_fields_conditional, required_cc_fields_conditional,
|
|
41
|
+
required_recurring_managed_type_field_conditional
|
|
42
|
+
|
|
43
|
+
return unless recurring_type == Constants::Transactions::Parameters::Recurring::Types::SUBSEQUENT
|
|
36
44
|
|
|
37
45
|
self.required_fields = recurring_type_subsequent_required_request_attributes
|
|
38
46
|
end
|
|
@@ -27,16 +27,6 @@ module GenesisRuby
|
|
|
27
27
|
include Mixins::Requests::Financial::Threeds::Version2::CommonAttributes
|
|
28
28
|
include Mixins::Requests::Financial::TravelData::TravelAttributes
|
|
29
29
|
|
|
30
|
-
# Specifies the recurring type of transaction
|
|
31
|
-
def recurring_type=(value)
|
|
32
|
-
allowed_values = [
|
|
33
|
-
GenesisRuby::Api::Constants::Transactions::Parameters::Recurring::Types::INITIAL,
|
|
34
|
-
GenesisRuby::Api::Constants::Transactions::Parameters::Recurring::Types::MANAGED
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
allowed_options attribute: __method__, allowed: allowed_values, value: value, allow_empty: true
|
|
38
|
-
end
|
|
39
|
-
|
|
40
30
|
protected
|
|
41
31
|
|
|
42
32
|
# Sale 3D Transaction Type
|
|
@@ -44,6 +34,25 @@ module GenesisRuby
|
|
|
44
34
|
GenesisRuby::Api::Constants::Transactions::SALE_3D
|
|
45
35
|
end
|
|
46
36
|
|
|
37
|
+
# Request Field validations
|
|
38
|
+
def init_field_validations
|
|
39
|
+
super
|
|
40
|
+
|
|
41
|
+
field_values.merge! managed_recurring_field_values,
|
|
42
|
+
recurring_type_initial_field_values_validation_structure, threeds_field_validations
|
|
43
|
+
|
|
44
|
+
field_value_dependencies.merge! required_tokenization_fields_conditional, required_cc_fields_conditional,
|
|
45
|
+
required_recurring_managed_type_field_conditional,
|
|
46
|
+
threeds_field_conditional_validations
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Special validations upon document building
|
|
50
|
+
def check_requirements
|
|
51
|
+
validate_threeds_card_holder_dates
|
|
52
|
+
|
|
53
|
+
super
|
|
54
|
+
end
|
|
55
|
+
|
|
47
56
|
# Sale 3D transaction request parameters
|
|
48
57
|
def payment_transaction_structure # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
|
49
58
|
super.merge(
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module Cards
|
|
6
|
+
# Tarjeta Shopping is a cash payment in Argentina
|
|
7
|
+
class TarjetaShopping < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Tarjeta Shopping transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::TARJETA_SHOPPING
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for Tarjeta Shopping transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(AR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -104,8 +104,8 @@ module GenesisRuby
|
|
|
104
104
|
init_api_gateway_configuration request_path: 'threeds/threeds_method/:unique_id', include_token: false
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
-
def
|
|
108
|
-
|
|
107
|
+
def init_field_validations
|
|
108
|
+
required_fields.push *%i[amount transaction_timestamp]
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
# Build correct endpoint url during runtime
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module CashPayments
|
|
6
|
+
# Baloto is a cash payment option in Colombia.
|
|
7
|
+
class Baloto < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Baloto transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::BALOTO
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Baloto allowed billing countries
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(CO)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module CashPayments
|
|
6
|
+
# Banco de Occidente is a cash payment method for Colombia
|
|
7
|
+
class BancoDeOccidente < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Banco de Occidente transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::BANCO_DE_OCCIDENTE
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Banco de Occidente allowed billing countries
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(CO)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module CashPayments
|
|
6
|
+
# Boleto is a payment service in Brazil
|
|
7
|
+
class Boleto < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Boleto transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::BOLETO
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing country for Boleto transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(BR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module CashPayments
|
|
6
|
+
# Efecty is a cash-based payment method.
|
|
7
|
+
class Efecty < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Efecty transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::EFECTY
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for Efecty transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(CO)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module CashPayments
|
|
6
|
+
# OXXO is the preferred payment method in Mexico
|
|
7
|
+
class Oxxo < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# OXXO transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::OXXO
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for OXXO transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(MX)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module CashPayments
|
|
6
|
+
# Pago Facil is a cash-based payment used for online purchases
|
|
7
|
+
class PagoFacil < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# PagoFacil transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::PAGO_FACIL
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for PagoFacil transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(AR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
require 'genesis_ruby/api/constants/transactions/parameters/cash_payments/genders'
|
|
2
|
+
require 'genesis_ruby/api/constants/transactions/parameters/cash_payments/marital_statuses'
|
|
3
|
+
require 'genesis_ruby/api/constants/transactions/parameters/cash_payments/company_types'
|
|
4
|
+
|
|
5
|
+
module GenesisRuby
|
|
6
|
+
module Api
|
|
7
|
+
module Requests
|
|
8
|
+
module Financial
|
|
9
|
+
module CashPayments
|
|
10
|
+
# Pix is a payment service, which represents a new way of receiving/sending money.
|
|
11
|
+
# Pix allows payments to be made instantly.
|
|
12
|
+
class Pix < Requests::Base::Financial
|
|
13
|
+
|
|
14
|
+
include Api::Mixins::Requests::AddressInfoAttributes
|
|
15
|
+
include Api::Mixins::Requests::BirthDateAttributes
|
|
16
|
+
include Api::Mixins::Requests::DocumentAttributes
|
|
17
|
+
include Api::Mixins::Requests::Financial::AsyncAttributes
|
|
18
|
+
include Api::Mixins::Requests::Financial::PaymentAttributes
|
|
19
|
+
include Api::Mixins::Requests::Financial::PendingPaymentAttributes
|
|
20
|
+
|
|
21
|
+
attr_accessor :gender, :marital_status, :sender_occupation, :nationality, :country_of_origin, :birth_city,
|
|
22
|
+
:birth_state, :company_type, :company_activity, :mothers_name
|
|
23
|
+
|
|
24
|
+
# Billing Country custom accessor
|
|
25
|
+
def billing_country
|
|
26
|
+
return nil unless @billing_country
|
|
27
|
+
|
|
28
|
+
@billing_country.to_s.upcase
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Incorporation date
|
|
32
|
+
def incorporation_date
|
|
33
|
+
@incorporation_date&.strftime GenesisRuby::Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Incorporation date
|
|
37
|
+
def incorporation_date=(value)
|
|
38
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
protected
|
|
42
|
+
|
|
43
|
+
# Pix transaction type
|
|
44
|
+
def transaction_type
|
|
45
|
+
Api::Constants::Transactions::PIX
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def init_field_validations
|
|
49
|
+
super
|
|
50
|
+
|
|
51
|
+
required_fields.push *%i[transaction_id amount currency document_id]
|
|
52
|
+
|
|
53
|
+
field_values.merge! currency: Api::Constants::Currencies::Iso4217.all.map(&:upcase),
|
|
54
|
+
billing_country: %w(BR),
|
|
55
|
+
gender: Api::Constants::Transactions::Parameters::CashPayments::Genders.all,
|
|
56
|
+
marital_status: Api::Constants::Transactions::Parameters::CashPayments::
|
|
57
|
+
MaritalStatuses.all,
|
|
58
|
+
company_type: Api::Constants::Transactions::Parameters::CashPayments::
|
|
59
|
+
CompanyTypes.all
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# PayPal request attributes structure
|
|
63
|
+
def payment_transaction_structure # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
64
|
+
payment_attributes_structure.merge(
|
|
65
|
+
{
|
|
66
|
+
return_success_url: return_success_url,
|
|
67
|
+
return_failure_url: return_failure_url,
|
|
68
|
+
return_pending_url: return_pending_url,
|
|
69
|
+
customer_email: customer_email,
|
|
70
|
+
document_id: document_id,
|
|
71
|
+
billing_address: billing_address_parameters_structure,
|
|
72
|
+
shipping_address: shipping_address_parameters_structure,
|
|
73
|
+
birth_date: birth_date,
|
|
74
|
+
gender: gender,
|
|
75
|
+
marital_status: marital_status,
|
|
76
|
+
sender_occupation: sender_occupation,
|
|
77
|
+
nationality: nationality,
|
|
78
|
+
country_of_origin: country_of_origin,
|
|
79
|
+
company_type: company_type,
|
|
80
|
+
company_activity: company_activity,
|
|
81
|
+
incorporation_date: incorporation_date,
|
|
82
|
+
mothers_name: mothers_name
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module GenesisRuby
|
|
2
|
+
module Api
|
|
3
|
+
module Requests
|
|
4
|
+
module Financial
|
|
5
|
+
module CashPayments
|
|
6
|
+
# Redpagos is a cash payment in Uruguay
|
|
7
|
+
class Redpagos < Base::Financials::SouthAmericanPayments
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
# Redpagos transaction type
|
|
12
|
+
def transaction_type
|
|
13
|
+
Api::Constants::Transactions::REDPAGOS
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Allowed billing countries for Redpagos transaction request
|
|
17
|
+
def allowed_billing_countries
|
|
18
|
+
%w(UY)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|