six_saferpay 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/Gemfile.lock +58 -0
- data/lib/six_saferpay/api/six_payment_page/requests/assert.rb +34 -0
- data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +96 -0
- data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +46 -0
- data/lib/six_saferpay/api/six_payment_page/responses/initalize_response.rb +44 -0
- data/lib/six_saferpay/api/six_payment_page.rb +10 -0
- data/lib/six_saferpay/api/six_transaction/requests/authorization.rb +33 -0
- data/lib/six_saferpay/api/six_transaction/requests/cancel.rb +33 -0
- data/lib/six_saferpay/api/six_transaction/requests/capture.rb +54 -0
- data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +73 -0
- data/lib/six_saferpay/api/six_transaction/responses/capture_response.rb +32 -0
- data/lib/six_saferpay/api/six_transaction/responses/initialize_response.rb +12 -0
- data/lib/six_saferpay/api/six_transaction.rb +4 -0
- data/lib/six_saferpay/api.rb +1 -4
- data/lib/six_saferpay/client.rb +17 -5
- data/lib/six_saferpay/error.rb +11 -0
- data/lib/six_saferpay/model.rb +5 -0
- data/lib/six_saferpay/models/address.rb +73 -0
- data/lib/six_saferpay/models/address_form.rb +21 -0
- data/lib/six_saferpay/models/alias.rb +23 -0
- data/lib/six_saferpay/models/alipay.rb +18 -0
- data/lib/six_saferpay/models/amount.rb +19 -0
- data/lib/six_saferpay/models/bank_account.rb +35 -0
- data/lib/six_saferpay/models/billing_address.rb +4 -0
- data/lib/six_saferpay/models/billing_address_form.rb +4 -0
- data/lib/six_saferpay/models/billpay.rb +18 -0
- data/lib/six_saferpay/models/brand.rb +20 -0
- data/lib/six_saferpay/models/card.rb +40 -0
- data/lib/six_saferpay/models/card_form.rb +18 -0
- data/lib/six_saferpay/models/client_info.rb +20 -0
- data/lib/six_saferpay/models/dcc.rb +18 -0
- data/lib/six_saferpay/models/debit_direct.rb +20 -0
- data/lib/six_saferpay/models/delivery_address.rb +4 -0
- data/lib/six_saferpay/models/delivery_address_form.rb +4 -0
- data/lib/six_saferpay/models/fee.rb +4 -0
- data/lib/six_saferpay/models/fee_refund.rb +4 -0
- data/lib/six_saferpay/models/installment.rb +18 -0
- data/lib/six_saferpay/models/invoice.rb +22 -0
- data/lib/six_saferpay/models/liability.rb +36 -0
- data/lib/six_saferpay/models/marketplace.rb +22 -0
- data/lib/six_saferpay/models/notification.rb +26 -0
- data/lib/six_saferpay/models/options.rb +18 -0
- data/lib/six_saferpay/models/payee.rb +23 -0
- data/lib/six_saferpay/models/payer.rb +27 -7
- data/lib/six_saferpay/models/payer_amount.rb +22 -0
- data/lib/six_saferpay/models/payment.rb +33 -14
- data/lib/six_saferpay/models/payment_means.rb +40 -0
- data/lib/six_saferpay/models/payment_methods_options.rb +18 -0
- data/lib/six_saferpay/models/pending_notification.rb +20 -0
- data/lib/six_saferpay/models/recurring.rb +18 -0
- data/lib/six_saferpay/models/register_alias.rb +23 -0
- data/lib/six_saferpay/models/registration_result.rb +27 -0
- data/lib/six_saferpay/models/request_header.rb +12 -11
- data/lib/six_saferpay/models/response_header.rb +20 -0
- data/lib/six_saferpay/models/return_urls.rb +12 -10
- data/lib/six_saferpay/models/six_transaction/initialize/card.rb +44 -0
- data/lib/six_saferpay/models/six_transaction/initialize/payment_means.rb +32 -0
- data/lib/six_saferpay/models/six_transaction/initialize.rb +6 -0
- data/lib/six_saferpay/models/six_transaction.rb +4 -0
- data/lib/six_saferpay/models/styling.rb +12 -7
- data/lib/six_saferpay/models/terminal.rb +14 -14
- data/lib/six_saferpay/models/three_ds.rb +28 -0
- data/lib/six_saferpay/models/transaction.rb +69 -0
- data/lib/six_saferpay/models/transaction_reference.rb +11 -7
- data/lib/six_saferpay/models/twint.rb +18 -0
- data/lib/six_saferpay/models/verification_code.rb +4 -2
- data/lib/six_saferpay/models/wallet.rb +32 -0
- data/lib/six_saferpay/version.rb +1 -1
- data/lib/six_saferpay.rb +6 -15
- data/six_saferpay.gemspec +12 -5
- metadata +131 -15
- data/.rspec_status +0 -28
- data/lib/six_saferpay/api/payment_page/assert.rb +0 -30
- data/lib/six_saferpay/api/payment_page/initialize.rb +0 -35
- data/lib/six_saferpay/api/payment_page.rb +0 -20
- data/lib/six_saferpay/api/transaction/authorization.rb +0 -31
- data/lib/six_saferpay/api/transaction/cancel.rb +0 -31
- data/lib/six_saferpay/api/transaction/capture.rb +0 -31
- data/lib/six_saferpay/api/transaction/initialize.rb +0 -36
- data/lib/six_saferpay/api/transaction.rb +0 -22
- data/lib/six_saferpay/models/token.rb +0 -18
data/lib/six_saferpay.rb
CHANGED
@@ -1,23 +1,14 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
3
|
-
require 'six_saferpay/version'
|
4
|
-
|
5
|
-
require 'six_saferpay/models/payer'
|
6
|
-
require 'six_saferpay/models/payment'
|
7
|
-
require 'six_saferpay/models/request_header'
|
8
|
-
require 'six_saferpay/models/return_urls'
|
9
|
-
require 'six_saferpay/models/styling'
|
10
|
-
require 'six_saferpay/models/terminal'
|
11
|
-
require 'six_saferpay/models/token'
|
12
|
-
require 'six_saferpay/models/transaction_reference'
|
13
|
-
require 'six_saferpay/models/verification_code'
|
14
|
-
|
1
|
+
require 'active_support/core_ext/hash'
|
2
|
+
require 'active_support/core_ext/string'
|
15
3
|
require 'securerandom'
|
16
4
|
require 'json'
|
17
5
|
require 'net/http'
|
18
6
|
|
7
|
+
Dir[File.join("./lib/six_saferpay/", "**/*.rb")].sort.each do |file|
|
8
|
+
require file
|
9
|
+
end
|
10
|
+
|
19
11
|
module SixSaferpay
|
20
|
-
class Error < StandardError; end
|
21
12
|
|
22
13
|
class Config
|
23
14
|
attr_accessor :customer_id, # ID of the Customer by SIX Saferpay
|
data/six_saferpay.gemspec
CHANGED
@@ -23,10 +23,17 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
+
spec.add_runtime_dependency 'activesupport', '>= 5.0.0.0'
|
27
|
+
|
28
|
+
|
29
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
30
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
31
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
32
|
+
spec.add_development_dependency 'vcr', '~> 4.0.0'
|
33
|
+
spec.add_development_dependency 'webmock', '~> 3.5.1'
|
34
|
+
spec.add_development_dependency 'dotenv', '~> 2.7.0'
|
35
|
+
spec.add_development_dependency 'pry', '~> 0.12.0'
|
36
|
+
spec.add_development_dependency 'tty-prompt', '~> 0.18'
|
37
|
+
spec.add_development_dependency 'simplecov', '~> 0.16'
|
26
38
|
|
27
|
-
spec.add_development_dependency "bundler", "~> 2.0"
|
28
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
30
|
-
spec.add_development_dependency "pry", "~> 0.12.0"
|
31
|
-
spec.add_development_dependency "dotenv", "~> 2.7.0"
|
32
39
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: six_saferpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Langenegger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.0.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.0.0.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,19 +67,33 @@ dependencies:
|
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '3.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: vcr
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
75
|
+
version: 4.0.0
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
82
|
+
version: 4.0.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: webmock
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.5.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.5.1
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: dotenv
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +108,48 @@ dependencies:
|
|
80
108
|
- - "~>"
|
81
109
|
- !ruby/object:Gem::Version
|
82
110
|
version: 2.7.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.12.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.12.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: tty-prompt
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.18'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.18'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.16'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.16'
|
83
153
|
description: Write a longer description or delete this line.
|
84
154
|
email:
|
85
155
|
- felix.langenegger@fadendaten.ch
|
@@ -89,7 +159,6 @@ extra_rdoc_files: []
|
|
89
159
|
files:
|
90
160
|
- ".gitignore"
|
91
161
|
- ".rspec"
|
92
|
-
- ".rspec_status"
|
93
162
|
- ".ruby-version"
|
94
163
|
- ".test.env"
|
95
164
|
- ".travis.yml"
|
@@ -102,24 +171,71 @@ files:
|
|
102
171
|
- bin/setup
|
103
172
|
- lib/six_saferpay.rb
|
104
173
|
- lib/six_saferpay/api.rb
|
105
|
-
- lib/six_saferpay/api/
|
106
|
-
- lib/six_saferpay/api/
|
107
|
-
- lib/six_saferpay/api/
|
108
|
-
- lib/six_saferpay/api/
|
109
|
-
- lib/six_saferpay/api/
|
110
|
-
- lib/six_saferpay/api/
|
111
|
-
- lib/six_saferpay/api/
|
112
|
-
- lib/six_saferpay/api/
|
174
|
+
- lib/six_saferpay/api/six_payment_page.rb
|
175
|
+
- lib/six_saferpay/api/six_payment_page/requests/assert.rb
|
176
|
+
- lib/six_saferpay/api/six_payment_page/requests/initialize.rb
|
177
|
+
- lib/six_saferpay/api/six_payment_page/responses/assert_response.rb
|
178
|
+
- lib/six_saferpay/api/six_payment_page/responses/initalize_response.rb
|
179
|
+
- lib/six_saferpay/api/six_transaction.rb
|
180
|
+
- lib/six_saferpay/api/six_transaction/requests/authorization.rb
|
181
|
+
- lib/six_saferpay/api/six_transaction/requests/cancel.rb
|
182
|
+
- lib/six_saferpay/api/six_transaction/requests/capture.rb
|
183
|
+
- lib/six_saferpay/api/six_transaction/requests/initialize.rb
|
184
|
+
- lib/six_saferpay/api/six_transaction/responses/capture_response.rb
|
185
|
+
- lib/six_saferpay/api/six_transaction/responses/initialize_response.rb
|
113
186
|
- lib/six_saferpay/client.rb
|
187
|
+
- lib/six_saferpay/error.rb
|
188
|
+
- lib/six_saferpay/model.rb
|
189
|
+
- lib/six_saferpay/models/address.rb
|
190
|
+
- lib/six_saferpay/models/address_form.rb
|
191
|
+
- lib/six_saferpay/models/alias.rb
|
192
|
+
- lib/six_saferpay/models/alipay.rb
|
193
|
+
- lib/six_saferpay/models/amount.rb
|
194
|
+
- lib/six_saferpay/models/bank_account.rb
|
195
|
+
- lib/six_saferpay/models/billing_address.rb
|
196
|
+
- lib/six_saferpay/models/billing_address_form.rb
|
197
|
+
- lib/six_saferpay/models/billpay.rb
|
198
|
+
- lib/six_saferpay/models/brand.rb
|
199
|
+
- lib/six_saferpay/models/card.rb
|
200
|
+
- lib/six_saferpay/models/card_form.rb
|
201
|
+
- lib/six_saferpay/models/client_info.rb
|
202
|
+
- lib/six_saferpay/models/dcc.rb
|
203
|
+
- lib/six_saferpay/models/debit_direct.rb
|
204
|
+
- lib/six_saferpay/models/delivery_address.rb
|
205
|
+
- lib/six_saferpay/models/delivery_address_form.rb
|
206
|
+
- lib/six_saferpay/models/fee.rb
|
207
|
+
- lib/six_saferpay/models/fee_refund.rb
|
208
|
+
- lib/six_saferpay/models/installment.rb
|
209
|
+
- lib/six_saferpay/models/invoice.rb
|
210
|
+
- lib/six_saferpay/models/liability.rb
|
211
|
+
- lib/six_saferpay/models/marketplace.rb
|
212
|
+
- lib/six_saferpay/models/notification.rb
|
213
|
+
- lib/six_saferpay/models/options.rb
|
214
|
+
- lib/six_saferpay/models/payee.rb
|
114
215
|
- lib/six_saferpay/models/payer.rb
|
216
|
+
- lib/six_saferpay/models/payer_amount.rb
|
115
217
|
- lib/six_saferpay/models/payment.rb
|
218
|
+
- lib/six_saferpay/models/payment_means.rb
|
219
|
+
- lib/six_saferpay/models/payment_methods_options.rb
|
220
|
+
- lib/six_saferpay/models/pending_notification.rb
|
221
|
+
- lib/six_saferpay/models/recurring.rb
|
222
|
+
- lib/six_saferpay/models/register_alias.rb
|
223
|
+
- lib/six_saferpay/models/registration_result.rb
|
116
224
|
- lib/six_saferpay/models/request_header.rb
|
225
|
+
- lib/six_saferpay/models/response_header.rb
|
117
226
|
- lib/six_saferpay/models/return_urls.rb
|
227
|
+
- lib/six_saferpay/models/six_transaction.rb
|
228
|
+
- lib/six_saferpay/models/six_transaction/initialize.rb
|
229
|
+
- lib/six_saferpay/models/six_transaction/initialize/card.rb
|
230
|
+
- lib/six_saferpay/models/six_transaction/initialize/payment_means.rb
|
118
231
|
- lib/six_saferpay/models/styling.rb
|
119
232
|
- lib/six_saferpay/models/terminal.rb
|
120
|
-
- lib/six_saferpay/models/
|
233
|
+
- lib/six_saferpay/models/three_ds.rb
|
234
|
+
- lib/six_saferpay/models/transaction.rb
|
121
235
|
- lib/six_saferpay/models/transaction_reference.rb
|
236
|
+
- lib/six_saferpay/models/twint.rb
|
122
237
|
- lib/six_saferpay/models/verification_code.rb
|
238
|
+
- lib/six_saferpay/models/wallet.rb
|
123
239
|
- lib/six_saferpay/version.rb
|
124
240
|
- six_saferpay.gemspec
|
125
241
|
homepage: http://fadendaten.ch
|
data/.rspec_status
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
example_id | status | run_time |
|
2
|
-
--------------------------------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/six_saferpay/api/payment_page/assert_spec.rb[1:1:1] | passed | 0.00097 seconds |
|
4
|
-
./spec/six_saferpay/api/payment_page/assert_spec.rb[1:2:1] | passed | 0.00019 seconds |
|
5
|
-
./spec/six_saferpay/api/payment_page/assert_spec.rb[1:3:1] | passed | 0.00008 seconds |
|
6
|
-
./spec/six_saferpay/api/payment_page/initialize_spec.rb[1:1:1] | passed | 0.00021 seconds |
|
7
|
-
./spec/six_saferpay/api/payment_page/initialize_spec.rb[1:2:1] | passed | 0.0002 seconds |
|
8
|
-
./spec/six_saferpay/api/payment_page/initialize_spec.rb[1:3:1] | passed | 0.00014 seconds |
|
9
|
-
./spec/six_saferpay/api/transaction/cancel_spec.rb[1:1:1] | passed | 0.00021 seconds |
|
10
|
-
./spec/six_saferpay/api/transaction/cancel_spec.rb[1:2:1] | passed | 0.00015 seconds |
|
11
|
-
./spec/six_saferpay/api/transaction/cancel_spec.rb[1:3:1] | passed | 0.00012 seconds |
|
12
|
-
./spec/six_saferpay/api/transaction/capture_spec.rb[1:1:1] | passed | 0.00019 seconds |
|
13
|
-
./spec/six_saferpay/api/transaction/capture_spec.rb[1:2:1] | passed | 0.00014 seconds |
|
14
|
-
./spec/six_saferpay/api/transaction/capture_spec.rb[1:3:1] | passed | 0.00013 seconds |
|
15
|
-
./spec/six_saferpay/client_spec.rb[1:1:1] | passed | 0.00923 seconds |
|
16
|
-
./spec/six_saferpay/client_spec.rb[1:2:1] | passed | 0.00295 seconds |
|
17
|
-
./spec/six_saferpay/models/payer_spec.rb[1:1:1] | passed | 0.00023 seconds |
|
18
|
-
./spec/six_saferpay/models/payment_spec.rb[1:1:1] | passed | 0.00087 seconds |
|
19
|
-
./spec/six_saferpay/models/request_header_spec.rb[1:1:1] | passed | 0.00026 seconds |
|
20
|
-
./spec/six_saferpay/models/return_urls_spec.rb[1:1:1] | passed | 0.00067 seconds |
|
21
|
-
./spec/six_saferpay/models/styling_spec.rb[1:1:1] | passed | 0.00014 seconds |
|
22
|
-
./spec/six_saferpay/models/terminal_spec.rb[1:1:1] | passed | 0.00076 seconds |
|
23
|
-
./spec/six_saferpay/models/token_spec.rb[1:1:1] | passed | 0.00013 seconds |
|
24
|
-
./spec/six_saferpay/models/transaction_reference_spec.rb[1:1:1] | passed | 0.00094 seconds |
|
25
|
-
./spec/six_saferpay/models/verification_code_spec.rb[1:1:1] | passed | 0.00016 seconds |
|
26
|
-
./spec/six_saferpay_spec.rb[1:1] | passed | 0.00413 seconds |
|
27
|
-
./spec/six_saferpay_spec.rb[1:2:1] | passed | 0.0024 seconds |
|
28
|
-
./spec/six_saferpay_spec.rb[1:2:2] | passed | 0.00563 seconds |
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module SixSaferpay
|
2
|
-
module PaymentPage
|
3
|
-
class Assert
|
4
|
-
|
5
|
-
attr_accessor :request_header, :token
|
6
|
-
|
7
|
-
def initialize(token)
|
8
|
-
@request_header = SixSaferpay::RequestHeader.new
|
9
|
-
@token = SixSaferpay::Token.new(token)
|
10
|
-
end
|
11
|
-
|
12
|
-
def to_hash
|
13
|
-
hash = Hash.new
|
14
|
-
hash.merge!(@request_header.to_h)
|
15
|
-
hash.merge!(@token.to_h)
|
16
|
-
hash
|
17
|
-
end
|
18
|
-
alias_method :to_h, :to_hash
|
19
|
-
|
20
|
-
def to_json
|
21
|
-
to_hash.to_json
|
22
|
-
end
|
23
|
-
|
24
|
-
def url
|
25
|
-
'/Payment/v1/PaymentPage/Assert'
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module SixSaferpay
|
2
|
-
module PaymentPage
|
3
|
-
class Initialize
|
4
|
-
|
5
|
-
attr_accessor :request_header, :terminal_id, :payment, :return_urls
|
6
|
-
|
7
|
-
def initialize(value, currency, order_id, description)
|
8
|
-
@request_header = SixSaferpay::RequestHeader.new
|
9
|
-
@terminal_id = SixSaferpay::Terminal.new
|
10
|
-
@payment = SixSaferpay::Payment
|
11
|
-
.new(value, currency, order_id, description)
|
12
|
-
@return_urls = SixSaferpay::ReturnUrls.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_hash
|
16
|
-
hash = Hash.new
|
17
|
-
hash.merge!(@request_header.to_h)
|
18
|
-
hash.merge!(@terminal_id.to_h)
|
19
|
-
hash.merge!(@payment.to_h)
|
20
|
-
hash.merge!(@return_urls.to_h)
|
21
|
-
hash
|
22
|
-
end
|
23
|
-
alias_method :to_h, :to_hash
|
24
|
-
|
25
|
-
def to_json
|
26
|
-
to_hash.to_json
|
27
|
-
end
|
28
|
-
|
29
|
-
def url
|
30
|
-
'/Payment/v1/PaymentPage/Initialize'
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'six_saferpay/api/payment_page/assert'
|
2
|
-
require 'six_saferpay/api/payment_page/initialize'
|
3
|
-
|
4
|
-
module SixSaferpay
|
5
|
-
module PaymentPage
|
6
|
-
|
7
|
-
def to_hash
|
8
|
-
end
|
9
|
-
|
10
|
-
def to_h
|
11
|
-
end
|
12
|
-
|
13
|
-
def to_json
|
14
|
-
end
|
15
|
-
|
16
|
-
def url
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module SixSaferpay
|
2
|
-
module Transaction
|
3
|
-
class Authorization
|
4
|
-
|
5
|
-
attr_accessor :request_header, :token, :verification_code
|
6
|
-
|
7
|
-
def initialize(token, code)
|
8
|
-
@request_header = SixSaferpay::RequestHeader.new
|
9
|
-
@token = SixSaferpay::Token.new(token)
|
10
|
-
@verification_code = SixSaferpay::VerificationCode.new(code)
|
11
|
-
end
|
12
|
-
|
13
|
-
def to_hash
|
14
|
-
hash = Hash.new
|
15
|
-
hash.merge!(@request_header.to_h)
|
16
|
-
hash.merge!(@token.to_h)
|
17
|
-
hash.merge!(@verification_code.to_h)
|
18
|
-
hash
|
19
|
-
end
|
20
|
-
alias_method :to_h, :to_hash
|
21
|
-
|
22
|
-
def to_json
|
23
|
-
to_hash.to_json
|
24
|
-
end
|
25
|
-
|
26
|
-
def url
|
27
|
-
'/Payment/v1/Transaction/Authorize'
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module SixSaferpay
|
2
|
-
module Transaction
|
3
|
-
class Cancel
|
4
|
-
|
5
|
-
attr_accessor :request_header, :transaction_reference
|
6
|
-
|
7
|
-
def initialize(transaction_id)
|
8
|
-
@request_header = SixSaferpay::RequestHeader.new
|
9
|
-
@transaction_reference = SixSaferpay::TransactionReference
|
10
|
-
.new(transaction_id)
|
11
|
-
end
|
12
|
-
|
13
|
-
def to_hash
|
14
|
-
hash = Hash.new
|
15
|
-
hash.merge!(@request_header.to_h)
|
16
|
-
hash.merge!(@transaction_reference.to_h)
|
17
|
-
hash
|
18
|
-
end
|
19
|
-
alias_method :to_h, :to_hash
|
20
|
-
|
21
|
-
def to_json
|
22
|
-
to_hash.to_json
|
23
|
-
end
|
24
|
-
|
25
|
-
def url
|
26
|
-
'/Payment/v1/Transaction/Cancel'
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module SixSaferpay
|
2
|
-
module Transaction
|
3
|
-
class Capture
|
4
|
-
|
5
|
-
attr_accessor :request_header, :transaction_reference
|
6
|
-
|
7
|
-
def initialize(transaction_id)
|
8
|
-
@request_header = SixSaferpay::RequestHeader.new
|
9
|
-
@transaction_reference = SixSaferpay::TransactionReference
|
10
|
-
.new(transaction_id)
|
11
|
-
end
|
12
|
-
|
13
|
-
def to_hash
|
14
|
-
hash = Hash.new
|
15
|
-
hash.merge!(@request_header.to_h)
|
16
|
-
hash.merge!(@transaction_reference.to_h)
|
17
|
-
hash
|
18
|
-
end
|
19
|
-
alias_method :to_h, :to_hash
|
20
|
-
|
21
|
-
def to_json
|
22
|
-
to_hash.to_json
|
23
|
-
end
|
24
|
-
|
25
|
-
def url
|
26
|
-
'/Payment/v1/Transaction/Capture'
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module SixSaferpay
|
2
|
-
module Transaction
|
3
|
-
class Initialize
|
4
|
-
|
5
|
-
def initialize(value, currency, order_id, description, language)
|
6
|
-
@request_header = SixSaferpay::RequestHeader.new
|
7
|
-
@terminal_id = SixSaferpay::Terminal.new
|
8
|
-
@payment = SixSaferpay::Payment
|
9
|
-
.new(value, currency, order_id, description)
|
10
|
-
@payer = SixSaferpay::Payer.new(language)
|
11
|
-
@return_urls = SixSaferpay::ReturnUrls.new
|
12
|
-
@styling = SixSaferpay::Styling.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_hash
|
16
|
-
hash = Hash.new
|
17
|
-
hash.merge!(@request_header.to_h)
|
18
|
-
hash.merge!(@terminal_id.to_h)
|
19
|
-
hash.merge!(@payment.to_h)
|
20
|
-
hash.merge!(@payer.to_h)
|
21
|
-
hash.merge!(@styling.to_h)
|
22
|
-
hash.merge!(@return_urls.to_h)
|
23
|
-
hash
|
24
|
-
end
|
25
|
-
alias_method :to_h, :to_hash
|
26
|
-
|
27
|
-
def to_json
|
28
|
-
to_hash.to_json
|
29
|
-
end
|
30
|
-
|
31
|
-
def url
|
32
|
-
'/Payment/v1/Transaction/Initialize'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'six_saferpay/api/transaction/authorization'
|
2
|
-
require 'six_saferpay/api/transaction/cancel'
|
3
|
-
require 'six_saferpay/api/transaction/capture'
|
4
|
-
require 'six_saferpay/api/transaction/initialize'
|
5
|
-
|
6
|
-
module SixSaferpay
|
7
|
-
module Transaction
|
8
|
-
|
9
|
-
def to_hash
|
10
|
-
end
|
11
|
-
|
12
|
-
def to_h
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_json
|
16
|
-
end
|
17
|
-
|
18
|
-
def url
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|