genesis_ruby 0.2.2 → 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 +57 -0
- data/Gemfile.lock +50 -41
- data/README.md +56 -0
- data/VERSION +1 -1
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/order_by_fields.rb +33 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/response_fields.rb +67 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/transaction_types.rb +48 -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/non_financial/sort_directions.rb +24 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/online_banking/iframe_targets.rb +26 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/online_banking/payment_types.rb +3 -0
- data/lib/genesis_ruby/api/constants/transactions.rb +5 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/bank_attributes.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/billing_api/sort_attributes.rb +18 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/date_attributes.rb +64 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/mode_attributes.rb +24 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/paging_attributes.rb +33 -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/mixins/requests/restricted_setter.rb +18 -0
- data/lib/genesis_ruby/api/request.rb +15 -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/graphql.rb +60 -0
- 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 +57 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/eps.rb +46 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/idebit/pay_in.rb +48 -0
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/idebit/pay_out.rb +28 -0
- 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 +50 -0
- data/lib/genesis_ruby/api/requests/financial/sdd/recurring/init_recurring_sale.rb +23 -0
- data/lib/genesis_ruby/api/requests/financial/sdd/recurring/recurring_sale.rb +28 -0
- data/lib/genesis_ruby/api/requests/financial/sdd/refund.rb +26 -0
- data/lib/genesis_ruby/api/requests/financial/sdd/sale.rb +57 -0
- data/lib/genesis_ruby/api/requests/financial/void.rb +12 -5
- data/lib/genesis_ruby/api/requests/financial/wallets/alipay.rb +46 -0
- data/lib/genesis_ruby/api/requests/financial/wallets/{pay_pay.rb → pay_pal.rb} +18 -20
- data/lib/genesis_ruby/api/requests/non_financial/billing_api/transactions.rb +203 -0
- 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/reconcile/date_range.rb +2 -50
- 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/builder.rb +5 -0
- data/lib/genesis_ruby/builders/graphql.rb +118 -0
- data/lib/genesis_ruby/configuration.rb +11 -2
- data/lib/genesis_ruby/dependencies.rb +3 -0
- data/lib/genesis_ruby/network/adapter/net_http_adapter.rb +20 -9
- data/lib/genesis_ruby/network/base_network.rb +1 -14
- data/lib/genesis_ruby/utils/formatters/response/formats/timestamp.rb +1 -1
- data/lib/genesis_ruby/utils/options/api_config.rb +19 -0
- data/lib/genesis_ruby/utils/options/network_adapter_config.rb +49 -14
- data/lib/genesis_ruby/utils/transactions/financial_types.rb +1 -1
- data/lib/genesis_ruby/utils/transactions/references/refundable_types.rb +1 -1
- data/lib/genesis_ruby/utils/transactions/wpf_types.rb +1 -1
- data/lib/genesis_ruby/version.rb +1 -1
- metadata +66 -4
@@ -0,0 +1,60 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module Base
|
5
|
+
# Base class for GraphQL API services
|
6
|
+
class Graphql < Versioned
|
7
|
+
|
8
|
+
# GraphQL base class constructor
|
9
|
+
def initialize(configuration, builder_interface = Builder::GRAPHQL)
|
10
|
+
super configuration, builder_interface
|
11
|
+
|
12
|
+
@root_key = 'query'
|
13
|
+
@request_name = ''
|
14
|
+
end
|
15
|
+
|
16
|
+
protected
|
17
|
+
|
18
|
+
attr_accessor :request_name, :root_key
|
19
|
+
|
20
|
+
# Init GraphQL configuration
|
21
|
+
def init_configuration
|
22
|
+
init_graphql_configuration
|
23
|
+
|
24
|
+
init_authorization_token
|
25
|
+
|
26
|
+
init_api_service_configuration request_path: "#{request_path}/#{version}/graphql", include_token: false
|
27
|
+
end
|
28
|
+
|
29
|
+
# Every Request must load the proper token in the Request API Config
|
30
|
+
def init_authorization_token
|
31
|
+
raise NoMethodError, "Authorization token isn't defined for #{self.class.name}"
|
32
|
+
end
|
33
|
+
|
34
|
+
# Response Filters
|
35
|
+
def query_filters
|
36
|
+
raise NoMethodError, "Response Filters isn't defined for #{self.class.name}"
|
37
|
+
end
|
38
|
+
|
39
|
+
# Response Fields
|
40
|
+
def query_response_fields
|
41
|
+
raise NoMethodError, "Response Fields isn't defined for #{self.class.name}"
|
42
|
+
end
|
43
|
+
|
44
|
+
# GraphQL request structure
|
45
|
+
def request_structure
|
46
|
+
Hash[
|
47
|
+
root_key,
|
48
|
+
Hash[
|
49
|
+
:action, request_name,
|
50
|
+
:filters, query_filters,
|
51
|
+
:response_fields, query_response_fields
|
52
|
+
]
|
53
|
+
]
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -11,8 +11,9 @@ module GenesisRuby
|
|
11
11
|
protected
|
12
12
|
|
13
13
|
def init_field_validations
|
14
|
+
super
|
15
|
+
|
14
16
|
required_fields.push *%i[transaction_id reference_id amount currency]
|
15
|
-
field_values.merge! currency: Api::Constants::Currencies::Iso4217.all.map(&:upcase)
|
16
17
|
end
|
17
18
|
|
18
19
|
# Reference transaction request structure
|
@@ -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
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module Financial
|
5
|
+
module OnlineBankingPayments
|
6
|
+
# Banco do Brasil offers online bank transfer payment service
|
7
|
+
class BancoDoBrasil < Base::Financial
|
8
|
+
|
9
|
+
include Api::Mixins::Requests::AddressInfoAttributes
|
10
|
+
include Api::Mixins::Requests::Financial::AsyncAttributes
|
11
|
+
include Api::Mixins::Requests::Financial::PendingPaymentAttributes
|
12
|
+
include Api::Mixins::Requests::BirthDateAttributes
|
13
|
+
include Api::Mixins::Requests::Financial::ConsumerIdentifierAttributes
|
14
|
+
|
15
|
+
protected
|
16
|
+
|
17
|
+
# Banco do Brasil transaction type
|
18
|
+
def transaction_type
|
19
|
+
Api::Constants::Transactions::BANCO_DO_BRASIL
|
20
|
+
end
|
21
|
+
|
22
|
+
# Allowed billing country for Banco do Brasil transaction request
|
23
|
+
def allowed_billing_countries
|
24
|
+
%w(BR)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Banco Do Brasil field validations
|
28
|
+
def init_field_validations
|
29
|
+
super
|
30
|
+
|
31
|
+
required_fields.push *%i[transaction_id return_success_url return_failure_url
|
32
|
+
amount currency consumer_reference national_id customer_email billing_country]
|
33
|
+
|
34
|
+
field_values.merge! billing_country: allowed_billing_countries
|
35
|
+
end
|
36
|
+
|
37
|
+
# Banco do Brasil request structure
|
38
|
+
def payment_transaction_structure # rubocop:disable Metrics/MethodLength
|
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
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module Financial
|
5
|
+
module OnlineBankingPayments
|
6
|
+
# EPS is the main bank transfer payment method in Austria
|
7
|
+
class Eps < 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
|
+
# EPS transaction type
|
16
|
+
def transaction_type
|
17
|
+
Api::Constants::Transactions::EPS
|
18
|
+
end
|
19
|
+
|
20
|
+
# EPS 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
|
+
field_values.merge! currency: 'EUR',
|
27
|
+
billing_country: 'AT'
|
28
|
+
end
|
29
|
+
|
30
|
+
# EPS request structure
|
31
|
+
def payment_transaction_structure
|
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
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module Financial
|
5
|
+
module OnlineBankingPayments
|
6
|
+
module Idebit
|
7
|
+
# iDebit PayIn transaction class
|
8
|
+
class PayIn < Requests::Base::Financial
|
9
|
+
|
10
|
+
include Api::Mixins::Requests::AddressInfoAttributes
|
11
|
+
include Api::Mixins::Requests::BirthDateAttributes
|
12
|
+
include Api::Mixins::Requests::Financial::CustomerAccountAttributes
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
# iDebit PayIn transaction type
|
17
|
+
def transaction_type
|
18
|
+
Api::Constants::Transactions::IDEBIT_PAYIN
|
19
|
+
end
|
20
|
+
|
21
|
+
# iDebit PayIn field validations
|
22
|
+
def init_field_validations
|
23
|
+
super
|
24
|
+
|
25
|
+
required_fields.push *%i[transaction_id customer_account_id amount currency billing_country]
|
26
|
+
|
27
|
+
field_values.merge! billing_country: 'CA'
|
28
|
+
end
|
29
|
+
|
30
|
+
# iDebit PayIn parameters structure
|
31
|
+
def payment_transaction_structure
|
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
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Requests
|
4
|
+
module Financial
|
5
|
+
module OnlineBankingPayments
|
6
|
+
module Idebit
|
7
|
+
# iDebit PayOut transaction class
|
8
|
+
class PayOut < Requests::Base::Reference
|
9
|
+
|
10
|
+
protected
|
11
|
+
|
12
|
+
# iDebit PayOut transaction type
|
13
|
+
def transaction_type
|
14
|
+
Constants::Transactions::IDEBIT_PAYOUT
|
15
|
+
end
|
16
|
+
|
17
|
+
# iDebit PayOut parameters structure
|
18
|
+
def reference_transaction_structure
|
19
|
+
{}
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
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
|