six_saferpay 0.1.10 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +8 -5
  3. data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +3 -4
  4. data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +1 -1
  5. data/lib/six_saferpay/api/six_payment_page/responses/initalize_response.rb +0 -11
  6. data/lib/six_saferpay/api/six_transaction/requests/authorize.rb +45 -0
  7. data/lib/six_saferpay/api/six_transaction/requests/cancel.rb +20 -22
  8. data/lib/six_saferpay/api/six_transaction/requests/capture.rb +1 -0
  9. data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +61 -62
  10. data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +47 -0
  11. data/lib/six_saferpay/api/six_transaction/responses/cancel_response.rb +34 -0
  12. data/lib/six_saferpay/api/six_transaction/responses/capture_response.rb +2 -1
  13. data/lib/six_saferpay/api/six_transaction/responses/initialize_response.rb +34 -5
  14. data/lib/six_saferpay/client.rb +8 -4
  15. data/lib/six_saferpay/models/address_form.rb +5 -4
  16. data/lib/six_saferpay/models/amount.rb +4 -3
  17. data/lib/six_saferpay/models/bank_account.rb +7 -6
  18. data/lib/six_saferpay/models/brand.rb +4 -4
  19. data/lib/six_saferpay/models/client_info.rb +3 -3
  20. data/lib/six_saferpay/models/direct_debit.rb +20 -0
  21. data/lib/six_saferpay/models/error.rb +28 -0
  22. data/lib/six_saferpay/models/fee_refund.rb +1 -1
  23. data/lib/six_saferpay/models/fraud_free.rb +5 -5
  24. data/lib/six_saferpay/models/installment.rb +1 -1
  25. data/lib/six_saferpay/models/invoice.rb +5 -5
  26. data/lib/six_saferpay/models/liability.rb +6 -6
  27. data/lib/six_saferpay/models/options.rb +1 -1
  28. data/lib/six_saferpay/models/payee.rb +1 -20
  29. data/lib/six_saferpay/models/payment.rb +1 -1
  30. data/lib/six_saferpay/models/{alias.rb → payment_means_alias.rb} +5 -5
  31. data/lib/six_saferpay/models/payment_methods_options.rb +1 -1
  32. data/lib/six_saferpay/models/redirect.rb +22 -0
  33. data/lib/six_saferpay/models/register_alias.rb +1 -3
  34. data/lib/six_saferpay/models/registration_alias.rb +23 -0
  35. data/lib/six_saferpay/models/registration_error.rb +25 -0
  36. data/lib/six_saferpay/models/registration_result.rb +8 -6
  37. data/lib/six_saferpay/models/request_card.rb +36 -0
  38. data/lib/six_saferpay/models/request_header.rb +14 -10
  39. data/lib/six_saferpay/models/request_payment_means.rb +29 -0
  40. data/lib/six_saferpay/models/response_card.rb +48 -0
  41. data/lib/six_saferpay/models/response_header.rb +4 -4
  42. data/lib/six_saferpay/models/{payment_means.rb → response_payment_means.rb} +11 -11
  43. data/lib/six_saferpay/models/return_urls.rb +9 -9
  44. data/lib/six_saferpay/models/styling.rb +1 -1
  45. data/lib/six_saferpay/models/three_ds.rb +6 -5
  46. data/lib/six_saferpay/models/transaction.rb +15 -15
  47. data/lib/six_saferpay/models/twint.rb +3 -3
  48. data/lib/six_saferpay/models/wallet.rb +6 -6
  49. data/lib/six_saferpay/version.rb +1 -1
  50. data/six_saferpay.gemspec +1 -0
  51. metadata +29 -15
  52. data/lib/six_saferpay/api/six_payment_page.rb +0 -10
  53. data/lib/six_saferpay/api/six_transaction/requests/authorization.rb +0 -33
  54. data/lib/six_saferpay/api/six_transaction.rb +0 -4
  55. data/lib/six_saferpay/error.rb +0 -11
  56. data/lib/six_saferpay/model.rb +0 -5
  57. data/lib/six_saferpay/models/card.rb +0 -40
  58. data/lib/six_saferpay/models/debit_direct.rb +0 -20
  59. data/lib/six_saferpay/models/six_transaction/initialize/card.rb +0 -44
  60. data/lib/six_saferpay/models/six_transaction/initialize/payment_means.rb +0 -32
  61. data/lib/six_saferpay/models/six_transaction/initialize.rb +0 -6
  62. data/lib/six_saferpay/models/verification_code.rb +0 -18
