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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.test.env +1 -1
  4. data/.travis.yml +4 -2
  5. data/Gemfile.lock +70 -85
  6. data/README.md +120 -3
  7. data/lib/six_saferpay/api.rb +1 -1
  8. data/lib/six_saferpay/api/six_batch/requests/close.rb +37 -0
  9. data/lib/six_saferpay/api/six_batch/responses/close_response.rb +20 -0
  10. data/lib/six_saferpay/api/six_omni_channel/requests/acquire_transaction.rb +46 -0
  11. data/lib/six_saferpay/api/six_omni_channel/requests/insert_alias.rb +40 -0
  12. data/lib/six_saferpay/api/six_omni_channel/responses/acquire_transaction_response.rb +30 -0
  13. data/lib/six_saferpay/api/six_omni_channel/responses/insert_alias_response.rb +34 -0
  14. data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +4 -0
  15. data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +11 -2
  16. data/lib/six_saferpay/api/six_payment_page/responses/{initalize_response.rb → initialize_response.rb} +0 -0
  17. data/lib/six_saferpay/api/six_secure_card_data/requests/assert_insert.rb +37 -0
  18. data/lib/six_saferpay/api/six_secure_card_data/requests/delete.rb +37 -0
  19. data/lib/six_saferpay/api/six_secure_card_data/requests/insert.rb +66 -0
  20. data/lib/six_saferpay/api/six_secure_card_data/requests/insert_direct.rb +46 -0
  21. data/lib/six_saferpay/api/six_secure_card_data/requests/update.rb +42 -0
  22. data/lib/six_saferpay/api/six_secure_card_data/responses/assert_insert_response.rb +33 -0
  23. data/lib/six_saferpay/api/six_secure_card_data/responses/delete_response.rb +20 -0
  24. data/lib/six_saferpay/api/six_secure_card_data/responses/insert_direct_response.rb +33 -0
  25. data/lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb +33 -0
  26. data/lib/six_saferpay/api/six_secure_card_data/responses/update_response.rb +29 -0
  27. data/lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb +61 -0
  28. data/lib/six_saferpay/api/six_secure_pay_gate_offer/responses/create_offer_response.rb +26 -0
  29. data/lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb +59 -0
  30. data/lib/six_saferpay/api/six_transaction/requests/authorize.rb +1 -1
  31. data/lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb +4 -0
  32. data/lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb +4 -0
  33. data/lib/six_saferpay/api/six_transaction/requests/capture.rb +11 -2
  34. data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +4 -0
  35. data/lib/six_saferpay/api/six_transaction/requests/inquire.rb +36 -0
  36. data/lib/six_saferpay/api/six_transaction/requests/multipart_finalize.rb +38 -0
  37. data/lib/six_saferpay/api/six_transaction/requests/query_alternative_payment.rb +35 -0
  38. data/lib/six_saferpay/api/six_transaction/requests/refund.rb +7 -7
  39. data/lib/six_saferpay/api/six_transaction/requests/refund_direct.rb +46 -0
  40. data/lib/six_saferpay/api/six_transaction/responses/adjust_amount_response.rb +1 -4
  41. data/lib/six_saferpay/api/six_transaction/responses/alternative_payment_response.rb +35 -0
  42. data/lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb +11 -2
  43. data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +11 -3
  44. data/lib/six_saferpay/api/six_transaction/responses/cancel_response.rb +1 -1
  45. data/lib/six_saferpay/api/six_transaction/responses/inquire_response.rb +44 -0
  46. data/lib/six_saferpay/api/six_transaction/responses/multipart_finalize_response.rb +20 -0
  47. data/lib/six_saferpay/api/six_transaction/responses/query_alternative_payment_response.rb +39 -0
  48. data/lib/six_saferpay/api/six_transaction/responses/refund_direct_response.rb +34 -0
  49. data/lib/six_saferpay/client.rb +8 -2
  50. data/lib/six_saferpay/clients/secure_pay_gate_api/client.rb +23 -0
  51. data/lib/six_saferpay/models/address.rb +4 -4
  52. data/lib/six_saferpay/models/alias.rb +22 -0
  53. data/lib/six_saferpay/models/alias_card.rb +20 -0
  54. data/lib/six_saferpay/models/authentication.rb +36 -0
  55. data/lib/six_saferpay/models/authentication_result.rb +20 -0
  56. data/lib/six_saferpay/models/bancontact.rb +20 -0
  57. data/lib/six_saferpay/models/bankcontact.rb +21 -0
  58. data/lib/six_saferpay/models/check.rb +22 -0
  59. data/lib/six_saferpay/models/check_result.rb +27 -0
  60. data/lib/six_saferpay/models/chosen_plan.rb +62 -0
  61. data/lib/six_saferpay/models/custom_plan.rb +4 -0
  62. data/lib/six_saferpay/models/error.rb +0 -28
  63. data/lib/six_saferpay/models/first_installment_amount.rb +4 -0
  64. data/lib/six_saferpay/models/ideal.rb +18 -0
  65. data/lib/six_saferpay/models/installment_fee.rb +4 -0
  66. data/lib/six_saferpay/models/installment_plans.rb +73 -0
  67. data/lib/six_saferpay/models/mastercard_issuer_installments.rb +49 -0
  68. data/lib/six_saferpay/models/notification.rb +4 -4
  69. data/lib/six_saferpay/models/payment_method_options.rb +18 -0
  70. data/lib/six_saferpay/models/payment_methods_options.rb +4 -2
  71. data/lib/six_saferpay/models/pending_notification.rb +4 -4
  72. data/lib/six_saferpay/models/processing_data.rb +18 -0
  73. data/lib/six_saferpay/models/registration_result.rb +11 -2
  74. data/lib/six_saferpay/models/request_payment_means.rb +6 -2
  75. data/lib/six_saferpay/models/response_card.rb +0 -4
  76. data/lib/six_saferpay/models/saferpay_fields.rb +18 -0
  77. data/lib/six_saferpay/models/subsequent_installment_amount.rb +4 -0
  78. data/lib/six_saferpay/models/total_amont_due.rb +4 -0
  79. data/lib/six_saferpay/models/update_alias.rb +20 -0
  80. data/lib/six_saferpay/models/update_payment_means.rb +18 -0
  81. data/lib/six_saferpay/version.rb +1 -1
  82. data/six_saferpay.gemspec +12 -14
  83. metadata +81 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4dcccfabf4b881707c8da788ba5029fe21eb7767f25437a7f7e27f34c064dbd
