six_saferpay 1.16.2.4.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.test.env +1 -1
- data/.travis.yml +2 -4
- data/Gemfile.lock +85 -70
- data/README.md +0 -18
- data/lib/six_saferpay/api/six_batch/responses/close_response.rb +2 -2
- data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +0 -4
- data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +2 -11
- data/lib/six_saferpay/api/six_payment_page/responses/{initialize_response.rb → initalize_response.rb} +0 -0
- data/lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb +0 -4
- data/lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb +0 -4
- data/lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb +0 -4
- data/lib/six_saferpay/api/six_transaction/requests/capture.rb +2 -11
- data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +0 -4
- data/lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb +2 -11
- data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +3 -11
- data/lib/six_saferpay/api/six_transaction/responses/cancel_response.rb +1 -1
- data/lib/six_saferpay/api.rb +1 -1
- data/lib/six_saferpay/client.rb +2 -8
- data/lib/six_saferpay/models/address.rb +4 -4
- data/lib/six_saferpay/models/check_result.rb +2 -6
- data/lib/six_saferpay/models/payment_methods_options.rb +2 -4
- data/lib/six_saferpay/models/registration_result.rb +2 -11
- data/lib/six_saferpay/models/request_payment_means.rb +2 -6
- data/lib/six_saferpay/version.rb +1 -1
- data/six_saferpay.gemspec +8 -8
- metadata +25 -41
- data/lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb +0 -61
- data/lib/six_saferpay/api/six_secure_pay_gate_offer/responses/create_offer_response.rb +0 -26
- data/lib/six_saferpay/clients/secure_pay_gate_api/client.rb +0 -23
- data/lib/six_saferpay/models/authentication.rb +0 -36
- data/lib/six_saferpay/models/authentication_result.rb +0 -20
- data/lib/six_saferpay/models/bankcontact.rb +0 -21
- data/lib/six_saferpay/models/chosen_plan.rb +0 -62
- data/lib/six_saferpay/models/custom_plan.rb +0 -4
- data/lib/six_saferpay/models/first_installment_amount.rb +0 -4
- data/lib/six_saferpay/models/ideal.rb +0 -18
- data/lib/six_saferpay/models/installment_fee.rb +0 -4
- data/lib/six_saferpay/models/installment_plans.rb +0 -73
- data/lib/six_saferpay/models/mastercard_issuer_installments.rb +0 -49
- data/lib/six_saferpay/models/payment_method_options.rb +0 -18
- data/lib/six_saferpay/models/saferpay_fields.rb +0 -18
- data/lib/six_saferpay/models/subsequent_installment_amount.rb +0 -4
- data/lib/six_saferpay/models/total_amont_due.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 116c30e63df6945bd76a8f0fc0e608e3aac14037f66d0f1629c45434ead8c1a4
|
4
|
+
data.tar.gz: 4783e055be5621ad8030db250a04c874d5e1b1a724a194f7c6a30939959a1deb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64329f2aeb9520861f9ec3a9d37e8f43d3520fbdbba179db4e88015a28c57d98bc260c028a0222d18f3839ca2847b8f8c7533bf8da8f02c1ca3f3f3bcf90f1f1
|
7
|
+
data.tar.gz: f8b74dddd3054ea29d2f5b0b05b864b6299546e5344db571e2fc19856f23c2e91ee170b67ee6c6a1aa85edb1ab8d3c77b0dc43b441726c390a36e29c46b831ff
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.1
|
data/.test.env
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,97 +1,112 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
six_saferpay (1.
|
5
|
-
activesupport (~>
|
4
|
+
six_saferpay (1.5.0)
|
5
|
+
activesupport (~> 5.0, >= 5.0.0.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (
|
10
|
+
activesupport (5.2.3)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
-
i18n (>=
|
13
|
-
minitest (
|
14
|
-
tzinfo (~>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
12
|
+
i18n (>= 0.7, < 2)
|
13
|
+
minitest (~> 5.1)
|
14
|
+
tzinfo (~> 1.1)
|
15
|
+
addressable (2.6.0)
|
16
|
+
public_suffix (>= 2.0.2, < 4.0)
|
17
|
+
coderay (1.1.2)
|
18
|
+
concurrent-ruby (1.1.5)
|
19
|
+
crack (0.4.3)
|
20
|
+
safe_yaml (~> 1.0.0)
|
21
|
+
diff-lcs (1.3)
|
22
|
+
docile (1.3.1)
|
23
|
+
dotenv (2.7.1)
|
24
|
+
equatable (0.5.0)
|
25
|
+
ffi (1.10.0-java)
|
26
|
+
hashdiff (0.3.8)
|
27
|
+
i18n (1.6.0)
|
27
28
|
concurrent-ruby (~> 1.0)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
29
|
+
json (2.2.0)
|
30
|
+
json (2.2.0-java)
|
31
|
+
method_source (0.9.2)
|
32
|
+
minitest (5.11.3)
|
33
|
+
necromancer (0.4.0)
|
34
|
+
pastel (0.7.2)
|
35
|
+
equatable (~> 0.5.0)
|
36
|
+
tty-color (~> 0.4.0)
|
37
|
+
pry (0.12.2)
|
38
|
+
coderay (~> 1.1.0)
|
39
|
+
method_source (~> 0.9.0)
|
40
|
+
pry (0.12.2-java)
|
41
|
+
coderay (~> 1.1.0)
|
42
|
+
method_source (~> 0.9.0)
|
43
|
+
spoon (~> 0.0)
|
44
|
+
public_suffix (3.0.3)
|
45
|
+
rake (10.5.0)
|
46
|
+
rspec (3.8.0)
|
47
|
+
rspec-core (~> 3.8.0)
|
48
|
+
rspec-expectations (~> 3.8.0)
|
49
|
+
rspec-mocks (~> 3.8.0)
|
50
|
+
rspec-core (3.8.0)
|
51
|
+
rspec-support (~> 3.8.0)
|
52
|
+
rspec-expectations (3.8.2)
|
45
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
-
rspec-support (~> 3.
|
47
|
-
rspec-mocks (3.
|
54
|
+
rspec-support (~> 3.8.0)
|
55
|
+
rspec-mocks (3.8.0)
|
48
56
|
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
-
rspec-support (~> 3.
|
50
|
-
rspec-support (3.
|
51
|
-
|
57
|
+
rspec-support (~> 3.8.0)
|
58
|
+
rspec-support (3.8.0)
|
59
|
+
safe_yaml (1.0.5)
|
60
|
+
simplecov (0.16.1)
|
52
61
|
docile (~> 1.1)
|
53
|
-
|
54
|
-
|
55
|
-
simplecov-html (0.
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
tty-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
62
|
+
json (>= 1.8, < 3)
|
63
|
+
simplecov-html (~> 0.10.0)
|
64
|
+
simplecov-html (0.10.2)
|
65
|
+
spinning_wheel (0.2.0)
|
66
|
+
activesupport (~> 5.0, >= 5.0.0.0)
|
67
|
+
spoon (0.0.6)
|
68
|
+
ffi
|
69
|
+
thread_safe (0.3.6)
|
70
|
+
thread_safe (0.3.6-java)
|
71
|
+
timers (4.3.0)
|
72
|
+
tty-color (0.4.3)
|
73
|
+
tty-cursor (0.6.1)
|
74
|
+
tty-prompt (0.18.1)
|
75
|
+
necromancer (~> 0.4.0)
|
76
|
+
pastel (~> 0.7.0)
|
77
|
+
timers (~> 4.0)
|
78
|
+
tty-cursor (~> 0.6.0)
|
79
|
+
tty-reader (~> 0.5.0)
|
80
|
+
tty-reader (0.5.0)
|
81
|
+
tty-cursor (~> 0.6.0)
|
82
|
+
tty-screen (~> 0.6.4)
|
83
|
+
wisper (~> 2.0.0)
|
84
|
+
tty-screen (0.6.5)
|
85
|
+
tzinfo (1.2.5)
|
86
|
+
thread_safe (~> 0.1)
|
71
87
|
vcr (4.0.0)
|
72
|
-
webmock (3.
|
88
|
+
webmock (3.5.1)
|
73
89
|
addressable (>= 2.3.6)
|
74
90
|
crack (>= 0.3.2)
|
75
|
-
hashdiff
|
76
|
-
wisper (2.0.
|
77
|
-
zeitwerk (2.4.2)
|
91
|
+
hashdiff
|
92
|
+
wisper (2.0.0)
|
78
93
|
|
79
94
|
PLATFORMS
|
80
95
|
java
|
81
96
|
ruby
|
82
97
|
|
83
98
|
DEPENDENCIES
|
84
|
-
bundler (~> 2.
|
99
|
+
bundler (~> 2.0)
|
85
100
|
dotenv (~> 2.7, >= 2.7)
|
86
|
-
pry (~> 0.
|
87
|
-
rake (~>
|
101
|
+
pry (~> 0.12.0)
|
102
|
+
rake (~> 10.0)
|
88
103
|
rspec (~> 3.0)
|
89
|
-
simplecov (~> 0.
|
104
|
+
simplecov (~> 0.16)
|
90
105
|
six_saferpay!
|
91
|
-
spinning_wheel (~> 0.
|
92
|
-
tty-prompt (~> 0.
|
106
|
+
spinning_wheel (~> 0.1)
|
107
|
+
tty-prompt (~> 0.18)
|
93
108
|
vcr (~> 4.0, >= 4.0.0)
|
94
|
-
webmock (~> 3.
|
109
|
+
webmock (~> 3.5, >= 3.5.1)
|
95
110
|
|
96
111
|
BUNDLED WITH
|
97
|
-
2.
|
112
|
+
2.0.1
|
data/README.md
CHANGED
@@ -4,10 +4,6 @@
|
|
4
4
|
|
5
5
|
# SixSaferpay
|
6
6
|
|
7
|
-
## Current API Version
|
8
|
-
|
9
|
-
This gem is compatible with the SIX API version: `1.16`
|
10
|
-
|
11
7
|
## Installation
|
12
8
|
|
13
9
|
Add this line to your application's Gemfile:
|
@@ -83,15 +79,6 @@ You will find for all the other requests an predefined object. Feel free to use
|
|
83
79
|
|
84
80
|
TODO
|
85
81
|
|
86
|
-
#### SIX Secure PayGate API
|
87
|
-
|
88
|
-
If you want to use the SIX Secure PayGate API, you have to use an other Client:
|
89
|
-
|
90
|
-
```ruby
|
91
|
-
create_offer_request = SixSaferpay::SecurePayGateOffer.new(...)
|
92
|
-
create_offer_response = SixSaferpay::SecurePayGateApi::Client.new(create_offer_request)
|
93
|
-
```
|
94
|
-
|
95
82
|
## Documentation
|
96
83
|
|
97
84
|
[SIX Saferpay JSON API](https://saferpay.github.io/jsonapi)
|
@@ -149,11 +136,6 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
149
136
|
- [x] InsertAlias
|
150
137
|
- [x] AcquireTransaction
|
151
138
|
|
152
|
-
#### Secure PayGate API
|
153
|
-
|
154
|
-
- [x] CreateOffer
|
155
|
-
|
156
139
|
## License
|
157
140
|
|
158
141
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
159
|
-
|
@@ -5,12 +5,12 @@ module SixSaferpay
|
|
5
5
|
attr_accessor(:response_header)
|
6
6
|
|
7
7
|
def initialize(response_header:)
|
8
|
-
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h)
|
8
|
+
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
|
9
9
|
end
|
10
10
|
|
11
11
|
def to_hash
|
12
12
|
hash = Hash.new
|
13
|
-
hash.merge!(response_header: @response_header.to_h)
|
13
|
+
hash.merge!(response_header: @response_header.to_h) if @response_header
|
14
14
|
hash
|
15
15
|
end
|
16
16
|
alias_method :to_h, :to_hash
|
@@ -9,7 +9,6 @@ module SixSaferpay
|
|
9
9
|
:payment,
|
10
10
|
:payment_methods,
|
11
11
|
:payment_methods_options,
|
12
|
-
:authentication,
|
13
12
|
:wallets,
|
14
13
|
:payer,
|
15
14
|
:register_alias,
|
@@ -28,7 +27,6 @@ module SixSaferpay
|
|
28
27
|
payment:,
|
29
28
|
payment_methods: nil,
|
30
29
|
payment_methods_options: nil,
|
31
|
-
authentication: nil,
|
32
30
|
wallets: nil,
|
33
31
|
payer: nil,
|
34
32
|
register_alias: nil,
|
@@ -46,7 +44,6 @@ module SixSaferpay
|
|
46
44
|
@payment = SixSaferpay::Payment.new(payment.to_h) if payment
|
47
45
|
@payment_methods = payment_methods
|
48
46
|
@payment_methods_options = SixSaferpay::PaymentMethodsOptions.new(payment_methods_options.to_h) if payment_methods_options
|
49
|
-
@authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
|
50
47
|
@wallets = wallets
|
51
48
|
@payer = SixSaferpay::Payer.new(payer.to_h) if payer
|
52
49
|
@register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
|
@@ -67,7 +64,6 @@ module SixSaferpay
|
|
67
64
|
hash.merge!(payment: @payment.to_h)
|
68
65
|
hash.merge!(payment_methods: @payment_methods) if @payment_methods
|
69
66
|
hash.merge!(payment_methods_options: @payment_methods_options.to_h) if @payment_methods_options
|
70
|
-
hash.merge!(authentication: @authentication.to_h) if @authentication
|
71
67
|
hash.merge!(wallets: @wallets) if @wallets
|
72
68
|
hash.merge!(payer: @payer.to_h) if @payer
|
73
69
|
hash.merge!(register_alias: @register_alias.to_h) if @register_alias
|
@@ -8,8 +8,7 @@ module SixSaferpay
|
|
8
8
|
:payer,
|
9
9
|
:registration_result,
|
10
10
|
:liability,
|
11
|
-
:dcc
|
12
|
-
:mastercard_issuer_installments
|
11
|
+
:dcc
|
13
12
|
)
|
14
13
|
|
15
14
|
def initialize(response_header:,
|
@@ -18,8 +17,7 @@ module SixSaferpay
|
|
18
17
|
payer: nil,
|
19
18
|
registration_result: nil,
|
20
19
|
liability: nil,
|
21
|
-
dcc: nil
|
22
|
-
mastercard_issuer_installments: nil
|
20
|
+
dcc: nil
|
23
21
|
)
|
24
22
|
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h)
|
25
23
|
@transaction = SixSaferpay::Transaction.new(transaction.to_h)
|
@@ -28,10 +26,6 @@ module SixSaferpay
|
|
28
26
|
@registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
|
29
27
|
@liability = SixSaferpay::Liability.new(liability.to_h) if liability
|
30
28
|
@dcc = SixSaferpay::Dcc.new(dcc.to_h) if dcc
|
31
|
-
if mastercard_issuer_installments
|
32
|
-
@mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
|
33
|
-
.new(mastercard_issuer_installments.to_h)
|
34
|
-
end
|
35
29
|
end
|
36
30
|
|
37
31
|
def to_hash
|
@@ -43,9 +37,6 @@ module SixSaferpay
|
|
43
37
|
hash.merge!(registration_result: @registration_result.to_h) if @registration_result
|
44
38
|
hash.merge!(liability: @liability.to_h) if @liability
|
45
39
|
hash.merge!(dcc: @dcc.to_h) if @dcc
|
46
|
-
if @mastercard_issuer_installments
|
47
|
-
hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
|
48
|
-
end
|
49
40
|
hash
|
50
41
|
end
|
51
42
|
alias_method :to_h, :to_hash
|
File without changes
|
@@ -6,7 +6,6 @@ module SixSaferpay
|
|
6
6
|
:terminal_id,
|
7
7
|
:payment,
|
8
8
|
:payment_method,
|
9
|
-
:payment_method_options,
|
10
9
|
:payer,
|
11
10
|
:notification
|
12
11
|
)
|
@@ -17,14 +16,12 @@ module SixSaferpay
|
|
17
16
|
terminal_id:,
|
18
17
|
payment:,
|
19
18
|
payment_method:,
|
20
|
-
payment_method_options: nil,
|
21
19
|
payer: nil,
|
22
20
|
notification: )
|
23
21
|
@request_header = request_header || SixSaferpay::RequestHeader.new()
|
24
22
|
@terminal_id = terminal_id
|
25
23
|
@payment = SixSaferpay::Payment.new(payment.to_h)
|
26
24
|
@payment_method = payment_method
|
27
|
-
@payment_method_options = SixSaferpay::PaymentMethodOptions.new(payment_method_options.to_h) if payment_method_options
|
28
25
|
@payer = SixSaferpay::Payer.new(payer.to_h) if payer
|
29
26
|
@notification = SixSaferpay::Notification.new(notification.to_h)
|
30
27
|
end
|
@@ -35,7 +32,6 @@ module SixSaferpay
|
|
35
32
|
hash.merge!(terminal_id: @terminal_id)
|
36
33
|
hash.merge!(payment: @payment.to_h)
|
37
34
|
hash.merge!(payment_method: @payment_method)
|
38
|
-
hash.merge!(payment_method_options: @payment_method_options.to_h) if @payment_method_options
|
39
35
|
hash.merge!(payer: @payer.to_h) if @payer
|
40
36
|
hash.merge!(notification: @notification.to_h)
|
41
37
|
hash
|
@@ -6,7 +6,6 @@ module SixSaferpay
|
|
6
6
|
:terminal_id,
|
7
7
|
:payment,
|
8
8
|
:payment_means,
|
9
|
-
:authentication,
|
10
9
|
:register_alias,
|
11
10
|
:payer
|
12
11
|
)
|
@@ -16,7 +15,6 @@ module SixSaferpay
|
|
16
15
|
terminal_id: nil,
|
17
16
|
payment:,
|
18
17
|
payment_means:,
|
19
|
-
authentication: nil,
|
20
18
|
register_alias: nil,
|
21
19
|
payer: nil
|
22
20
|
)
|
@@ -24,7 +22,6 @@ module SixSaferpay
|
|
24
22
|
@terminal_id = SixSaferpay.config.terminal_id || terminal_id
|
25
23
|
@payment = SixSaferpay::Payment.new(payment.to_h) if payment
|
26
24
|
@payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
|
27
|
-
@authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
|
28
25
|
@register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
|
29
26
|
@payer = SixSaferpay::Payer.new(payer.to_h) if payer
|
30
27
|
end
|
@@ -35,7 +32,6 @@ module SixSaferpay
|
|
35
32
|
hash.merge!(terminal_id: @terminal_id) if @terminal_id
|
36
33
|
hash.merge!(payment: @payment.to_h) if @payment
|
37
34
|
hash.merge!(payment_means: @payment_means.to_h) if @payment_means
|
38
|
-
hash.merge!(authentication: @authentication.to_h) if @authentication
|
39
35
|
hash.merge!(register_alias: @register_alias.to_h) if @register_alias
|
40
36
|
hash.merge!(payer: @payer.to_h) if @payer
|
41
37
|
hash
|
@@ -6,7 +6,6 @@ module SixSaferpay
|
|
6
6
|
:terminal_id,
|
7
7
|
:payment,
|
8
8
|
:transaction_reference,
|
9
|
-
:authentication,
|
10
9
|
:suppress_dcc
|
11
10
|
)
|
12
11
|
|
@@ -15,14 +14,12 @@ module SixSaferpay
|
|
15
14
|
terminal_id: nil,
|
16
15
|
payment:,
|
17
16
|
transaction_reference:,
|
18
|
-
authentication: nil,
|
19
17
|
suppress_dcc:
|
20
18
|
)
|
21
19
|
@request_header = request_header || SixSaferpay::RequestHeader.new()
|
22
20
|
@terminal_id = terminal_id || SixSaferpay.config.terminal_id
|
23
21
|
@payment = SixSaferpay::Payment.new(payment.to_h) if payment
|
24
22
|
@transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
|
25
|
-
@authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
|
26
23
|
@suppress_dcc = suppress_dcc
|
27
24
|
end
|
28
25
|
|
@@ -32,7 +29,6 @@ module SixSaferpay
|
|
32
29
|
hash.merge!(terminal_id: @terminal_id) if @terminal_id
|
33
30
|
hash.merge!(payment: @payment.to_h) if @payment
|
34
31
|
hash.merge!(transaction_reference: @transaction_reference.to_h) if @transaction_reference
|
35
|
-
hash.merge!(authentication: @authentication.to_h) if @authentication
|
36
32
|
hash.merge!(suppress_dcc: @suppress_dcc) if !@suppress_dcc.nil?
|
37
33
|
hash
|
38
34
|
end
|
@@ -7,8 +7,7 @@ module SixSaferpay
|
|
7
7
|
:amount,
|
8
8
|
:billpay,
|
9
9
|
:pending_notification,
|
10
|
-
:marketplace
|
11
|
-
:mastercard_issuer_installments
|
10
|
+
:marketplace
|
12
11
|
)
|
13
12
|
|
14
13
|
|
@@ -17,8 +16,7 @@ module SixSaferpay
|
|
17
16
|
amount: nil,
|
18
17
|
billpay: nil,
|
19
18
|
pending_notification: nil,
|
20
|
-
marketplace: nil
|
21
|
-
mastercard_issuer_installments: nil
|
19
|
+
marketplace: nil
|
22
20
|
)
|
23
21
|
@request_header = request_header || SixSaferpay::RequestHeader.new()
|
24
22
|
@transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
|
@@ -26,10 +24,6 @@ module SixSaferpay
|
|
26
24
|
@billpay = SixSaferpay::Billpay.new(billpay.to_h) if billpay
|
27
25
|
@pending_notification = SixSaferpay::PendingNotification.new(pending_notification.to_h) if pending_notification
|
28
26
|
@marketplace = SixSaferpay::Marketplace.new(marketplace.to_h) if marketplace
|
29
|
-
if mastercard_issuer_installments
|
30
|
-
@mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
|
31
|
-
.new(mastercard_issuer_installments.to_h)
|
32
|
-
end
|
33
27
|
end
|
34
28
|
|
35
29
|
def to_hash
|
@@ -40,9 +34,6 @@ module SixSaferpay
|
|
40
34
|
hash.merge!(billpay: @billpay.to_h) if @billpay
|
41
35
|
hash.merge!(pending_notification: @pending_notification.to_h) if @pending_notification
|
42
36
|
hash.merge!(marketplace: @marketplace.to_h) if @marketplace
|
43
|
-
if @mastercard_issuer_installments
|
44
|
-
hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
|
45
|
-
end
|
46
37
|
hash
|
47
38
|
end
|
48
39
|
alias_method :to_h, :to_hash
|
@@ -8,7 +8,6 @@ module SixSaferpay
|
|
8
8
|
:terminal_id,
|
9
9
|
:payment,
|
10
10
|
:payment_means,
|
11
|
-
:authentication,
|
12
11
|
:payer,
|
13
12
|
:return_urls,
|
14
13
|
:styling,
|
@@ -23,7 +22,6 @@ module SixSaferpay
|
|
23
22
|
terminal_id: nil,
|
24
23
|
payment:,
|
25
24
|
payment_means: nil,
|
26
|
-
authentication: nil,
|
27
25
|
payer: nil,
|
28
26
|
return_urls: nil,
|
29
27
|
styling: nil,
|
@@ -36,7 +34,6 @@ module SixSaferpay
|
|
36
34
|
@terminal_id = terminal_id || SixSaferpay.config.terminal_id
|
37
35
|
@payment = SixSaferpay::Payment.new(payment.to_h) if payment
|
38
36
|
@payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
|
39
|
-
@authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
|
40
37
|
@payer = SixSaferpay::Payer.new(payer.to_h) if payer
|
41
38
|
@return_urls = return_urls || SixSaferpay::ReturnUrls.new()
|
42
39
|
@styling = SixSaferpay::Styling.new(styling.to_h) if styling
|
@@ -52,7 +49,6 @@ module SixSaferpay
|
|
52
49
|
hash.merge!(terminal_id: @terminal_id) if @terminal_id
|
53
50
|
hash.merge!(payment: @payment.to_h) if @payment
|
54
51
|
hash.merge!(payment_means: @payment_means.to_h) if @payment_means
|
55
|
-
hash.merge!(authentication: @authentication.to_h) if @authentication
|
56
52
|
hash.merge!(payer: @payer.to_h) if @payer
|
57
53
|
hash.merge!(return_urls: @return_urls.to_h ) if @return_urls
|
58
54
|
hash.merge!(styling: @styling.to_h) if @styling
|
@@ -6,8 +6,7 @@ module SixSaferpay
|
|
6
6
|
:transaction,
|
7
7
|
:payment_means,
|
8
8
|
:payer,
|
9
|
-
:registration_result
|
10
|
-
:mastercard_issuer_installments
|
9
|
+
:registration_result
|
11
10
|
)
|
12
11
|
|
13
12
|
|
@@ -15,18 +14,13 @@ module SixSaferpay
|
|
15
14
|
transaction:,
|
16
15
|
payment_means:,
|
17
16
|
payer: nil,
|
18
|
-
registration_result: nil
|
19
|
-
mastercard_issuer_installments: nil
|
17
|
+
registration_result: nil
|
20
18
|
)
|
21
19
|
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
|
22
20
|
@transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
|
23
21
|
@payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
|
24
22
|
@payer = SixSaferpay::Payer.new(payer.to_h) if payer
|
25
23
|
@registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
|
26
|
-
if mastercard_issuer_installments
|
27
|
-
@mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
|
28
|
-
.new(mastercard_issuer_installments.to_h)
|
29
|
-
end
|
30
24
|
end
|
31
25
|
|
32
26
|
def to_hash
|
@@ -36,9 +30,6 @@ module SixSaferpay
|
|
36
30
|
hash.merge!(payment_means: @payment_means.to_h) if @payment_means
|
37
31
|
hash.merge!(payer: @payer.to_h) if @payer
|
38
32
|
hash.merge!(registration_result: @registration_result.to_h) if @registration_result
|
39
|
-
if @mastercard_issuer_installments
|
40
|
-
hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
|
41
|
-
end
|
42
33
|
hash
|
43
34
|
end
|
44
35
|
alias_method :to_h, :to_hash
|
@@ -8,8 +8,7 @@ module SixSaferpay
|
|
8
8
|
:payer,
|
9
9
|
:registration_result,
|
10
10
|
:liability,
|
11
|
-
:dcc
|
12
|
-
:mastercard_issuer_installments
|
11
|
+
:dcc
|
13
12
|
)
|
14
13
|
|
15
14
|
|
@@ -19,8 +18,8 @@ module SixSaferpay
|
|
19
18
|
payer: nil,
|
20
19
|
registration_result: nil,
|
21
20
|
liability: nil,
|
22
|
-
dcc: nil
|
23
|
-
|
21
|
+
dcc: nil
|
22
|
+
|
24
23
|
)
|
25
24
|
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
|
26
25
|
@transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
|
@@ -29,10 +28,6 @@ module SixSaferpay
|
|
29
28
|
@registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
|
30
29
|
@liability = SixSaferpay::Liability.new(liability.to_h) if liability
|
31
30
|
@dcc = SixSaferpay::Dcc.new(dcc.to_h) if dcc
|
32
|
-
if mastercard_issuer_installments
|
33
|
-
@mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
|
34
|
-
.new(mastercard_issuer_installments.to_h)
|
35
|
-
end
|
36
31
|
end
|
37
32
|
|
38
33
|
def to_hash
|
@@ -44,9 +39,6 @@ module SixSaferpay
|
|
44
39
|
hash.merge!(registration_result: @registration_result.to_h) if @registration_result
|
45
40
|
hash.merge!(liability: @liability.to_h) if @liability
|
46
41
|
hash.merge!(dcc: @dcc.to_h) if @dcc
|
47
|
-
if @mastercard_issuer_installments
|
48
|
-
hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
|
49
|
-
end
|
50
42
|
hash
|
51
43
|
end
|
52
44
|
alias_method :to_h, :to_hash
|
data/lib/six_saferpay/api.rb
CHANGED
data/lib/six_saferpay/client.rb
CHANGED
@@ -17,23 +17,17 @@ module SixSaferpay
|
|
17
17
|
hash = @response.body
|
18
18
|
hash = JSON.parse(hash, symbolize_names: true)
|
19
19
|
hash = transform_response_hash(hash)
|
20
|
-
if @response.code ==
|
20
|
+
if @response.code == "200"
|
21
21
|
@object.response_class.new(hash)
|
22
22
|
else
|
23
23
|
raise SixSaferpay::Error.new(hash)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
protected
|
28
|
-
|
29
|
-
def header
|
30
|
-
{"Content-Type" => 'application/json'}
|
31
|
-
end
|
32
|
-
|
33
27
|
private
|
34
28
|
|
35
29
|
def request
|
36
|
-
request = Net::HTTP::Post.new(uri.path,
|
30
|
+
request = Net::HTTP::Post.new(uri.path, {'Content-Type' => 'application/json'})
|
37
31
|
hash = @object.to_h
|
38
32
|
hash = transform_request_hash(hash)
|
39
33
|
hash = hash.to_json
|