@@ -19,12 +19,12 @@ module SixSaferpay
19
19
  end
20
20
 
21
21
  def to_hash
22
- body = Hash.new
23
- body.merge!(Type: @type)
24
- body.merge!(PaymentMethods: @payment_methods) if @payment_methods
25
- body.merge!(RequestDeliveryAddress: @request_delivery_address) if @request_delivery_address
26
- body.merge!(EnableAmountAdjustment: @enable_amount_adjustment) if @enable_amount_adjustment
27
- body
22
+ hash = Hash.new
23
+ hash.merge!(type: @type)
24
+ hash.merge!(payment_methods: @payment_methods) if @payment_methods
25
+ hash.merge!(request_delivery_address: @request_delivery_address) if @request_delivery_address
26
+ hash.merge!(enable_amount_adjustment: @enable_amount_adjustment) if @enable_amount_adjustment
27
+ hash
28
28
  end
29
29
  alias_method :to_h, :to_hash
30
30
 
@@ -1,3 +1,3 @@
1
1
  module SixSaferpay
2
- VERSION = "0.1.10"
2
+ VERSION = "1.0.0"
3
3
  end
data/six_saferpay.gemspec CHANGED
@@ -35,5 +35,6 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'pry', '~> 0.12.0'
36
36
  spec.add_development_dependency 'tty-prompt', '~> 0.18'
37
37
  spec.add_development_dependency 'simplecov', '~> 0.16'
38
+ spec.add_development_dependency 'spinning_wheel', '~> 0.1'
38
39
 
39
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six_saferpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 1.0.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-05-20 00:00:00.000000000 Z
11
+ date: 2019-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -174,6 +174,20 @@ dependencies:
174
174
  - - "~>"
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0.16'
177
+ - !ruby/object:Gem::Dependency
178
+ name: spinning_wheel
179
+ requirement: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: '0.1'
184
+ type: :development
185
+ prerelease: false
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - "~>"
189
+ - !ruby/object:Gem::Version
190
+ version: '0.1'
177
191
  description: Write a longer description or delete this line.
178
192
  email:
179
193
  - felix.langenegger@fadendaten.ch
@@ -195,25 +209,22 @@ files:
195
209
  - bin/setup
196
210
  - lib/six_saferpay.rb
197
211
  - lib/six_saferpay/api.rb
198
- - lib/six_saferpay/api/six_payment_page.rb
199
212
  - lib/six_saferpay/api/six_payment_page/requests/assert.rb
200
213
  - lib/six_saferpay/api/six_payment_page/requests/initialize.rb
201
214
  - lib/six_saferpay/api/six_payment_page/responses/assert_response.rb
202
215
  - lib/six_saferpay/api/six_payment_page/responses/initalize_response.rb
203
- - lib/six_saferpay/api/six_transaction.rb
204
- - lib/six_saferpay/api/six_transaction/requests/authorization.rb
216
+ - lib/six_saferpay/api/six_transaction/requests/authorize.rb
205
217
  - lib/six_saferpay/api/six_transaction/requests/cancel.rb
206
218
  - lib/six_saferpay/api/six_transaction/requests/capture.rb
207
219
  - lib/six_saferpay/api/six_transaction/requests/initialize.rb
220
+ - lib/six_saferpay/api/six_transaction/responses/authorize_response.rb
221
+ - lib/six_saferpay/api/six_transaction/responses/cancel_response.rb
208
222
  - lib/six_saferpay/api/six_transaction/responses/capture_response.rb
209
223
  - lib/six_saferpay/api/six_transaction/responses/initialize_response.rb
210
224
  - lib/six_saferpay/client.rb
211
- - lib/six_saferpay/error.rb
212
225
  - lib/six_saferpay/errors/error.rb
213
- - lib/six_saferpay/model.rb
214
226
  - lib/six_saferpay/models/address.rb
215
227
  - lib/six_saferpay/models/address_form.rb
216
- - lib/six_saferpay/models/alias.rb
217
228
  - lib/six_saferpay/models/alipay.rb
218
229
  - lib/six_saferpay/models/amount.rb
219
230
  - lib/six_saferpay/models/bank_account.rb
@@ -221,13 +232,13 @@ files:
221
232
  - lib/six_saferpay/models/billing_address_form.rb
222
233
  - lib/six_saferpay/models/billpay.rb
223
234
  - lib/six_saferpay/models/brand.rb
224
- - lib/six_saferpay/models/card.rb
225
235
  - lib/six_saferpay/models/card_form.rb
