six_saferpay 1.2.1 → 1.16.2.4.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 +4 -2
- data/Gemfile.lock +70 -85
- data/README.md +120 -3
- data/lib/six_saferpay/api.rb +1 -1
- data/lib/six_saferpay/api/six_batch/requests/close.rb +37 -0
- data/lib/six_saferpay/api/six_batch/responses/close_response.rb +20 -0
- data/lib/six_saferpay/api/six_omni_channel/requests/acquire_transaction.rb +46 -0
- data/lib/six_saferpay/api/six_omni_channel/requests/insert_alias.rb +40 -0
- data/lib/six_saferpay/api/six_omni_channel/responses/acquire_transaction_response.rb +30 -0
- data/lib/six_saferpay/api/six_omni_channel/responses/insert_alias_response.rb +34 -0
- data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +4 -0
- data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +11 -2
- data/lib/six_saferpay/api/six_payment_page/responses/{initalize_response.rb → initialize_response.rb} +0 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/assert_insert.rb +37 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/delete.rb +37 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/insert.rb +66 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/insert_direct.rb +46 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/update.rb +42 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/assert_insert_response.rb +33 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/delete_response.rb +20 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/insert_direct_response.rb +33 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb +33 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/update_response.rb +29 -0
- data/lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb +61 -0
- data/lib/six_saferpay/api/six_secure_pay_gate_offer/responses/create_offer_response.rb +26 -0
- data/lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb +59 -0
- data/lib/six_saferpay/api/six_transaction/requests/authorize.rb +1 -1
- data/lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb +4 -0
- data/lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb +4 -0
- data/lib/six_saferpay/api/six_transaction/requests/capture.rb +11 -2
- data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +4 -0
- data/lib/six_saferpay/api/six_transaction/requests/inquire.rb +36 -0
- data/lib/six_saferpay/api/six_transaction/requests/multipart_finalize.rb +38 -0
- data/lib/six_saferpay/api/six_transaction/requests/query_alternative_payment.rb +35 -0
- data/lib/six_saferpay/api/six_transaction/requests/refund.rb +7 -7
- data/lib/six_saferpay/api/six_transaction/requests/refund_direct.rb +46 -0
- data/lib/six_saferpay/api/six_transaction/responses/adjust_amount_response.rb +1 -4
- data/lib/six_saferpay/api/six_transaction/responses/alternative_payment_response.rb +35 -0
- data/lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb +11 -2
- data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +11 -3
- data/lib/six_saferpay/api/six_transaction/responses/cancel_response.rb +1 -1
- data/lib/six_saferpay/api/six_transaction/responses/inquire_response.rb +44 -0
- data/lib/six_saferpay/api/six_transaction/responses/multipart_finalize_response.rb +20 -0
- data/lib/six_saferpay/api/six_transaction/responses/query_alternative_payment_response.rb +39 -0
- data/lib/six_saferpay/api/six_transaction/responses/refund_direct_response.rb +34 -0
- data/lib/six_saferpay/client.rb +8 -2
- data/lib/six_saferpay/clients/secure_pay_gate_api/client.rb +23 -0
- data/lib/six_saferpay/models/address.rb +4 -4
- data/lib/six_saferpay/models/alias.rb +22 -0
- data/lib/six_saferpay/models/alias_card.rb +20 -0
- data/lib/six_saferpay/models/authentication.rb +36 -0
- data/lib/six_saferpay/models/authentication_result.rb +20 -0
- data/lib/six_saferpay/models/bancontact.rb +20 -0
- data/lib/six_saferpay/models/bankcontact.rb +21 -0
- data/lib/six_saferpay/models/check.rb +22 -0
- data/lib/six_saferpay/models/check_result.rb +27 -0
- data/lib/six_saferpay/models/chosen_plan.rb +62 -0
- data/lib/six_saferpay/models/custom_plan.rb +4 -0
- data/lib/six_saferpay/models/error.rb +0 -28
- data/lib/six_saferpay/models/first_installment_amount.rb +4 -0
- data/lib/six_saferpay/models/ideal.rb +18 -0
- data/lib/six_saferpay/models/installment_fee.rb +4 -0
- data/lib/six_saferpay/models/installment_plans.rb +73 -0
- data/lib/six_saferpay/models/mastercard_issuer_installments.rb +49 -0
- data/lib/six_saferpay/models/notification.rb +4 -4
- data/lib/six_saferpay/models/payment_method_options.rb +18 -0
- data/lib/six_saferpay/models/payment_methods_options.rb +4 -2
- data/lib/six_saferpay/models/pending_notification.rb +4 -4
- data/lib/six_saferpay/models/processing_data.rb +18 -0
- data/lib/six_saferpay/models/registration_result.rb +11 -2
- data/lib/six_saferpay/models/request_payment_means.rb +6 -2
- data/lib/six_saferpay/models/response_card.rb +0 -4
- data/lib/six_saferpay/models/saferpay_fields.rb +18 -0
- data/lib/six_saferpay/models/subsequent_installment_amount.rb +4 -0
- data/lib/six_saferpay/models/total_amont_due.rb +4 -0
- data/lib/six_saferpay/models/update_alias.rb +20 -0
- data/lib/six_saferpay/models/update_payment_means.rb +18 -0
- data/lib/six_saferpay/version.rb +1 -1
- data/six_saferpay.gemspec +12 -14
- metadata +81 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acfb2585b43dd7064f81b0485286f48e2c4b554c7f2d0fe1025bc5eb0cbd4c64
|
4
|
+
data.tar.gz: 904a6c58a9da762f04bc601292d89a6dfa27722678f3bcb9ca4146612142184d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835973e42bb94eba81cc077a63318b195c89f4f0c35e287fdb38371b641f62317891b9781070199948454047050af115874b8500ca7f5a5b022906743647241f
|
7
|
+
data.tar.gz: 542f2e7bcd9781054756cd5e623030cecbc0d98b31201e10d3c2f27055101a1e765c7c92483fbb91e7ee163eea3c67f8bf49bb875a8df248617c17a30dfa05f6
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.2
|
data/.test.env
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,112 +1,97 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
six_saferpay (1.2.
|
5
|
-
activesupport (~>
|
4
|
+
six_saferpay (1.16.2.4.0)
|
5
|
+
activesupport (~> 6.1, >= 6.1.3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (
|
10
|
+
activesupport (6.1.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
|
-
|
27
|
-
i18n (1.6.0)
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
zeitwerk (~> 2.3)
|
16
|
+
addressable (2.7.0)
|
17
|
+
public_suffix (>= 2.0.2, < 5.0)
|
18
|
+
coderay (1.1.3)
|
19
|
+
concurrent-ruby (1.1.8)
|
20
|
+
crack (0.4.5)
|
21
|
+
rexml
|
22
|
+
diff-lcs (1.4.4)
|
23
|
+
docile (1.3.5)
|
24
|
+
dotenv (2.7.6)
|
25
|
+
hashdiff (1.0.1)
|
26
|
+
i18n (1.8.9)
|
28
27
|
concurrent-ruby (~> 1.0)
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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)
|
28
|
+
method_source (1.0.0)
|
29
|
+
minitest (5.14.3)
|
30
|
+
pastel (0.8.0)
|
31
|
+
tty-color (~> 0.5)
|
32
|
+
pry (0.14.0)
|
33
|
+
coderay (~> 1.1)
|
34
|
+
method_source (~> 1.0)
|
35
|
+
public_suffix (4.0.6)
|
36
|
+
rake (13.0.3)
|
37
|
+
rexml (3.2.4)
|
38
|
+
rspec (3.10.0)
|
39
|
+
rspec-core (~> 3.10.0)
|
40
|
+
rspec-expectations (~> 3.10.0)
|
41
|
+
rspec-mocks (~> 3.10.0)
|
42
|
+
rspec-core (3.10.1)
|
43
|
+
rspec-support (~> 3.10.0)
|
44
|
+
rspec-expectations (3.10.1)
|
53
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
-
rspec-support (~> 3.
|
55
|
-
rspec-mocks (3.
|
46
|
+
rspec-support (~> 3.10.0)
|
47
|
+
rspec-mocks (3.10.2)
|
56
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
-
rspec-support (~> 3.
|
58
|
-
rspec-support (3.
|
59
|
-
|
60
|
-
simplecov (0.16.1)
|
49
|
+
rspec-support (~> 3.10.0)
|
50
|
+
rspec-support (3.10.2)
|
51
|
+
simplecov (0.21.2)
|
61
52
|
docile (~> 1.1)
|
62
|
-
|
63
|
-
|
64
|
-
simplecov-html (0.
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
tty-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
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)
|
53
|
+
simplecov-html (~> 0.11)
|
54
|
+
simplecov_json_formatter (~> 0.1)
|
55
|
+
simplecov-html (0.12.3)
|
56
|
+
simplecov_json_formatter (0.1.2)
|
57
|
+
spinning_wheel (0.2.2)
|
58
|
+
activesupport (>= 5.2.4.3)
|
59
|
+
tty-color (0.6.0)
|
60
|
+
tty-cursor (0.7.1)
|
61
|
+
tty-prompt (0.23.0)
|
62
|
+
pastel (~> 0.8)
|
63
|
+
tty-reader (~> 0.8)
|
64
|
+
tty-reader (0.9.0)
|
65
|
+
tty-cursor (~> 0.7)
|
66
|
+
tty-screen (~> 0.8)
|
67
|
+
wisper (~> 2.0)
|
68
|
+
tty-screen (0.8.1)
|
69
|
+
tzinfo (2.0.4)
|
70
|
+
concurrent-ruby (~> 1.0)
|
87
71
|
vcr (4.0.0)
|
88
|
-
webmock (3.
|
72
|
+
webmock (3.11.2)
|
89
73
|
addressable (>= 2.3.6)
|
90
74
|
crack (>= 0.3.2)
|
91
|
-
hashdiff
|
92
|
-
wisper (2.0.
|
75
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
76
|
+
wisper (2.0.1)
|
77
|
+
zeitwerk (2.4.2)
|
93
78
|
|
94
79
|
PLATFORMS
|
95
80
|
java
|
96
81
|
ruby
|
97
82
|
|
98
83
|
DEPENDENCIES
|
99
|
-
bundler (~> 2.
|
84
|
+
bundler (~> 2.1)
|
100
85
|
dotenv (~> 2.7, >= 2.7)
|
101
|
-
pry (~> 0.
|
102
|
-
rake (~>
|
86
|
+
pry (~> 0.13)
|
87
|
+
rake (~> 13.0)
|
103
88
|
rspec (~> 3.0)
|
104
|
-
simplecov (~> 0.
|
89
|
+
simplecov (~> 0.19)
|
105
90
|
six_saferpay!
|
106
|
-
spinning_wheel (~> 0.
|
107
|
-
tty-prompt (~> 0.
|
91
|
+
spinning_wheel (~> 0.2.2)
|
92
|
+
tty-prompt (~> 0.22)
|
108
93
|
vcr (~> 4.0, >= 4.0.0)
|
109
|
-
webmock (~> 3.
|
94
|
+
webmock (~> 3.10, >= 3.10)
|
110
95
|
|
111
96
|
BUNDLED WITH
|
112
|
-
2.
|
97
|
+
2.2.8
|
data/README.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/six_saferpay.svg)](https://badge.fury.io/rb/six_saferpay)
|
1
2
|
[![Build Status](https://travis-ci.org/fadendaten/six_saferpay.svg?branch=master)](https://travis-ci.org/fadendaten/six_saferpay)
|
2
3
|
[![Maintainability](https://api.codeclimate.com/v1/badges/76c9d1d0f261c276de96/maintainability)](https://codeclimate.com/github/fadendaten/six_saferpay/maintainability)
|
3
4
|
|
4
5
|
# SixSaferpay
|
5
6
|
|
6
|
-
|
7
|
+
## Current API Version
|
7
8
|
|
8
|
-
|
9
|
+
This gem is compatible with the SIX API version: `1.16`
|
9
10
|
|
10
11
|
## Installation
|
11
12
|
|
@@ -23,9 +24,77 @@ Or install it yourself as:
|
|
23
24
|
|
24
25
|
$ gem install six_saferpay
|
25
26
|
|
27
|
+
|
28
|
+
## Configuration
|
29
|
+
|
30
|
+
Please configure your gem:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
SixSaferpay.configure do |config|
|
34
|
+
config.customer_id = YOUR_SIX_SAFERPAY_CUSTOMER_ID
|
35
|
+
config.terminal_id = YOUR_SIX_SAFERPAY_TERMINAL_ID
|
36
|
+
config.username = YOUR_SIX_SAFERPAY_USERNAME
|
37
|
+
config.password = YOUR_SIX_SAFERPAY_PASSWORD
|
38
|
+
config.success_url = YOUR_SIX_SAFERPAY_SUCCESS_URL
|
39
|
+
config.fail_url = YOUR_SIX_SAFERPAY_FAIL_URL
|
40
|
+
config.base_url = YOUR_SIX_SAFERPAY_BASE_URL
|
41
|
+
config.css_url = YOUR_SIX_SAFERPAY_CSS_URL
|
42
|
+
end
|
43
|
+
|
44
|
+
```
|
45
|
+
|
26
46
|
## Usage
|
27
47
|
|
28
|
-
|
48
|
+
SIX Saferpay provides multiple interfaces. We give you a short introduction in the usage of the gem by showing you two examples for the initialize requests.
|
49
|
+
|
50
|
+
### SIX Saferpay Payment Page
|
51
|
+
|
52
|
+
The SIX Saferpay Payment Page is a simple implementation of the payment gateway of SIX.
|
53
|
+
|
54
|
+
#### PaymentPage Initialize
|
55
|
+
|
56
|
+
Before we start we have to create a two basic objects. The first object is the ```SixSaferpay::Amount```. This object represents the value of your cart in the currency you sell your products. The second object is the ```SixSaferpay::Payment```. This object represents the payment a user of your shop will do. As you can see, the amount object is includes in this object.
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
amount = SixSaferpay::Amount.new(value: 100, currency_code: "CHF")
|
60
|
+
payment = SixSaferpay::Payment.new(amount: amount, order_id: 1234, description: 'Order #1234')
|
61
|
+
```
|
62
|
+
|
63
|
+
After we create those two objects, we can create the initialize object for the SIX Saferpay Payment Page.
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
initialize = SixSaferpay::SixPaymentPage::Initialize.new(payment: payment)
|
67
|
+
```
|
68
|
+
|
69
|
+
Now we can send the initialize request to the API. We can use the client object to send a post request to the API.
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
initialize_response = SixSaferpay::Client.post(initialize)
|
73
|
+
```
|
74
|
+
The client will return a response object. After an initialize request, the client will return you a initialize response object (```SixSaferpay::InitializeResponse```).
|
75
|
+
|
76
|
+
If the request goes wrong the client raises a ```SixSaferpay::Error```
|
77
|
+
|
78
|
+
#### Other Requests
|
79
|
+
|
80
|
+
You will find for all the other requests an predefined object. Feel free to use this according the SIX Saferpay API documentation.
|
81
|
+
|
82
|
+
### SIX Saferpay Transaction
|
83
|
+
|
84
|
+
TODO
|
85
|
+
|
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
|
+
## Documentation
|
96
|
+
|
97
|
+
[SIX Saferpay JSON API](https://saferpay.github.io/jsonapi)
|
29
98
|
|
30
99
|
## Development
|
31
100
|
|
@@ -37,6 +106,54 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
37
106
|
|
38
107
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/six_saferpay.
|
39
108
|
|
109
|
+
### Implementation Status
|
110
|
+
|
111
|
+
#### SIX Payment Page
|
112
|
+
|
113
|
+
- [x] Initialize
|
114
|
+
- [x] Assert
|
115
|
+
|
116
|
+
#### SIX Transaction
|
117
|
+
|
118
|
+
- [x] Initialize
|
119
|
+
- [x] Authorize
|
120
|
+
- [x] QueryPaymentMeans
|
121
|
+
- [x] AdjustAmount
|
122
|
+
- [x] AuthorizeDirect
|
123
|
+
- [x] AuthorizeReferenced
|
124
|
+
- [x] Capture
|
125
|
+
- [x] MultipartCapture
|
126
|
+
- [x] AssertCapture
|
127
|
+
- [x] MultipartFinalize
|
128
|
+
- [x] Refund
|
129
|
+
- [x] AssertRefund
|
130
|
+
- [x] RefundDirect
|
131
|
+
- [x] Cancel
|
132
|
+
- ~~RedirectPayment~~ (Deprecated)
|
133
|
+
- ~~AssertRedirectPayment~~ (Deprecated)
|
134
|
+
- [x] Inquire
|
135
|
+
|
136
|
+
#### SIX Secure Card Data
|
137
|
+
|
138
|
+
- [x] Insert
|
139
|
+
- [x] AssertInsert
|
140
|
+
- [x] InsertDirect
|
141
|
+
- [x] Delete
|
142
|
+
|
143
|
+
#### SIX Batch
|
144
|
+
|
145
|
+
- [x] Close
|
146
|
+
|
147
|
+
#### SIX OmniChannel
|
148
|
+
|
149
|
+
- [x] InsertAlias
|
150
|
+
- [x] AcquireTransaction
|
151
|
+
|
152
|
+
#### Secure PayGate API
|
153
|
+
|
154
|
+
- [x] CreateOffer
|
155
|
+
|
40
156
|
## License
|
41
157
|
|
42
158
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
159
|
+
|
data/lib/six_saferpay/api.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixBatch
|
3
|
+
class Close
|
4
|
+
|
5
|
+
attr_accessor(:request_header,
|
6
|
+
:terminal_id
|
7
|
+
)
|
8
|
+
|
9
|
+
def initialize(request_header: nil,
|
10
|
+
terminal_id: )
|
11
|
+
@request_header = request_header || SixSaferpay::RequestHeader.new()
|
12
|
+
@terminal_id = terminal_id
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_hash
|
16
|
+
hash = Hash.new
|
17
|
+
hash.merge!(request_header: @request_header.to_h) if @request_header
|
18
|
+
hash.merge!(terminal_id: @terminal_id) if @terminal_id
|
19
|
+
hash
|
20
|
+
end
|
21
|
+
alias_method :to_h, :to_hash
|
22
|
+
|
23
|
+
def to_json
|
24
|
+
to_hash.to_json
|
25
|
+
end
|
26
|
+
|
27
|
+
def url
|
28
|
+
'/Payment/v1/Batch/Close'
|
29
|
+
end
|
30
|
+
|
31
|
+
def response_class
|
32
|
+
SixSaferpay::SixBatch::CloseResponse
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixBatch
|
3
|
+
class CloseResponse
|
4
|
+
|
5
|
+
attr_accessor(:response_header)
|
6
|
+
|
7
|
+
def initialize(response_header:)
|
8
|
+
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h)
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_hash
|
12
|
+
hash = Hash.new
|
13
|
+
hash.merge!(response_header: @response_header.to_h)
|
14
|
+
hash
|
15
|
+
end
|
16
|
+
alias_method :to_h, :to_hash
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixOmniChannel
|
3
|
+
class AcquireTransaction
|
4
|
+
|
5
|
+
attr_accessor(:request_header,
|
6
|
+
:terminal_id,
|
7
|
+
:order_id,
|
8
|
+
:six_transaction_reference
|
9
|
+
)
|
10
|
+
|
11
|
+
def initialize(request_header: nil,
|
12
|
+
terminal_id:,
|
13
|
+
order_id: nil,
|
14
|
+
six_transaction_reference:
|
15
|
+
)
|
16
|
+
@request_header = request_header || SixSaferpay::RequestHeader.new()
|
17
|
+
@terminal_id = terminal_id
|
18
|
+
@order_id = order_id
|
19
|
+
@six_transaction_reference = six_transaction_reference
|
20
|
+
end
|
21
|
+
|
22
|
+
def to_hash
|
23
|
+
hash = Hash.new
|
24
|
+
hash.merge!(request_header: @request_header.to_h) if @request_header
|
25
|
+
hash.merge!(terminal_id: @terminal_id) if @terminal_id
|
26
|
+
hash.merge!(order_id: @order_id) if @order_id
|
27
|
+
hash.merge!(six_transaction_reference: @six_transaction_reference) if @six_transaction_reference
|
28
|
+
hash
|
29
|
+
end
|
30
|
+
alias_method :to_h, :to_hash
|
31
|
+
|
32
|
+
def to_json
|
33
|
+
to_hash.to_json
|
34
|
+
end
|
35
|
+
|
36
|
+
def url
|
37
|
+
'/Payment/v1/OmniChannel/AcquireTransaction'
|
38
|
+
end
|
39
|
+
|
40
|
+
def response_class
|
41
|
+
SixSaferpay::SixOmniChannel::AcquireTransactionResponse
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|