genesis_ruby 0.2.3 → 0.2.4
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 +40 -0
- data/Gemfile.lock +1 -1
- data/README.md +40 -0
- data/VERSION +1 -1
- 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/mixins/requests/financial/beneficiary_attributes.rb +38 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/customer_account_attributes.rb +21 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/online_banking_payments/payer_attributes.rb +65 -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/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 +5 -7
- data/lib/genesis_ruby/api/requests/base/financials/south_american_payments.rb +11 -14
- data/lib/genesis_ruby/api/requests/base/reference.rb +2 -1
- data/lib/genesis_ruby/api/requests/financial/cards/bancontact.rb +8 -9
- 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/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/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/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/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/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 +43 -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/dependencies.rb +1 -0
- data/lib/genesis_ruby/utils/formatters/response/formats/timestamp.rb +1 -1
- data/lib/genesis_ruby/version.rb +1 -1
- metadata +43 -2
@@ -10,7 +10,6 @@ module GenesisRuby
|
|
10
10
|
include Api::Mixins::Requests::CustomerAddress::BillingInfoAttributes
|
11
11
|
include Api::Mixins::Requests::CustomerAddress::ShippingInfoAttributes
|
12
12
|
include Api::Mixins::Requests::Financial::AsyncAttributes
|
13
|
-
include Api::Mixins::Requests::Financial::PaymentAttributes
|
14
13
|
|
15
14
|
protected
|
16
15
|
|
@@ -21,6 +20,8 @@ module GenesisRuby
|
|
21
20
|
|
22
21
|
# Bancontact field validations
|
23
22
|
def init_field_validations
|
23
|
+
super
|
24
|
+
|
24
25
|
required_fields.push *%i[transaction_id amount currency return_success_url return_failure_url
|
25
26
|
billing_country]
|
26
27
|
field_values.merge! currency: 'EUR',
|
@@ -29,14 +30,12 @@ module GenesisRuby
|
|
29
30
|
|
30
31
|
# Bancontact transaction structure
|
31
32
|
def payment_transaction_structure
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
)
|
33
|
+
{
|
34
|
+
return_success_url: return_success_url,
|
35
|
+
return_failure_url: return_failure_url,
|
36
|
+
billing_address: billing_address_parameters_structure,
|
37
|
+
shipping_address: shipping_address_parameters_structure
|
38
|
+
}
|
40
39
|
end
|
41
40
|
|
42
41
|
end
|
@@ -12,7 +12,6 @@ module GenesisRuby
|
|
12
12
|
include Api::Mixins::Requests::AddressInfoAttributes
|
13
13
|
include Api::Mixins::Requests::DocumentAttributes
|
14
14
|
include Api::Mixins::Requests::Financial::AsyncAttributes
|
15
|
-
include Api::Mixins::Requests::Financial::PaymentAttributes
|
16
15
|
|
17
16
|
attr_accessor :payment_type
|
18
17
|
|
@@ -25,6 +24,8 @@ module GenesisRuby
|
|
25
24
|
|
26
25
|
# Cash field validations
|
27
26
|
def init_field_validations
|
27
|
+
super
|
28
|
+
|
28
29
|
required_fields.push *%i[transaction_id return_success_url return_failure_url amount currency
|
29
30
|
payment_type document_id billing_country]
|
30
31
|
|
@@ -33,19 +34,17 @@ module GenesisRuby
|
|
33
34
|
end
|
34
35
|
|
35
36
|
# Cash request attributes structure
|
36
|
-
def payment_transaction_structure
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
}
|
48
|
-
)
|
37
|
+
def payment_transaction_structure
|
38
|
+
{
|
39
|
+
return_success_url: return_success_url,
|
40
|
+
return_failure_url: return_failure_url,
|
41
|
+
customer_email: customer_email,
|
42
|
+
customer_phone: customer_phone,
|
43
|
+
payment_type: payment_type,
|
44
|
+
document_id: document_id,
|
45
|
+
billing_address: billing_address_parameters_structure,
|
46
|
+
shipping_address: shipping_address_parameters_structure
|
47
|
+
}
|
49
48
|
end
|
50
49
|
|
51
50
|
end
|
@@ -15,8 +15,8 @@ module GenesisRuby
|
|
15
15
|
include Api::Mixins::Requests::BirthDateAttributes
|
16
16
|
include Api::Mixins::Requests::DocumentAttributes
|
17
17
|
include Api::Mixins::Requests::Financial::AsyncAttributes
|
18
|
+
include Api::Mixins::Requests::Financial::BeneficiaryAttributes
|
18
19
|
include Api::Mixins::Requests::Financial::OnlineBankingPayments::PixAttributes
|
19
|
-
include Api::Mixins::Requests::Financial::PaymentAttributes
|
20
20
|
include Api::Mixins::Requests::Financial::PendingPaymentAttributes
|
21
21
|
|
22
22
|
attr_accessor :gender, :marital_status, :sender_occupation, :nationality, :country_of_origin, :birth_city,
|
@@ -46,8 +46,7 @@ module GenesisRuby
|
|
46
46
|
|
47
47
|
required_fields.push *%i[transaction_id amount currency document_id]
|
48
48
|
|
49
|
-
field_values.merge!
|
50
|
-
billing_country: %w(BR),
|
49
|
+
field_values.merge! billing_country: %w(BR),
|
51
50
|
gender: Api::Constants::Transactions::Parameters::CashPayments::Genders.all,
|
52
51
|
marital_status: Api::Constants::Transactions::Parameters::CashPayments::
|
53
52
|
MaritalStatuses.all,
|
@@ -56,28 +55,27 @@ module GenesisRuby
|
|
56
55
|
end
|
57
56
|
|
58
57
|
# PayPal request attributes structure
|
59
|
-
def payment_transaction_structure # rubocop:disable Metrics/
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
)
|
58
|
+
def payment_transaction_structure # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
59
|
+
{
|
60
|
+
return_success_url: return_success_url,
|
61
|
+
return_failure_url: return_failure_url,
|
62
|
+
return_pending_url: return_pending_url,
|
63
|
+
customer_email: customer_email,
|
64
|
+
document_id: document_id,
|
65
|
+
billing_address: billing_address_parameters_structure,
|
66
|
+
shipping_address: shipping_address_parameters_structure,
|
67
|
+
birth_date: birth_date,
|
68
|
+
gender: gender,
|
69
|
+
marital_status: marital_status,
|
70
|
+
sender_occupation: sender_occupation,
|
71
|
+
nationality: nationality,
|
72
|
+
country_of_origin: country_of_origin,
|
73
|
+
company_type: company_type,
|
74
|
+
company_activity: company_activity,
|
75
|
+
incorporation_date: incorporation_date,
|
76
|
+
mothers_name: mothers_name,
|
77
|
+
beneficiary: beneficiary_parameters_structure
|
78
|
+
}
|
81
79
|
end
|
82
80
|
|
83
81
|
end
|
@@ -17,7 +17,6 @@ module GenesisRuby
|
|
17
17
|
include Mixins::Requests::Financial::DynamicDescriptorAttributes
|
18
18
|
include Mixins::Requests::Financial::FundingAttributes
|
19
19
|
include Mixins::Requests::Financial::Mobile::ApplePayTokenAttributes
|
20
|
-
include Mixins::Requests::Financial::PaymentAttributes
|
21
20
|
|
22
21
|
attr_accessor :payment_subtype
|
23
22
|
|
@@ -36,12 +35,13 @@ module GenesisRuby
|
|
36
35
|
end
|
37
36
|
|
38
37
|
def init_field_validations
|
38
|
+
super
|
39
|
+
|
39
40
|
required_fields.push *%i[transaction_id payment_subtype token_version token_data token_signature
|
40
41
|
token_ephemeral_public_key token_public_key_hash token_transaction_id token_display_name token_network
|
41
42
|
token_type token_transaction_identifier amount currency]
|
42
43
|
|
43
|
-
field_values.merge!
|
44
|
-
payment_subtype: Api::Constants::Transactions::Parameters::Mobile::ApplePay::
|
44
|
+
field_values.merge! payment_subtype: Api::Constants::Transactions::Parameters::Mobile::ApplePay::
|
45
45
|
PaymentSubtypes.all,
|
46
46
|
recurring_type: [Api::Constants::Transactions::Parameters::Recurring::Types::INITIAL]
|
47
47
|
field_values.merge! funding_attributes_field_validations
|
@@ -49,23 +49,21 @@ module GenesisRuby
|
|
49
49
|
|
50
50
|
# Apple Pay payment transaction structure
|
51
51
|
def payment_transaction_structure # rubocop:disable Metrics/MethodLength
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
}
|
68
|
-
)
|
52
|
+
{
|
53
|
+
payment_subtype: payment_subtype,
|
54
|
+
payment_token: payment_token_structure,
|
55
|
+
customer_email: customer_email,
|
56
|
+
customer_phone: customer_phone,
|
57
|
+
birth_date: birth_date,
|
58
|
+
billing_address: billing_address_parameters_structure,
|
59
|
+
shipping_address: shipping_address_parameters_structure,
|
60
|
+
document_id: document_id,
|
61
|
+
crypto: crypto,
|
62
|
+
recurring_type: recurring_type,
|
63
|
+
business_attributes: business_attributes_structure,
|
64
|
+
dynamic_descriptor_params: dynamic_descriptor_structure,
|
65
|
+
funding: funding_attributes_structure
|
66
|
+
}
|
69
67
|
end
|
70
68
|
|
71
69
|
private
|
@@ -20,7 +20,6 @@ module GenesisRuby
|
|
20
20
|
include Mixins::Requests::Financial::FundingAttributes
|
21
21
|
include Mixins::Requests::Financial::Mobile::GooglePayTokenAttributes
|
22
22
|
include Mixins::Requests::Financial::NotificationAttributes
|
23
|
-
include Mixins::Requests::Financial::PaymentAttributes
|
24
23
|
include Mixins::Requests::Financial::Threeds::Version2::CommonAttributes
|
25
24
|
|
26
25
|
# Define a payment token from a JSON string
|
@@ -44,8 +43,7 @@ module GenesisRuby
|
|
44
43
|
required_fields.push *%i[transaction_id payment_subtype amount currency token_signature token_signed_key
|
45
44
|
token_signatures token_protocol_version token_signed_message]
|
46
45
|
|
47
|
-
field_values.merge!
|
48
|
-
payment_subtype: Constants::Transactions::Parameters::Mobile::GooglePay::
|
46
|
+
field_values.merge! payment_subtype: Constants::Transactions::Parameters::Mobile::GooglePay::
|
49
47
|
PaymentSubtypes.all,
|
50
48
|
recurring_type: [Api::Constants::Transactions::Parameters::Recurring::Types::INITIAL]
|
51
49
|
field_values.merge! threeds_field_validations, funding_attributes_field_validations
|
@@ -61,27 +59,25 @@ module GenesisRuby
|
|
61
59
|
end
|
62
60
|
|
63
61
|
# Google Pay Payment Transaction Structure
|
64
|
-
def payment_transaction_structure # rubocop:disable Metrics/MethodLength
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
}
|
84
|
-
)
|
62
|
+
def payment_transaction_structure # rubocop:disable Metrics/MethodLength
|
63
|
+
{
|
64
|
+
payment_subtype: payment_subtype,
|
65
|
+
payment_token: google_pay_token_structure,
|
66
|
+
customer_email: customer_email,
|
67
|
+
customer_phone: customer_phone,
|
68
|
+
birth_date: birth_date,
|
69
|
+
notification_url: notification_url,
|
70
|
+
return_success_url: return_success_url,
|
71
|
+
return_failure_url: return_failure_url,
|
72
|
+
billing_address: billing_address_parameters_structure,
|
73
|
+
shipping_address: shipping_address_parameters_structure,
|
74
|
+
business_attributes: business_attributes_structure,
|
75
|
+
dynamic_descriptor_params: dynamic_descriptor_structure,
|
76
|
+
document_id: document_id,
|
77
|
+
recurring_type: recurring_type,
|
78
|
+
threeds_v2_params: threeds_v2_common_attributes_structure,
|
79
|
+
funding: funding_attributes_structure
|
80
|
+
}
|
85
81
|
end
|
86
82
|
|
87
83
|
private
|
@@ -10,7 +10,6 @@ module GenesisRuby
|
|
10
10
|
include Api::Mixins::Requests::Financial::AsyncAttributes
|
11
11
|
include Api::Mixins::Requests::Financial::PendingPaymentAttributes
|
12
12
|
include Api::Mixins::Requests::BirthDateAttributes
|
13
|
-
include Api::Mixins::Requests::Financial::PaymentAttributes
|
14
13
|
include Api::Mixins::Requests::Financial::ConsumerIdentifierAttributes
|
15
14
|
|
16
15
|
protected
|
@@ -37,19 +36,17 @@ module GenesisRuby
|
|
37
36
|
|
38
37
|
# Banco do Brasil request structure
|
39
38
|
def payment_transaction_structure # rubocop:disable Metrics/MethodLength
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
}
|
52
|
-
)
|
39
|
+
{
|
40
|
+
return_success_url: return_success_url,
|
41
|
+
return_failure_url: return_failure_url,
|
42
|
+
return_pending_url: return_pending_url,
|
43
|
+
consumer_reference: consumer_reference,
|
44
|
+
national_id: national_id,
|
45
|
+
birth_date: birth_date,
|
46
|
+
customer_email: customer_email,
|
47
|
+
billing_address: billing_address_parameters_structure,
|
48
|
+
shipping_address: shipping_address_parameters_structure
|
49
|
+
}
|
53
50
|
end
|
54
51
|
|
55
52
|
end
|
@@ -8,7 +8,6 @@ module GenesisRuby
|
|
8
8
|
|
9
9
|
include Api::Mixins::Requests::AddressInfoAttributes
|
10
10
|
include Api::Mixins::Requests::Financial::AsyncAttributes
|
11
|
-
include Api::Mixins::Requests::Financial::PaymentAttributes
|
12
11
|
include Api::Mixins::Requests::Financial::PendingPaymentAttributes
|
13
12
|
|
14
13
|
protected
|
@@ -20,6 +19,8 @@ module GenesisRuby
|
|
20
19
|
|
21
20
|
# EPS field validations
|
22
21
|
def init_field_validations
|
22
|
+
super
|
23
|
+
|
23
24
|
required_fields.push *%i[transaction_id return_success_url return_failure_url
|
24
25
|
amount currency billing_country]
|
25
26
|
field_values.merge! currency: 'EUR',
|
@@ -28,15 +29,13 @@ module GenesisRuby
|
|
28
29
|
|
29
30
|
# EPS request structure
|
30
31
|
def payment_transaction_structure
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
)
|
32
|
+
{
|
33
|
+
return_success_url: return_success_url,
|
34
|
+
return_failure_url: return_failure_url,
|
35
|
+
return_pending_url: return_pending_url,
|
36
|
+
billing_address: billing_address_parameters_structure,
|
37
|
+
shipping_address: shipping_address_parameters_structure
|
38
|
+
}
|
40
39
|
end
|
41
40
|
|
42
41
|
end
|
@@ -9,14 +9,7 @@ module GenesisRuby
|
|
9
9
|
|
10
10
|
include Api::Mixins::Requests::AddressInfoAttributes
|
11
11
|
include Api::Mixins::Requests::BirthDateAttributes
|
12
|
-
include Api::Mixins::Requests::Financial::
|
13
|
-
|
14
|
-
attr_reader :customer_account_id
|
15
|
-
|
16
|
-
# Customer account id parameter validation
|
17
|
-
def customer_account_id=(value)
|
18
|
-
limited_string attribute: __method__, value: value.to_s.empty? ? nil : value.to_s, max: 20
|
19
|
-
end
|
12
|
+
include Api::Mixins::Requests::Financial::CustomerAccountAttributes
|
20
13
|
|
21
14
|
protected
|
22
15
|
|
@@ -27,6 +20,8 @@ module GenesisRuby
|
|
27
20
|
|
28
21
|
# iDebit PayIn field validations
|
29
22
|
def init_field_validations
|
23
|
+
super
|
24
|
+
|
30
25
|
required_fields.push *%i[transaction_id customer_account_id amount currency billing_country]
|
31
26
|
|
32
27
|
field_values.merge! billing_country: 'CA'
|
@@ -34,16 +29,14 @@ module GenesisRuby
|
|
34
29
|
|
35
30
|
# iDebit PayIn parameters structure
|
36
31
|
def payment_transaction_structure
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
}
|
46
|
-
)
|
32
|
+
{
|
33
|
+
customer_email: customer_email,
|
34
|
+
customer_phone: customer_phone,
|
35
|
+
customer_account_id: customer_account_id,
|
36
|
+
birth_date: birth_date,
|
37
|
+
billing_address: billing_address_parameters_structure,
|
38
|
+
shipping_address: shipping_address_parameters_structure
|
39
|
+
}
|
47
40
|
end
|
48
41
|
|
49
42
|
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module Financial
|
5
|
+
module OnlineBankingPayments
|
6
|
+
module InstaDebit
|
7
|
+
# InstaDebit Payin transaction - after a successful validation of transaction parameters,
|
8
|
+
# transaction status is set to pending async and the consumer is redirected to the
|
9
|
+
# InstaDebit consumers page
|
10
|
+
class PayIn < Base::Financial
|
11
|
+
|
12
|
+
include Api::Mixins::Requests::AddressInfoAttributes
|
13
|
+
include Api::Mixins::Requests::Financial::CustomerAccountAttributes
|
14
|
+
|
15
|
+
attr_reader :return_url
|
16
|
+
|
17
|
+
# Return URL setter
|
18
|
+
def return_url=(value)
|
19
|
+
unless GenesisRuby::Utils::Common.valid_url?(value)
|
20
|
+
raise ParameterError, "Invalid URL given for #{__method__}"
|
21
|
+
end
|
22
|
+
|
23
|
+
@return_url = value
|
24
|
+
end
|
25
|
+
|
26
|
+
protected
|
27
|
+
|
28
|
+
# InstaDebit PayIn transaction type
|
29
|
+
def transaction_type
|
30
|
+
Api::Constants::Transactions::INSTA_DEBIT_PAYIN
|
31
|
+
end
|
32
|
+
|
33
|
+
# InstaDebit PayIn field validations
|
34
|
+
def init_field_validations
|
35
|
+
super
|
36
|
+
|
37
|
+
required_fields.push *%i[transaction_id customer_account_id remote_ip return_url amount
|
38
|
+
currency billing_country]
|
39
|
+
|
40
|
+
field_values.merge! billing_country: 'CA'
|
41
|
+
end
|
42
|
+
|
43
|
+
# InstaDebit PayIn parameters structure
|
44
|
+
def payment_transaction_structure
|
45
|
+
{
|
46
|
+
return_url: return_url,
|
47
|
+
customer_email: customer_email,
|
48
|
+
customer_phone: customer_phone,
|
49
|
+
customer_account_id: customer_account_id,
|
50
|
+
billing_address: billing_address_parameters_structure,
|
51
|
+
shipping_address: shipping_address_parameters_structure
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module Financial
|
5
|
+
module OnlineBankingPayments
|
6
|
+
module InstaDebit
|
7
|
+
# InstaDebit Payout transaction - the transaction is synchronous and
|
8
|
+
# transaction status is set immediately after the response
|
9
|
+
class PayOut < Idebit::PayOut
|
10
|
+
|
11
|
+
protected
|
12
|
+
|
13
|
+
# InstaDebit PayOut transaction type
|
14
|
+
def transaction_type
|
15
|
+
Constants::Transactions::INSTA_DEBIT_PAYOUT
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module Financial
|
5
|
+
module OnlineBankingPayments
|
6
|
+
# Multibanco allows Portuguese shoppers to do payments through the Internet
|
7
|
+
# by using virtual credit cards
|
8
|
+
class Multibanco < Base::Financial
|
9
|
+
|
10
|
+
include Api::Mixins::Requests::AddressInfoAttributes
|
11
|
+
include Api::Mixins::Requests::Financial::AsyncAttributes
|
12
|
+
include Api::Mixins::Requests::Financial::PendingPaymentAttributes
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
# Multibanco transaction type
|
17
|
+
def transaction_type
|
18
|
+
Api::Constants::Transactions::MULTIBANCO
|
19
|
+
end
|
20
|
+
|
21
|
+
# Multibanco field validations
|
22
|
+
def init_field_validations
|
23
|
+
super
|
24
|
+
|
25
|
+
required_fields.push *%i[transaction_id return_success_url return_failure_url
|
26
|
+
amount currency billing_country]
|
27
|
+
|
28
|
+
field_values.merge! billing_country: %w(PT)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Multibanco request structure
|
32
|
+
def payment_transaction_structure
|
33
|
+
{
|
34
|
+
return_success_url: return_success_url,
|
35
|
+
return_failure_url: return_failure_url,
|
36
|
+
return_pending_url: return_pending_url,
|
37
|
+
customer_email: customer_email,
|
38
|
+
billing_address: billing_address_parameters_structure,
|
39
|
+
shipping_address: shipping_address_parameters_structure
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module Financial
|
5
|
+
module OnlineBankingPayments
|
6
|
+
# MyBank is an overlay banking system for Italy and Spain
|
7
|
+
class MyBank < Base::Financial
|
8
|
+
|
9
|
+
include Api::Mixins::Requests::AddressInfoAttributes
|
10
|
+
include Api::Mixins::Requests::Financial::AsyncAttributes
|
11
|
+
include Api::Mixins::Requests::Financial::PendingPaymentAttributes
|
12
|
+
|
13
|
+
protected
|
14
|
+
|
15
|
+
# MyBank transaction type
|
16
|
+
def transaction_type
|
17
|
+
Api::Constants::Transactions::MY_BANK
|
18
|
+
end
|
19
|
+
|
20
|
+
# MyBank field validations
|
21
|
+
def init_field_validations
|
22
|
+
super
|
23
|
+
|
24
|
+
required_fields.push *%i[transaction_id return_success_url return_failure_url
|
25
|
+
amount currency billing_country]
|
26
|
+
|
27
|
+
field_values.merge! currency: 'EUR',
|
28
|
+
billing_country: %w(IT BE PT ES)
|
29
|
+
end
|
30
|
+
|
31
|
+
# MyBank request structure
|
32
|
+
def payment_transaction_structure
|
33
|
+
{
|
34
|
+
return_success_url: return_success_url,
|
35
|
+
return_failure_url: return_failure_url,
|
36
|
+
return_pending_url: return_pending_url,
|
37
|
+
billing_address: billing_address_parameters_structure,
|
38
|
+
shipping_address: shipping_address_parameters_structure
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/genesis_ruby/api/requests/financial/online_banking_payments/online_banking/pay_in.rb
CHANGED
@@ -14,7 +14,6 @@ module GenesisRuby
|
|
14
14
|
include Api::Mixins::Requests::DocumentAttributes
|
15
15
|
include Api::Mixins::Requests::Financial::AsyncAttributes
|
16
16
|
include Api::Mixins::Requests::Financial::OnlineBankingPayments::VirtualPaymentAddressAttributes
|
17
|
-
include Api::Mixins::Requests::Financial::PaymentAttributes
|
18
17
|
|
19
18
|
attr_accessor :user_category, :payment_type, :bank_code, :consumer_reference, :auth_code
|
20
19
|
|
@@ -27,6 +26,8 @@ module GenesisRuby
|
|
27
26
|
|
28
27
|
# Online Banking PayIn field validations
|
29
28
|
def init_field_validations # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
29
|
+
super
|
30
|
+
|
30
31
|
required_fields.push *%i[transaction_id return_success_url return_failure_url amount currency bank_code]
|
31
32
|
|
32
33
|
field_values.merge! payment_type: Api::Constants::Transactions::Parameters::OnlineBanking::
|
@@ -133,23 +134,21 @@ module GenesisRuby
|
|
133
134
|
|
134
135
|
# Online Banking PayIn parameters structure
|
135
136
|
def payment_transaction_structure # rubocop:disable Metrics/MethodLength
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
}
|
152
|
-
)
|
137
|
+
{
|
138
|
+
return_success_url: return_success_url,
|
139
|
+
return_failure_url: return_failure_url,
|
140
|
+
billing_address: billing_address_parameters_structure,
|
141
|
+
shipping_address: shipping_address_parameters_structure,
|
142
|
+
customer_email: customer_email,
|
143
|
+
customer_phone: customer_phone,
|
144
|
+
payment_type: payment_type,
|
145
|
+
bank_code: bank_code,
|
146
|
+
document_id: document_id,
|
147
|
+
user_category: user_category,
|
148
|
+
virtual_payment_address: virtual_payment_address,
|
149
|
+
consumer_reference: consumer_reference,
|
150
|
+
auth_code: auth_code
|
151
|
+
}
|
153
152
|
end
|
154
153
|
|
155
154
|
end
|