4
- data.tar.gz: 1f1bc93b10ee325e2dbe154f5d6029ce453dea1523ebd73da2aa201f36cd2824
3
+ metadata.gz: acfb2585b43dd7064f81b0485286f48e2c4b554c7f2d0fe1025bc5eb0cbd4c64
4
+ data.tar.gz: 904a6c58a9da762f04bc601292d89a6dfa27722678f3bcb9ca4146612142184d
5
5
  SHA512:
6
- metadata.gz: d6cd5b2df26536d3b1097755a3c1fbfbfcc1391200b23d79d89bdf2af6fe1d4820b57910627665c5a4607047b4e994e8331ba430f462f0c3388a6ca423f7d902
7
- data.tar.gz: 78593896fb7e48bd4cf92de1f3045fb0071db325bf5d8357c7528d81aa8a7cc637a6a1aed0da3ff9a5e8bfe168f81f9602e926b8b64e58ad57c835ba308cb69b
6
+ metadata.gz: 835973e42bb94eba81cc077a63318b195c89f4f0c35e287fdb38371b641f62317891b9781070199948454047050af115874b8500ca7f5a5b022906743647241f
7
+ data.tar.gz: 542f2e7bcd9781054756cd5e623030cecbc0d98b31201e10d3c2f27055101a1e765c7c92483fbb91e7ee163eea3c67f8bf49bb875a8df248617c17a30dfa05f6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.7.2
data/.test.env CHANGED
@@ -1,5 +1,5 @@
1
1
  SIX_SAFERPAY_CUSTOMER_ID='245294'
2
- SIX_SAFERPAY_TERMINAL_ID='17925560'
2
+ SIX_SAFERPAY_TERMINAL_ID='17925578'
3
3
  SIX_SAFERPAY_USERNAME='API_245294_08700063'
4
4
  SIX_SAFERPAY_PASSWORD='mei4Xoozle4doi0A'
5
5
  SIX_SAFERPAY_FAIL_URL='http://localhost:3004'
data/.travis.yml CHANGED
@@ -3,8 +3,10 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.5.0
7
- before_install: gem install bundler -v 2.0.1
6
+ - 2.7.2
7
+
8
+ before_install:
9
+ - gem install bundler:2.2.8
8
10
 
9
11
  notifications:
10
12
  slack: fadendaten:tWoet2mtObvbwSZSyUAY93jl
data/Gemfile.lock CHANGED
@@ -1,112 +1,97 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- six_saferpay (1.2.1)
5
- activesupport (~> 5.0, >= 5.0.0.0)
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 (5.2.3)
10
+ activesupport (6.1.3)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
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)
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
- 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)
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.8.0)
55
- rspec-mocks (3.8.0)
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.8.0)
58
- rspec-support (3.8.0)
59
- safe_yaml (1.0.5)
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
- 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)
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.5.1)
72
+ webmock (3.11.2)
89
73
  addressable (>= 2.3.6)
90
74
  crack (>= 0.3.2)
91
- hashdiff
92
- wisper (2.0.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.0)
84
+ bundler (~> 2.1)
100
85
  dotenv (~> 2.7, >= 2.7)
101
- pry (~> 0.12.0)
102
- rake (~> 10.0)
86
+ pry (~> 0.13)
87
+ rake (~> 13.0)
103
88
  rspec (~> 3.0)
104
- simplecov (~> 0.16)
89
+ simplecov (~> 0.19)
105
90
  six_saferpay!
106
- spinning_wheel (~> 0.1)
107
- tty-prompt (~> 0.18)
91
+ spinning_wheel (~> 0.2.2)
92
+ tty-prompt (~> 0.22)
108
93
  vcr (~> 4.0, >= 4.0.0)
109
- webmock (~> 3.5, >= 3.5.1)
94
+ webmock (~> 3.10, >= 3.10)
110
95
 
111
96
  BUNDLED WITH
112
- 2.0.1
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
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/six_saferpay`. To experiment with that code, run `bin/console` for an interactive prompt.
7
+ ## Current API Version
7
8
 
8
- TODO: Delete this and the text above, and describe your gem
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
- TODO: Write usage instructions here
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
+
@@ -1,5 +1,5 @@
1
1
  module SixSaferpay
2
2
  module API
3
- VERSION = '1.11'
3
+ VERSION = '1.16'
4
4
  end
5
5
  end
@@ -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