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
@@ -0,0 +1,40 @@
1
+ module SixSaferpay
2
+ module SixOmniChannel
3
+ class InsertAlias
4
+
5
+ attr_accessor(:request_header,
6
+ :register_alias,
7
+ :six_transaction_reference)
8
+
9
+ def initialize(request_header: nil,
10
+ register_alias:,
11
+ six_transaction_reference: )
12
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
13
+ @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
14
+ @six_transaction_reference = six_transaction_reference
15
+ end
16
+
17
+ def to_hash
18
+ hash = Hash.new
19
+ hash.merge!(request_header: @request_header.to_h)
20
+ hash.merge!(register_alias: @register_alias.to_h) if @register_alias
21
+ hash.merge!(six_transaction_reference: @six_transaction_reference) if @six_transaction_reference
22
+ hash
23
+ end
24
+ alias_method :to_h, :to_hash
25
+
26
+ def to_json
27
+ to_hash.to_json
28
+ end
29
+
30
+ def url
31
+ '/Payment/v1/OmniChannel/InsertAlias'
32
+ end
33
+
34
+ def response_class
35
+ SixSaferpay::SixOmniChannel::InsertAliasResponse
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,30 @@
1
+ module SixSaferpay
2
+ module SixOmniChannel
3
+ class AcquireTransactionResponse
4
+
5
+ attr_accessor(:response_header,
6
+ :transaction,
7
+ :payment_means
8
+ )
9
+
10
+ def initialize(response_header:,
11
+ transaction:,
12
+ payment_means:
13
+ )
14
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
15
+ @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
16
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
17
+ end
18
+
19
+ def to_hash
20
+ hash = Hash.new
21
+ hash.merge!(response_header: @response_header.to_h) if @response_header
22
+ hash.merge!(transaction: @transaction.to_h) if @transaction
23
+ hash.merge!(payment_means: @payment_means.to_h) if @payment_means
24
+ hash
25
+ end
26
+ alias_method :to_h, :to_hash
27
+
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,34 @@
1
+ module SixSaferpay
2
+ module SixOmniChannel
3
+ class InsertAliasResponse
4
+
5
+ attr_accessor(:response_header,
6
+ :fd_alias,
7
+ :payment_means,
8
+ :check_result
9
+ )
10
+
11
+ def initialize(response_header:,
12
+ fd_alias:,
13
+ payment_means:,
14
+ check_result: nil
15
+ )
16
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
17
+ @fd_alias = SixSaferpay::Alias.new(fd_alias.to_h) if fd_alias
18
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
19
+ @check_result = SixSaferpay::CheckResult.new(check_result.to_h) if check_result
20
+ end
21
+
22
+ def to_hash
23
+ hash = Hash.new
24
+ hash.merge!(response_header: @response_header.to_h) if @response_header
25
+ hash.merge!(fd_alias: @fd_alias.to_h) if @fd_alias
26
+ hash.merge!(payment_means: @payment_means.to_h) if @payment_means
27
+ hash.merge!(check_result: @check_result.to_h) if @check_result
28
+ hash
29
+ end
30
+ alias_method :to_h, :to_hash
31
+
32
+ end
33
+ end
34
+ end
@@ -9,6 +9,7 @@ module SixSaferpay
9
9
  :payment,
10
10
  :payment_methods,
11
11
  :payment_methods_options,
12
+ :authentication,
12
13
  :wallets,
13
14
  :payer,
14
15
  :register_alias,
@@ -27,6 +28,7 @@ module SixSaferpay
27
28
  payment:,
28
29
  payment_methods: nil,
29
30
  payment_methods_options: nil,
31
+ authentication: nil,
30
32
  wallets: nil,
31
33
  payer: nil,
32
34
  register_alias: nil,
@@ -44,6 +46,7 @@ module SixSaferpay
44
46
  @payment = SixSaferpay::Payment.new(payment.to_h) if payment
45
47
  @payment_methods = payment_methods
46
48
  @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
47
50
  @wallets = wallets
48
51
  @payer = SixSaferpay::Payer.new(payer.to_h) if payer
49
52
  @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
@@ -64,6 +67,7 @@ module SixSaferpay
64
67
  hash.merge!(payment: @payment.to_h)