226
236
  - lib/six_saferpay/models/client_info.rb
227
237
  - lib/six_saferpay/models/dcc.rb
228
- - lib/six_saferpay/models/debit_direct.rb
229
238
  - lib/six_saferpay/models/delivery_address.rb
230
239
  - lib/six_saferpay/models/delivery_address_form.rb
240
+ - lib/six_saferpay/models/direct_debit.rb
241
+ - lib/six_saferpay/models/error.rb
231
242
  - lib/six_saferpay/models/fee.rb
232
243
  - lib/six_saferpay/models/fee_refund.rb
233
244
  - lib/six_saferpay/models/fraud_free.rb
@@ -241,25 +252,28 @@ files:
241
252
  - lib/six_saferpay/models/payer.rb
242
253
  - lib/six_saferpay/models/payer_amount.rb
243
254
  - lib/six_saferpay/models/payment.rb
244
- - lib/six_saferpay/models/payment_means.rb
255
+ - lib/six_saferpay/models/payment_means_alias.rb
245
256
  - lib/six_saferpay/models/payment_methods_options.rb
246
257
  - lib/six_saferpay/models/pending_notification.rb
247
258
  - lib/six_saferpay/models/recurring.rb
259
+ - lib/six_saferpay/models/redirect.rb
248
260
  - lib/six_saferpay/models/register_alias.rb
261
+ - lib/six_saferpay/models/registration_alias.rb
262
+ - lib/six_saferpay/models/registration_error.rb
249
263
  - lib/six_saferpay/models/registration_result.rb
264
+ - lib/six_saferpay/models/request_card.rb
250
265
  - lib/six_saferpay/models/request_header.rb
266
+ - lib/six_saferpay/models/request_payment_means.rb
267
+ - lib/six_saferpay/models/response_card.rb
251
268
  - lib/six_saferpay/models/response_header.rb
269
+ - lib/six_saferpay/models/response_payment_means.rb
252
270
  - lib/six_saferpay/models/return_urls.rb
253
271
  - lib/six_saferpay/models/six_transaction.rb
254
- - lib/six_saferpay/models/six_transaction/initialize.rb
255
- - lib/six_saferpay/models/six_transaction/initialize/card.rb
256
- - lib/six_saferpay/models/six_transaction/initialize/payment_means.rb
257
272
  - lib/six_saferpay/models/styling.rb
258
273
  - lib/six_saferpay/models/three_ds.rb
259
274
  - lib/six_saferpay/models/transaction.rb
260
275
  - lib/six_saferpay/models/transaction_reference.rb
261
276
  - lib/six_saferpay/models/twint.rb
262
- - lib/six_saferpay/models/verification_code.rb
263
277
  - lib/six_saferpay/models/wallet.rb
264
278
  - lib/six_saferpay/version.rb
265
279
  - six_saferpay.gemspec
