genesis_ruby 0.1.7 → 0.1.8
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 +10 -0
- data/Gemfile.lock +44 -38
- data/README.md +217 -0
- data/VERSION +1 -1
- 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/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/customer_info_attributes.rb +1 -1
- 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/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/reference.rb +3 -2
- 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/sale.rb +10 -2
- data/lib/genesis_ruby/api/requests/financial/cards/sale3d.rb +19 -10
- data/lib/genesis_ruby/api/requests/financial/cards/threeds/v2/method_continue.rb +2 -2
- 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/online_banking/pay_in.rb +157 -0
- data/lib/genesis_ruby/api/requests/financial/void.rb +2 -2
- 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/utils/common.rb +26 -0
- data/lib/genesis_ruby/version.rb +1 -1
- metadata +15 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4bea22025e527f7dacbc7289c230b6f28124b6535c471c267225b608660d40c
|
4
|
+
data.tar.gz: c437ee21a72d4d19686f908f59358245ec87356f84fa270e9a000c7a4f276d81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79f51dcf85135a053d6556b3fb4096ecae5d8bef785c42714e40a32a6b25f299d36ed98cc25c8cb3e7c7741d247724d7ceba997d5e86a4e8016846bc5f7c9940
|
7
|
+
data.tar.gz: 30030ba067499b12f280699ab2460840705c4b1fe24007047bfb3ebeba8e52b23f56a987ce094145db814425f6418384703b2bde54d967110bc78e4e38698109
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
0.1.8
|
2
|
+
-----
|
3
|
+
**Features**:
|
4
|
+
|
5
|
+
* Added Apple Pay transaction request support
|
6
|
+
* Added Google Pay transaction request support
|
7
|
+
* Added Online Banking PayIn transaction request support
|
8
|
+
* Updated transform amount logic during request execution
|
9
|
+
* Added 3DSv2 parameters validations
|
10
|
+
|
1
11
|
0.1.7
|
2
12
|
-----
|
3
13
|
**Features**:
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
genesis_ruby (0.1.
|
4
|
+
genesis_ruby (0.1.8)
|
5
5
|
net-http (~> 0.3.2)
|
6
6
|
nokogiri (~> 1.14)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
addressable (2.8.
|
12
|
-
public_suffix (>= 2.0.2, <
|
11
|
+
addressable (2.8.7)
|
12
|
+
public_suffix (>= 2.0.2, < 7.0)
|
13
13
|
ast (2.4.2)
|
14
14
|
base64 (0.2.0)
|
15
|
-
bigdecimal (3.1.
|
16
|
-
concurrent-ruby (1.
|
15
|
+
bigdecimal (3.1.8)
|
16
|
+
concurrent-ruby (1.3.4)
|
17
17
|
crack (1.0.0)
|
18
18
|
bigdecimal
|
19
19
|
rexml
|
20
|
+
csv (3.3.0)
|
20
21
|
diff-lcs (1.5.1)
|
21
22
|
faker (2.23.0)
|
22
23
|
i18n (>= 1.8.11, < 2)
|
@@ -25,32 +26,35 @@ GEM
|
|
25
26
|
faraday-net_http (>= 2.0, < 3.1)
|
26
27
|
ruby2_keywords (>= 0.0.4)
|
27
28
|
faraday-net_http (3.0.2)
|
28
|
-
faraday-retry (2.2.
|
29
|
+
faraday-retry (2.2.1)
|
29
30
|
faraday (~> 2.0)
|
30
|
-
gitlab (4.
|
31
|
+
gitlab (4.20.1)
|
31
32
|
httparty (~> 0.20)
|
32
33
|
terminal-table (>= 1.5.1)
|
33
|
-
hashdiff (1.1.
|
34
|
-
httparty (0.
|
34
|
+
hashdiff (1.1.1)
|
35
|
+
httparty (0.22.0)
|
36
|
+
csv
|
35
37
|
mini_mime (>= 1.0.0)
|
36
38
|
multi_xml (>= 0.5.2)
|
37
|
-
i18n (1.14.
|
39
|
+
i18n (1.14.6)
|
38
40
|
concurrent-ruby (~> 1.0)
|
39
|
-
json (2.7.
|
41
|
+
json (2.7.2)
|
40
42
|
language_server-protocol (3.17.0.3)
|
41
43
|
mini_mime (1.1.5)
|
44
|
+
mini_portile2 (2.8.7)
|
42
45
|
multi_xml (0.6.0)
|
43
|
-
mustermann (3.0.
|
46
|
+
mustermann (3.0.3)
|
44
47
|
ruby2_keywords (~> 0.0.1)
|
45
48
|
net-http (0.3.2)
|
46
49
|
uri
|
47
|
-
nokogiri (1.
|
50
|
+
nokogiri (1.15.6)
|
51
|
+
mini_portile2 (~> 2.8.2)
|
48
52
|
racc (~> 1.4)
|
49
53
|
octokit (7.2.0)
|
50
54
|
faraday (>= 1, < 3)
|
51
55
|
sawyer (~> 0.9)
|
52
|
-
parallel (1.
|
53
|
-
parser (3.3.0
|
56
|
+
parallel (1.26.3)
|
57
|
+
parser (3.3.5.0)
|
54
58
|
ast (~> 2.4.1)
|
55
59
|
racc
|
56
60
|
pronto (0.11.2)
|
@@ -64,55 +68,57 @@ GEM
|
|
64
68
|
pronto-rubocop (0.11.5)
|
65
69
|
pronto (~> 0.11.0)
|
66
70
|
rubocop (>= 0.63.1, < 2.0)
|
67
|
-
public_suffix (5.
|
68
|
-
racc (1.
|
71
|
+
public_suffix (5.1.1)
|
72
|
+
racc (1.8.1)
|
69
73
|
rack (2.2.9)
|
70
74
|
rack-protection (3.2.0)
|
71
75
|
base64 (>= 0.1.0)
|
72
76
|
rack (~> 2.2, >= 2.2.4)
|
73
77
|
rainbow (3.1.1)
|
74
|
-
rake (13.1
|
75
|
-
regexp_parser (2.9.
|
76
|
-
rexml (3.
|
78
|
+
rake (13.2.1)
|
79
|
+
regexp_parser (2.9.2)
|
80
|
+
rexml (3.3.8)
|
77
81
|
rspec (3.13.0)
|
78
82
|
rspec-core (~> 3.13.0)
|
79
83
|
rspec-expectations (~> 3.13.0)
|
80
84
|
rspec-mocks (~> 3.13.0)
|
81
|
-
rspec-core (3.13.
|
85
|
+
rspec-core (3.13.1)
|
82
86
|
rspec-support (~> 3.13.0)
|
83
|
-
rspec-expectations (3.13.
|
87
|
+
rspec-expectations (3.13.3)
|
84
88
|
diff-lcs (>= 1.2.0, < 2.0)
|
85
89
|
rspec-support (~> 3.13.0)
|
86
|
-
rspec-mocks (3.13.
|
90
|
+
rspec-mocks (3.13.2)
|
87
91
|
diff-lcs (>= 1.2.0, < 2.0)
|
88
92
|
rspec-support (~> 3.13.0)
|
89
93
|
rspec-support (3.13.1)
|
90
94
|
rspec_junit_formatter (0.6.0)
|
91
95
|
rspec-core (>= 2, < 4, != 2.12.0)
|
92
|
-
rubocop (1.
|
96
|
+
rubocop (1.66.1)
|
93
97
|
json (~> 2.3)
|
94
98
|
language_server-protocol (>= 3.17.0)
|
95
99
|
parallel (~> 1.10)
|
96
100
|
parser (>= 3.3.0.2)
|
97
101
|
rainbow (>= 2.2.2, < 4.0)
|
98
|
-
regexp_parser (>=
|
99
|
-
|
100
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
102
|
+
regexp_parser (>= 2.4, < 3.0)
|
103
|
+
rubocop-ast (>= 1.32.2, < 2.0)
|
101
104
|
ruby-progressbar (~> 1.7)
|
102
105
|
unicode-display_width (>= 2.4.0, < 3.0)
|
103
|
-
rubocop-ast (1.
|
104
|
-
parser (>= 3.3.0
|
105
|
-
rubocop-capybara (2.
|
106
|
-
rubocop (~> 1.41)
|
107
|
-
rubocop-factory_bot (2.25.1)
|
106
|
+
rubocop-ast (1.32.3)
|
107
|
+
parser (>= 3.3.1.0)
|
108
|
+
rubocop-capybara (2.21.0)
|
108
109
|
rubocop (~> 1.41)
|
110
|
+
rubocop-factory_bot (2.26.1)
|
111
|
+
rubocop (~> 1.61)
|
109
112
|
rubocop-faker (1.1.0)
|
110
113
|
faker (>= 2.12.0)
|
111
114
|
rubocop (>= 0.82.0)
|
112
|
-
rubocop-rspec (2.
|
115
|
+
rubocop-rspec (2.31.0)
|
113
116
|
rubocop (~> 1.40)
|
114
117
|
rubocop-capybara (~> 2.17)
|
115
118
|
rubocop-factory_bot (~> 2.22)
|
119
|
+
rubocop-rspec_rails (~> 2.28)
|
120
|
+
rubocop-rspec_rails (2.29.1)
|
121
|
+
rubocop (~> 1.61)
|
116
122
|
ruby-progressbar (1.13.0)
|
117
123
|
ruby2_keywords (0.0.5)
|
118
124
|
rugged (1.7.2)
|
@@ -126,11 +132,11 @@ GEM
|
|
126
132
|
tilt (~> 2.0)
|
127
133
|
terminal-table (3.0.2)
|
128
134
|
unicode-display_width (>= 1.1.1, < 3)
|
129
|
-
thor (1.3.
|
130
|
-
tilt (2.
|
131
|
-
unicode-display_width (2.
|
132
|
-
uri (0.13.
|
133
|
-
webmock (3.
|
135
|
+
thor (1.3.2)
|
136
|
+
tilt (2.4.0)
|
137
|
+
unicode-display_width (2.6.0)
|
138
|
+
uri (0.13.1)
|
139
|
+
webmock (3.24.0)
|
134
140
|
addressable (>= 2.8.0)
|
135
141
|
crack (>= 0.3.2)
|
136
142
|
hashdiff (>= 0.4.0, < 2.0.0)
|
data/README.md
CHANGED
@@ -447,6 +447,214 @@ end
|
|
447
447
|
|
448
448
|
</details>
|
449
449
|
|
450
|
+
### Apple Pay Request
|
451
|
+
|
452
|
+
Apple Pay is a mobile payment solution available on iOS devices with Touch ID / Face ID support. Apple Pay allows shoppers to purchase with credit and debit cards linked to their devices.
|
453
|
+
|
454
|
+
<details>
|
455
|
+
<summary>Apple Pay Transaction Example</summary>
|
456
|
+
|
457
|
+
```ruby
|
458
|
+
require 'genesis_ruby'
|
459
|
+
|
460
|
+
begin
|
461
|
+
genesis = GenesisRuby::Genesis.for(config: configuration, request: GenesisRuby::Api::Requests::Financial::Mobile::ApplePay) do |request|
|
462
|
+
# Common Attributes
|
463
|
+
request.transaction_id = '12345-67890'
|
464
|
+
request.amount = '0.99'
|
465
|
+
request.currency = 'EUR'
|
466
|
+
request.usage = 'Example usage'
|
467
|
+
request.customer_email = 'travis@example.com'
|
468
|
+
request.customer_phone = '+1987987987987'
|
469
|
+
|
470
|
+
request.payment_subtype = GenesisRuby::Api::Constants::Transactions::Parameters::Mobile::ApplePay::PaymentSubtypes::SALE
|
471
|
+
|
472
|
+
# Billing Attributes
|
473
|
+
request.billing_first_name = 'Travis'
|
474
|
+
request.billing_last_name = 'Pastrana'
|
475
|
+
request.billing_address1 = 'Muster Str. 12'
|
476
|
+
request.billing_zip_code = '10178'
|
477
|
+
request.billing_city = 'Los Angeles'
|
478
|
+
request.billing_state = 'CA'
|
479
|
+
request.billing_country = 'US'
|
480
|
+
|
481
|
+
# Apple Pay Payment Token
|
482
|
+
json_token = '{"paymentData":{"version":"EC_v1","data":"MgcrhHr/uhfRy7zxMOvahhf5sp+ZfUsWADlG5OhvZ8vEAybEouyk4tT8oYaOqlfNTdkJZl2tmCgyLReibOjW2RiXzw5S9ZtA6ISnEBjNFla9Hju1KJnxQ+QFIdSlhEDOqN/Wk9kSFz2mnT8wajaG6mytpXhzCxvl5ElCp0gm0wMb82lvpf6my5T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21EAAAAAAAA=","header":{"wrappedKey": "wrapped key", "ephemeralPublicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJsaMBlzR3D0H7xKwDncLNGOEcsl6Jilx5d+MDI/1QFxuIf6a0fY5qgOwnuLgZepqc3AVeU1RV8enPCQSWfFKRg==","publicKeyHash":"QOmvMaoCNYk5tv+69KC1i2UCFQcOl6LYPIJfYAT+SLQ=","transactionId":"ccedaf3f32efcc971259694f0efd0dcaa0ed545e7a31a0f7ec8e1c110656c25b"}},"paymentMethod":{"displayName":"Visa 0225","network":"Visa","type":"debit"},"transactionIdentifier":"CCEDAF3F32EFCC971259694F0EFD0DCAA0ED545E7A31A0F7EC8E1C110656C25B"}'
|
483
|
+
|
484
|
+
# Set Apple Pay token from a JSON string
|
485
|
+
request.json_token = json_token
|
486
|
+
|
487
|
+
# Alternatively you can set every token attributes
|
488
|
+
# token = JSON.parse json_token
|
489
|
+
# request.token_version = token['paymentData']['version']
|
490
|
+
# request.token_data = token['paymentData']['data']
|
491
|
+
# request.token_signature = token['paymentData']['signature']
|
492
|
+
# request.token_ephemeral_public_key = token['paymentData']['header']['ephemeralPublicKey']
|
493
|
+
# request.token_public_key_hash = token['paymentData']['header']['publicKeyHash']
|
494
|
+
# request.token_transaction_id = token['paymentData']['header']['transactionId']
|
495
|
+
# request.token_display_name = token['paymentMethod']['displayName']
|
496
|
+
# request.token_network = token['paymentMethod']['network']
|
497
|
+
# request.token_type = token['paymentMethod']['type']
|
498
|
+
# request.token_transaction_identifier = token['transactionIdentifier']
|
499
|
+
end.execute
|
500
|
+
|
501
|
+
puts genesis.response.response_object
|
502
|
+
rescue GenesisRuby::Error => error
|
503
|
+
puts error.message
|
504
|
+
end
|
505
|
+
```
|
506
|
+
|
507
|
+
</details>
|
508
|
+
|
509
|
+
<details>
|
510
|
+
<summary>Apple Pay Web Payment Form Example</summary>
|
511
|
+
|
512
|
+
```ruby
|
513
|
+
require 'genesis_ruby'
|
514
|
+
|
515
|
+
begin
|
516
|
+
genesis = GenesisRuby::Genesis.for(config: configuration, request: GenesisRuby::Api::Requests::Wpf::Create) do |request|
|
517
|
+
# Common Attributes
|
518
|
+
request.transaction_id = '12345-67890'
|
519
|
+
request.amount = '0.99'
|
520
|
+
request.currency = 'EUR'
|
521
|
+
request.usage = 'Example usage'
|
522
|
+
request.description = 'You are about to complete you purchase'
|
523
|
+
request.customer_email = 'travis@example.com'
|
524
|
+
request.customer_phone = '+1987987987987'
|
525
|
+
request.notification_url = 'https://www.example.com/notification'
|
526
|
+
request.return_success_url = 'https://www.example.com/success'
|
527
|
+
request.return_cancel_url = 'https://www.example.com/failure'
|
528
|
+
request.return_failure_url = 'https://www.example.com/cancel.html'
|
529
|
+
request.return_pending_url = 'https://www.example.com/payment-pending.html'
|
530
|
+
|
531
|
+
# Transaction Types
|
532
|
+
request.add_transaction_type('apple_pay', { payment_subtype: GenesisRuby::Api::Constants::Transactions::Parameters::Mobile::ApplePay::PaymentSubtypes::AUTHORIZE })
|
533
|
+
|
534
|
+
# Billing Attributes
|
535
|
+
request.billing_first_name = 'Travis'
|
536
|
+
request.billing_last_name = 'Pastrana'
|
537
|
+
request.billing_address1 = 'Muster Str. 12'
|
538
|
+
request.billing_zip_code = '10178'
|
539
|
+
request.billing_city = 'Los Angeles'
|
540
|
+
request.billing_state = 'CA'
|
541
|
+
request.billing_country = 'US'
|
542
|
+
end.execute
|
543
|
+
|
544
|
+
puts genesis.response.response_object
|
545
|
+
|
546
|
+
rescue GenesisRuby::Error => error
|
547
|
+
puts error.message
|
548
|
+
end
|
549
|
+
```
|
550
|
+
|
551
|
+
</details>
|
552
|
+
|
553
|
+
### Google Pay Request
|
554
|
+
|
555
|
+
Google Pay allows shoppers to purchase with credit and debit cards linked to their Google account.
|
556
|
+
|
557
|
+
<details>
|
558
|
+
<summary>Google Pay Transaction Example</summary>
|
559
|
+
|
560
|
+
```ruby
|
561
|
+
require 'genesis_ruby'
|
562
|
+
|
563
|
+
begin
|
564
|
+
genesis = GenesisRuby::Genesis.for(config: configuration, request: GenesisRuby::Api::Requests::Financial::Mobile::GooglePay) do |request|
|
565
|
+
# Common Attributes
|
566
|
+
request.transaction_id = '12345-67890'
|
567
|
+
request.amount = '0.99'
|
568
|
+
request.currency = 'EUR'
|
569
|
+
request.usage = 'Example usage'
|
570
|
+
request.customer_email = 'travis@example.com'
|
571
|
+
request.customer_phone = '+1987987987987'
|
572
|
+
|
573
|
+
request.payment_subtype = GenesisRuby::Api::Constants::Transactions::Parameters::Mobile::GooglePay::PaymentSubtypes::SALE
|
574
|
+
|
575
|
+
# Billing Attributes
|
576
|
+
request.billing_first_name = 'Travis'
|
577
|
+
request.billing_last_name = 'Pastrana'
|
578
|
+
request.billing_address1 = 'Muster Str. 12'
|
579
|
+
request.billing_zip_code = '10178'
|
580
|
+
request.billing_city = 'Los Angeles'
|
581
|
+
request.billing_state = 'CA'
|
582
|
+
request.billing_country = 'US'
|
583
|
+
|
584
|
+
# Google Pay Payment Token
|
585
|
+
json_token = '{
|
586
|
+
"protocolVersion":"ECv2",
|
587
|
+
"signature":"MEQCIH6Q4OwQ0jAceFEkGF0JID6sJNXxOEi4r+mA7biRxqBQAiAondqoUpU/bdsrAOpZIsrHQS9nwiiNwOrr24RyPeHA0Q\u003d\u003d",
|
588
|
+
"intermediateSigningKey":{
|
589
|
+
"signedKey": "{\"keyExpiration\":\"1542323393147\",\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/1+3HBVSbdv+j7NaArdgMyoSAM43yRydzqdg1TxodSzA96Dj4Mc1EiKroxxunavVIvdxGnJeFViTzFvzFRxyCw\\u003d\\u003d\"}",
|
590
|
+
"signatures": ["MEYCIQCO2EIi48s8VTH+ilMEpoXLFfkxAwHjfPSCVED/QDSHmQIhALLJmrUlNAY8hDQRV/y1iKZGsWpeNmIP+z+tCQHQxP0v"]
|
591
|
+
},
|
592
|
+
"signedMessage":"{\"tag\":\"jpGz1F1Bcoi/fCNxI9n7Qrsw7i7KHrGtTf3NrRclt+U\\u003d\",\"ephemeralPublicKey\":\"BJatyFvFPPD21l8/uLP46Ta1hsKHndf8Z+tAgk+DEPQgYTkhHy19cF3h/bXs0tWTmZtnNm+vlVrKbRU9K8+7cZs\\u003d\",\"encryptedMessage\":\"mKOoXwi8OavZ\"}"
|
593
|
+
}'
|
594
|
+
|
595
|
+
# Set Google Pay token from a JSON string
|
596
|
+
request.json_token = json_token
|
597
|
+
|
598
|
+
# Alternatively you can set every token attributes
|
599
|
+
# token = JSON.parse json_token
|
600
|
+
# request.token_protocol_version = token['protocolVersion']
|
601
|
+
# request.token_signature = token['signature']
|
602
|
+
# request.token_signed_key = token['intermediateSigningKey']['signedKey']
|
603
|
+
# request.token_signatures = token['intermediateSigningKey']['signatures']
|
604
|
+
# request.token_signed_message = token['signedMessage']
|
605
|
+
end.execute
|
606
|
+
|
607
|
+
puts genesis.response.response_object
|
608
|
+
rescue GenesisRuby::Error => error
|
609
|
+
puts error.message
|
610
|
+
end
|
611
|
+
```
|
612
|
+
|
613
|
+
</details>
|
614
|
+
|
615
|
+
<details>
|
616
|
+
<summary>Google Pay Web Payment Form Example</summary>
|
617
|
+
|
618
|
+
```ruby
|
619
|
+
require 'genesis_ruby'
|
620
|
+
|
621
|
+
begin
|
622
|
+
genesis = GenesisRuby::Genesis.for(config: configuration, request: GenesisRuby::Api::Requests::Wpf::Create) do |request|
|
623
|
+
# Common Attributes
|
624
|
+
request.transaction_id = '12345-67890'
|
625
|
+
request.amount = '0.99'
|
626
|
+
request.currency = 'EUR'
|
627
|
+
request.usage = 'Example usage'
|
628
|
+
request.description = 'You are about to complete you purchase'
|
629
|
+
request.customer_email = 'travis@example.com'
|
630
|
+
request.customer_phone = '+1987987987987'
|
631
|
+
request.notification_url = 'https://www.example.com/notification'
|
632
|
+
request.return_success_url = 'https://www.example.com/success'
|
633
|
+
request.return_cancel_url = 'https://www.example.com/failure'
|
634
|
+
request.return_failure_url = 'https://www.example.com/cancel.html'
|
635
|
+
request.return_pending_url = 'https://www.example.com/payment-pending.html'
|
636
|
+
|
637
|
+
# Transaction Types
|
638
|
+
request.add_transaction_type('google_pay', { payment_subtype: GenesisRuby::Api::Constants::Transactions::Parameters::Mobile::GooglePay::PaymentSubtypes::AUTHORIZE })
|
639
|
+
|
640
|
+
# Billing Attributes
|
641
|
+
request.billing_first_name = 'Travis'
|
642
|
+
request.billing_last_name = 'Pastrana'
|
643
|
+
request.billing_address1 = 'Muster Str. 12'
|
644
|
+
request.billing_zip_code = '10178'
|
645
|
+
request.billing_city = 'Los Angeles'
|
646
|
+
request.billing_state = 'CA'
|
647
|
+
request.billing_country = 'US'
|
648
|
+
end.execute
|
649
|
+
|
650
|
+
puts genesis.response.response_object
|
651
|
+
|
652
|
+
rescue GenesisRuby::Error => error
|
653
|
+
puts error.message
|
654
|
+
end
|
655
|
+
```
|
656
|
+
|
657
|
+
</details>
|
450
658
|
|
451
659
|
### Recurring
|
452
660
|
|
@@ -789,11 +997,20 @@ GenesisRuby::Api::Requests::Financial::Cards::Authorize3d
|
|
789
997
|
GenesisRuby::Api::Requests::Financial::Cards::Sale
|
790
998
|
GenesisRuby::Api::Requests::Financial::Cards::Sale3d
|
791
999
|
|
1000
|
+
## Mobile
|
1001
|
+
GenesisRuby::Api::Requests::Financial::Mobile::ApplePay
|
1002
|
+
GenesisRuby::Api::Requests::Financial::Mobile::GooglePay
|
1003
|
+
|
792
1004
|
# Web Payment Form
|
793
1005
|
## Create
|
794
1006
|
GenesisRuby::Api::Requests::Wpf::Create
|
1007
|
+
## WPF Reconcile
|
795
1008
|
GenesisRuby::Api::Requests::Wpf::Reconcile
|
796
1009
|
|
1010
|
+
# Online Banking Payments
|
1011
|
+
# PayIn
|
1012
|
+
GenesisRuby::Api::Requests::Financial::OnlineBankingPayments::OnlineBanking::PayIn
|
1013
|
+
|
797
1014
|
# References
|
798
1015
|
GenesisRuby::Api::Requests::Financial::Capture
|
799
1016
|
GenesisRuby::Api::Requests::Financial::Void
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/lib/genesis_ruby/api/constants/transactions/parameters/mobile/apple_pay/payment_subtypes.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Constants
|
4
|
+
module Transactions
|
5
|
+
module Parameters
|
6
|
+
module Mobile
|
7
|
+
module ApplePay
|
8
|
+
# Apple Pay Payment Subtypes allowed values
|
9
|
+
class PaymentSubtypes
|
10
|
+
|
11
|
+
extend Mixins::Constants::Common
|
12
|
+
|
13
|
+
# Apple Pay authorize payment subtype
|
14
|
+
AUTHORIZE = 'authorize'.freeze
|
15
|
+
|
16
|
+
# Apple Pay init_recurring_sale payment subtype
|
17
|
+
INIT_RECURRING_SALE = 'init_recurring_sale'.freeze
|
18
|
+
|
19
|
+
# Apple Pay sale payment subtype
|
20
|
+
SALE = 'sale'.freeze
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/genesis_ruby/api/constants/transactions/parameters/mobile/google_pay/payment_subtypes.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
module GenesisRuby
|
2
|
+
module Api
|
3
|
+
module Constants
|
4
|
+
module Transactions
|
5
|
+
module Parameters
|
6
|
+
module Mobile
|
7
|
+
module GooglePay
|
8
|
+
# Payment Subtype allowed values
|
9
|
+
class PaymentSubtypes
|
10
|
+
|
11
|
+
extend Mixins::Constants::Common
|
12
|
+
|
13
|
+
# Google Pay authorize payment subtype
|
14
|
+
AUTHORIZE = 'authorize'.freeze
|
15
|
+
|
16
|
+
# Google Pay init_recurring_sale payment subtype
|
17
|
+
INIT_RECURRING_SALE = 'init_recurring_sale'.freeze
|
18
|
+
|
19
|
+
# Google Pay sale payment subtype
|
20
|
+
SALE = 'sale'.freeze
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/genesis_ruby/api/constants/transactions/parameters/online_banking/bank_code_currencies.rb
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
require 'genesis_ruby/api/constants/transactions/parameters/online_banking/bank_codes'
|
2
|
+
|
3
|
+
module GenesisRuby
|
4
|
+
module Api
|
5
|
+
module Constants
|
6
|
+
module Transactions
|
7
|
+
module Parameters
|
8
|
+
module OnlineBanking
|
9
|
+
# Bank Code Currencies allowed values
|
10
|
+
class BankCodeCurrencies # rubocop:disable Metrics/ClassLength
|
11
|
+
|
12
|
+
extend Mixins::Constants::Common
|
13
|
+
|
14
|
+
CURRENCIES = {
|
15
|
+
AUD: [
|
16
|
+
BankCodes::PID
|
17
|
+
],
|
18
|
+
BRL: [
|
19
|
+
BankCodes::CA
|
20
|
+
],
|
21
|
+
CAD: [
|
22
|
+
BankCodes::CPI
|
23
|
+
],
|
24
|
+
CHF: [
|
25
|
+
BankCodes::PF
|
26
|
+
],
|
27
|
+
CNY: [
|
28
|
+
BankCodes::ABC, BankCodes::BOB, BankCodes::BOC, BankCodes::BOCO, BankCodes::CCB, BankCodes::CCD,
|
29
|
+
BankCodes::CEB, BankCodes::CIB, BankCodes::CMB, BankCodes::CMBC, BankCodes::CITIC, BankCodes::ICBC,
|
30
|
+
BankCodes::GDB, BankCodes::HXB, BankCodes::PINGANBANK, BankCodes::PSBC, BankCodes::QUICKPAY,
|
31
|
+
BankCodes::SHB, BankCodes::SPABANK, BankCodes::SPDB, BankCodes::YLB
|
32
|
+
],
|
33
|
+
CLP: [
|
34
|
+
BankCodes::SP
|
35
|
+
],
|
36
|
+
EUR: [
|
37
|
+
BankCodes::PF, BankCodes::BCT, BankCodes::TRL
|
38
|
+
],
|
39
|
+
THB: [
|
40
|
+
BankCodes::BBL_IB_U, BankCodes::KBANK_PAYPLUS, BankCodes::BAY_IB_U, BankCodes::KTB_IB_U,
|
41
|
+
BankCodes::SCB_IB_U
|
42
|
+
],
|
43
|
+
USD: [
|
44
|
+
BankCodes::SN, BankCodes::IT, BankCodes::BR, BankCodes::BB, BankCodes::WP, BankCodes::BN,
|
45
|
+
BankCodes::PS, BankCodes::BO
|
46
|
+
],
|
47
|
+
MYR: [
|
48
|
+
BankCodes::FPX_ABB, BankCodes::FPX_ABMB, BankCodes::FPX_AMB, BankCodes::FPX_BIMB, BankCodes::FPX_BMMB,
|
49
|
+
BankCodes::FPX_BKRM, BankCodes::FPX_BSN, BankCodes::FPX_CIMBCLICKS, BankCodes::FPX_HLB,
|
50
|
+
BankCodes::FPX_KFH, BankCodes::FPX_MB2U, BankCodes::FPX_OCBC, BankCodes::FPX_PBB, BankCodes::FPX_RHB,
|
51
|
+
BankCodes::FPX_SCB, BankCodes::FPX_UOB
|
52
|
+
],
|
53
|
+
PEN: [
|
54
|
+
BankCodes::BC, BankCodes::IB, BankCodes::EF, BankCodes::BP
|
55
|
+
],
|
56
|
+
PYG: [
|
57
|
+
BankCodes::PE
|
58
|
+
],
|
59
|
+
IDR: [
|
60
|
+
BankCodes::DK_BCA_IB, BankCodes::DK_BRI_IB, BankCodes::DK_CIMBCLICKS_IB, BankCodes::DK_DANAMON_IB,
|
61
|
+
BankCodes::DK_PERMATANET_IB
|
62
|
+
],
|
63
|
+
INR: [
|
64
|
+
BankCodes::ABPB, BankCodes::AIRP, BankCodes::ALLA, BankCodes::ANDB, BankCodes::BARB_R,
|
65
|
+
BankCodes::BBKM, BankCodes::BKDN, BankCodes::BKID, BankCodes::CBIN, BankCodes::CIUB, BankCodes::CNRB,
|
66
|
+
BankCodes::CORP, BankCodes::COSB, BankCodes::CSBK, BankCodes::DBSS, BankCodes::DCBL, BankCodes::DEUT,
|
67
|
+
BankCodes::DLXB, BankCodes::ESFB, BankCodes::FDRL, BankCodes::HDFC, BankCodes::IBKL, BankCodes::ICIC,
|
68
|
+
BankCodes::IDFB, BankCodes::IDIB, BankCodes::INDB, BankCodes::IOBA, BankCodes::JAKA, BankCodes::JSBP,
|
69
|
+
BankCodes::KARB, BankCodes::KKBK, BankCodes::KVBL, BankCodes::LAVB_C, BankCodes::LAVB_R,
|
70
|
+
BankCodes::MAHB, BankCodes::NKGS, BankCodes::ORBC, BankCodes::PMCB, BankCodes::PSIB,
|
71
|
+
BankCodes::PUNB_R, BankCodes::RATN, BankCodes::SBBJ, BankCodes::SBHY, BankCodes::SBIN,
|
72
|
+
BankCodes::SBMY, BankCodes::SBTR, BankCodes::SCBL, BankCodes::SIBL, BankCodes::SRCB, BankCodes::STBP,
|
73
|
+
BankCodes::SVCB, BankCodes::SYNB, BankCodes::TMBL, BankCodes::TNSC, BankCodes::UBIN, BankCodes::UCBA,
|
74
|
+
BankCodes::UTBI, BankCodes::UTIB, BankCodes::VIJB, BankCodes::YESB
|
75
|
+
],
|
76
|
+
MXN: [
|
77
|
+
BankCodes::SE, BankCodes::BQ
|
78
|
+
],
|
79
|
+
PHP: [
|
80
|
+
BankCodes::DRAGONPAY
|
81
|
+
],
|
82
|
+
SGD: [
|
83
|
+
BankCodes::DBS, BankCodes::UOB, BankCodes::OCBC, BankCodes::SCB
|
84
|
+
],
|
85
|
+
UYU: [
|
86
|
+
BankCodes::AI
|
87
|
+
],
|
88
|
+
VND: [
|
89
|
+
BankCodes::VTCP_VPBANK, BankCodes::VTCP_ABBANK, BankCodes::VTCP_ACB, BankCodes::VTCP_AGRIBANK,
|
90
|
+
BankCodes::VTCP_BACABANK, BankCodes::VTCP_BIDV, BankCodes::VTCP_BVB, BankCodes::VTCP_DONGABANK,
|
91
|
+
BankCodes::VTCP_EXIMBANK, BankCodes::VTCP_GPBANK, BankCodes::VTCP_HDBANK, BankCodes::VTCP_LVPB,
|
92
|
+
BankCodes::VTCP_MB, BankCodes::VTCP_MARITIMEBANK, BankCodes::VTCP_NAMABANK, BankCodes::VTCP_NAVIBANK,
|
93
|
+
BankCodes::VTCP_OCEANBANK, BankCodes::VTCP_PGBANK, BankCodes::VTCP_PHUONGDONG, BankCodes::VTCP_SHB,
|
94
|
+
BankCodes::VTCP_SACOMBANK, BankCodes::VTCP_SAIGONBANK, BankCodes::VTCP_SEAABANK,
|
95
|
+
BankCodes::VTCP_TECHCOMBANK, BankCodes::VTCP_TIENPHONGBANK, BankCodes::VTCP_VIB,
|
96
|
+
BankCodes::VTCP_VIETABANK, BankCodes::VTCP_VIETCOMBANK, BankCodes::VTCP_VIETINBANK
|
97
|
+
],
|
98
|
+
PLN: [
|
99
|
+
BankCodes::BLK
|
100
|
+
],
|
101
|
+
GBP: [
|
102
|
+
BankCodes::TRL
|
103
|
+
]
|
104
|
+
}.freeze
|
105
|
+
|
106
|
+
class << self
|
107
|
+
|
108
|
+
# Return All available allowed values
|
109
|
+
def all
|
110
|
+
CURRENCIES.keys.map { |currency| currency.to_s.downcase }
|
111
|
+
end
|
112
|
+
|
113
|
+
# Retrieve the allowed bank codes for the provided currency
|
114
|
+
def bank_codes_per_currency(currency)
|
115
|
+
return CURRENCIES[currency.to_s.upcase.to_sym] if CURRENCIES.key? currency.to_s.upcase.to_sym
|
116
|
+
|
117
|
+
[]
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|