65
68
  hash.merge!(payment_methods: @payment_methods) if @payment_methods
66
69
  hash.merge!(payment_methods_options: @payment_methods_options.to_h) if @payment_methods_options
70
+ hash.merge!(authentication: @authentication.to_h) if @authentication
67
71
  hash.merge!(wallets: @wallets) if @wallets
68
72
  hash.merge!(payer: @payer.to_h) if @payer
69
73
  hash.merge!(register_alias: @register_alias.to_h) if @register_alias
@@ -8,7 +8,8 @@ module SixSaferpay
8
8
  :payer,
9
9
  :registration_result,
10
10
  :liability,
11
- :dcc
11
+ :dcc,
12
+ :mastercard_issuer_installments
12
13
  )
13
14
 
14
15
  def initialize(response_header:,
@@ -17,7 +18,8 @@ module SixSaferpay
17
18
  payer: nil,
18
19
  registration_result: nil,
19
20
  liability: nil,
20
- dcc: nil
21
+ dcc: nil,
22
+ mastercard_issuer_installments: nil
21
23
  )
22
24
  @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h)
23
25
  @transaction = SixSaferpay::Transaction.new(transaction.to_h)
@@ -26,6 +28,10 @@ module SixSaferpay
26
28
  @registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
27
29
  @liability = SixSaferpay::Liability.new(liability.to_h) if liability
28
30
  @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
29
35
  end
30
36
 
31
37
  def to_hash
@@ -37,6 +43,9 @@ module SixSaferpay
37
43
  hash.merge!(registration_result: @registration_result.to_h) if @registration_result
38
44
  hash.merge!(liability: @liability.to_h) if @liability
39
45
  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
40
49
  hash
41
50
  end
42
51
  alias_method :to_h, :to_hash