@@ -1,10 +0,0 @@
1
- require 'six_saferpay/api/six_payment_page/requests/assert'
2
- require 'six_saferpay/api/six_payment_page/requests/initialize'
3
-
4
- require 'six_saferpay/api/six_payment_page/responses/initalize_response'
5
- require 'six_saferpay/api/six_payment_page/responses/assert_response'
6
-
7
- module SixSaferpay
8
- module SixPaymentPage
9
- end
10
- end
@@ -1,33 +0,0 @@
1
- module SixSaferpay
2
- module API
3
- module SixTransaction
4
- class Authorization
5
-
6
- attr_accessor :request_header, :token, :verification_code
7
-
8
- def initialize(token, code)
9
- @request_header = SixSaferpay::RequestHeader.new
10
- @token = SixSaferpay::Token.new(token)
11
- @verification_code = SixSaferpay::VerificationCode.new(code)
12
- end
13
-
14
- def to_hash
15
- hash = Hash.new
16
- hash.merge!(@request_header.to_h)
17
- hash.merge!(@token.to_h)
18
- hash.merge!(@verification_code.to_h)
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/Transaction/Authorize'
29
- end
30
- end
31
- end
32
- end
33
- end
@@ -1,4 +0,0 @@
1
- module SixSaferpay
2
- module SixTransaction
3
- end
4
- end
@@ -1,11 +0,0 @@
1
- module SixSaferpay
2
- class Error < StandardError
3
-
4
- attr_accessor :message
5
-
6
- def initialize(message = nil)
7
- @message = message
8
- super(message)
9
- end
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- module SixSaferpay
2
- class Model
3
-
4
- end
5
- end
@@ -1,40 +0,0 @@
1
- module SixSaferpay
2
- class Card
3
-
4
- attr_accessor(:masked_number,
5
- :exp_year,
6
- :exp_month,
7
- :holder_name,
8
- :country_code,
9
- :hash_value
10
- )
11
-
12
- def initialize(masked_number:,
13
- exp_year:,
14
- exp_month:,
15
- holder_name: nil,
16
- country_code: nil,
17
- hash_value: nil
18
- )
19
- @masked_number = masked_number
20
- @exp_year = exp_year
21
- @exp_month = exp_month
22
- @holder_name = holder_name
23
- @country_code = country_code
24
- @hash_value = hash_value
25
- end
26
-
27
- def to_hash
28
- body = Hash.new
29
- body.merge!(masked_number: @masked_number)
30
- body.merge!(exp_year: @exp_year)
31
- body.merge!(exp_month: @exp_month)
32
- body.merge!(holder_name: @holder_name) if @holder_name
33
- body.merge!(country_code: @country_code) if @country_code
34
- body.merge!(hash_value: @hash_value) if @hash_value
35
- body
36
- end
37
- alias_method :to_h, :to_hash
38
-
39
- end
40
- end
@@ -1,20 +0,0 @@
1
- module SixSaferpay
2
- class DebitDirect
3
-
4
- attr_accessor(:mandate_id, :creditor_id)
5
-
6
- def invoice(mandate_id:, creditor_id:)
7
- @mandate_id = mandate_id
8
- @creditor_id = creditor_id
9
- end
10
-
11
- def to_hash
12
- body = Hash.new
13
- body.merge!(MandateId: @mandate_id)
14
- body.merge!(CreditorId: @creditor_id)
15
- body
16
- end
17
- alias_method :to_h, :to_hash
18
-
19
- end
20
- end
@@ -1,44 +0,0 @@
1
- module SixSaferpay
2
- module SixTransaction
3
- module Initialize
4
- class Card
5
-
6
- attr_accessor(:number,
7
- :exp_year,
8
- :exp_month,
9
- :holder_name,
10
- :country_code,
11
- :hash_value
12
- )
13
-
14
- def initialize(number:,
15
- exp_year:,
16
- exp_month:,
17
- holder_name: nil,
18
- country_code: nil,
19
- hash_value: nil
20
- )
21
- @number = number
22
- @exp_year = exp_year
23
- @exp_month = exp_month
24
- @holder_name = holder_name
25
- @country_code = country_code
26
- @hash_value = hash_value
27
- end
28
-
29
- def to_hash
30
- body = Hash.new
31
- body.merge!(Number: @number)
32
- body.merge!(ExpYear: @exp_year)
33
- body.merge!(ExpMonth: @exp_month)
34
- body.merge!(HolderName: @holder_name) if @holder_name
35
- body.merge!(CountryCode: @country_code) if @country_code
36
- body.merge!(HashValue: @hash_value) if @hash_value
37
- body
38
- end
39
- alias_method :to_h, :to_hash
40
-
41
- end
42
- end
43
- end
44
- end
@@ -1,32 +0,0 @@
1
- module SixSaferpay
2
- module SixTransaction
3
- module Initialize
4
- class PaymentMeans
5
-
6
- attr_accessor(:card,
7
- :bank_account,
8
- :six_alias
9
- )
10
-
11
- def initialize(card: nil,
12
- bank_account: nil,
13
- six_alias: nil
14
- )
15
- @card = card
16
- @bank_account = bank_account
17
- @six_alias = six_alias
18
- end
19
-
20
- def to_hash
21
- body = Hash.new
22
- body.merge!(Card: @card.to_h) if @card
23
- body.merge!(BankAccount: @bank_account.to_h) if @bank_account
24
- body.merge!(Alias: @six_alias.to_h) if @six_alias
25
- body
26
- end
27
- alias_method :to_h, :to_hash
28
-
29
- end
30
- end
31
- end
32
- end
@@ -1,6 +0,0 @@
1
- module SixSaferpay
2
- module SixTransaction
3
- module Initialize
4
- end
5
- end
6
- end
@@ -1,18 +0,0 @@
1
- module SixSaferpay
2
- class VerificationCode
3
-
4
- attr_accessor :code
5
-
6
- def initialize(code: code)
7
- @code = code
8
- end
9
-
10
- def to_hash
11
- {
12
- VerificationCode: @code
13
- }
14
- end
15
- alias_method :to_h, :to_hash
16
-
17
- end
18
- end