@@ -0,0 +1,37 @@
1
+ module SixSaferpay
2
+ module SixSecureData
3
+ class AssertInsert
4
+
5
+ attr_accessor(:request_header,
6
+ :token
7
+ )
8
+
9
+ def initialize(request_header: nil,
10
+ token: )
11
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
12
+ @token = token
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!(token: @token) if @token
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/Alias/AssertInsert'
29
+ end
30
+
31
+ def response_class
32
+ SixSaferpay::SixSecureData::AssertInsertResponse
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,37 @@
1
+ module SixSaferpay
2
+ module SixSecureData
3
+ class Delete
4
+
5
+ attr_accessor(:request_header,
6
+ :alias_id
7
+ )
8
+
9
+ def initialize(request_header: nil,
10
+ alias_id: )
11
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
12
+ @alias_id = alias_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!(alias_id: @alias_id) if @alias_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/Alias/Delete'
29
+ end
30
+
31
+ def response_class
32
+ SixSaferpay::SixSecureData::DeleteResponse
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,66 @@
1
+ module SixSaferpay
2
+ module SixSecureData
3
+ class Insert
4
+
5
+ attr_accessor(:request_header,
6
+ :register_alias,
7
+ :type,
8
+ :return_urls,
9
+ :styling,
10
+ :language_code,
11
+ :check,
12
+ :payment_methods,
13
+ :card_form
14
+ )
15
+
16
+ def initialize(request_header: nil,
17
+ register_alias:,
18
+ type:,
19
+ return_urls:,
20
+ styling: nil,
21
+ language_code: nil,
22
+ check: nil,
23
+ payment_methods: nil,
24
+ card_form: nil
25
+ )
26
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
27
+ @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
28
+ @type = type
29
+ @return_urls = SixSaferpay::ReturnUrls.new(return_urls.to_h) if return_urls
30
+ @styling = SixSaferpay::Styling.new(styling.to_h) if styling
31
+ @language_code = language_code
32
+ @check = SixSaferpay::Check.new(check.to_h) if check
33
+ @payment_methods = payment_methods
34
+ @card_form = SixSaferpay::CardForm.new(card_form.to_h) if card_form
35
+ end
36
+
37
+ def to_hash
38
+ hash = Hash.new
39
+ hash.merge!(request_header: @request_header.to_h) if @request_header
40
+ hash.merge!(register_alias: @register_alias.to_h) if @register_alias
41
+ hash.merge!(type: @type) if @type
42
+ hash.merge!(return_urls: @return_urls.to_h) if @return_urls
43
+ hash.merge!(styling: @styling.to_h) if @styling
44
+ hash.merge!(language_code: @language_code) if @language_code
45
+ hash.merge!(check: @check.to_h) if @check
46
+ hash.merge!(payment_methods: @payment_methods) if @payment_methods
47
+ hash.merge!(card_form: @card_form.to_h) if @card_form
48
+ hash
49
+ end
50
+ alias_method :to_h, :to_hash
51
+
52
+ def to_json
53
+ to_hash.to_json
54
+ end
55
+
56
+ def url
57
+ '/Payment/v1/Alias/Insert'
58
+ end
59
+
60
+ def response_class
61
+ SixSaferpay::SixSecureData::InsertResponse
62
+ end
63
+
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,46 @@
1
+ module SixSaferpay
2
+ module SixSecureData
3
+ class InsertDirect
4
+
5
+ attr_accessor(:request_header,
6
+ :register_alias,
7
+ :payment_means,
8
+ :check
9
+ )
10
+
11
+ def initialize(request_header: nil,
12
+ register_alias:,
13
+ payment_means:,
14
+ check: nil
15
+ )
16
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
17
+ @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
18
+ @payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
19
+ @check = SixSaferpay::Check.new(check.to_h) if check
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!(register_alias: @register_alias.to_h) if @register_alias
26
+ hash.merge!(payment_means: @payment_means.to_h) if @payment_means
27
+ hash.merge!(check: @check.to_h) if @check
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/Alias/InsertDirect'
38
+ end
39
+
40
+ def response_class
41
+ SixSaferpay::SixSecureData::InsertDirectResponse
42
+ end
43
+
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,42 @@
1
+ module SixSaferpay
2
+ module SixSecureData
3
+ class Update
4
+
5
+ attr_accessor(:request_header,
6
+ :update_alias,
7
+ :update_payment_means
8
+ )
9
+
10
+ def initialize(request_header: nil,
11
+ update_alias: nil,
12
+ update_payment_means: nil
13
+ )
14
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
15
+ @update_alias = SixSaferpay::UpdateAlias.new(update_alias.to_h) if update_alias
16
+ @update_payment_means = SixSaferpay::UpdatePaymentMeans.new(update_payment_means.to_h) if update_payment_means
17
+ end
18
+
19
+ def to_hash
20
+ hash = Hash.new
21
+ hash.merge!(request_header: @request_header.to_h) if @request_header
22
+ hash.merge!(update_alias: @update_alias.to_h) if @update_alias
23
+ hash.merge!(update_payment_means: @update_payment_means.to_h) if @update_payment_means
24
+ hash
25
+ end
26
+ alias_method :to_h, :to_hash
27
+
28
+ def to_json
29
+ to_hash.to_json
30
+ end
31
+
32
+ def url
33
+ '/Payment/v1/Alias/Update'
34
+ end
35
+
36
+ def response_class
37
+ SixSaferpay::SixSecureData::UpdateResponse
38
+ end
39
+
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,33 @@
1
+ module SixSaferpay
2
+ module SixSecureData
3
+ class AssertInsertResponse
4
+
5
+ attr_accessor(:response_header,
6
+ :fd_alias,
7
+ :payment_means,
8
+ :check_result
9
+ )
10
+
11
+ def initialize(response_header:,
12
+ fd_alias:,
13
+ payment_means:,
14
+ check_result: nil)
15
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
16
+ @fd_alias = SixSaferpay::Alias.new(fd_alias.to_h) if fd_alias
17
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
18
+ @check_result = SixSaferpay::CheckResult.new(check_result.to_h) if check_result
19
+ end
20
+
21
+ def to_hash
22
+ hash = Hash.new
23
+ hash.merge!(response_header: @response_header.to_h) if @response_header
24
+ hash.merge!(fd_alias: @fd_alias.to_h) if @fd_alias
25
+ hash.merge!(payment_means: @payment_means.to_h) if @payment_means
26
+ hash.merge!(check_result: @check_result.to_h) if @check_result
27
+ hash
28
+ end
29
+ alias_method :to_h, :to_hash
30
+
31
+ end
32
+ end
33
+ end