connect-sdk-ruby 1.12.0 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/connect-sdk-ruby.gemspec +1 -1
  3. data/examples/merchant/mandates/block_mandate_example.rb +22 -0
  4. data/examples/merchant/mandates/create_mandate_example.rb +66 -0
  5. data/examples/merchant/mandates/get_mandate_example.rb +22 -0
  6. data/examples/merchant/mandates/revoke_mandate_example.rb +22 -0
  7. data/examples/merchant/mandates/unblock_mandate_example.rb +22 -0
  8. data/examples/merchant/products/get_customer_details_example.rb +1 -1
  9. data/lib/ingenico/connect/sdk/domain/definitions/redirect_data_base.rb +38 -0
  10. data/lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb +22 -0
  11. data/lib/ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_input.rb +7 -0
  12. data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_base.rb +70 -0
  13. data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_request.rb +15 -0
  14. data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_response.rb +46 -0
  15. data/lib/ingenico/connect/sdk/domain/mandates/get_mandate_response.rb +35 -0
  16. data/lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb +59 -0
  17. data/lib/ingenico/connect/sdk/domain/mandates/mandate_contact_details.rb +38 -0
  18. data/lib/ingenico/connect/sdk/domain/mandates/mandate_customer.rb +75 -0
  19. data/lib/ingenico/connect/sdk/domain/mandates/mandate_merchant_action.rb +42 -0
  20. data/lib/ingenico/connect/sdk/domain/mandates/mandate_personal_information.rb +42 -0
  21. data/lib/ingenico/connect/sdk/domain/mandates/mandate_personal_name.rb +38 -0
  22. data/lib/ingenico/connect/sdk/domain/mandates/mandate_redirect_data.rb +15 -0
  23. data/lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb +63 -0
  24. data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input.rb +2 -9
  25. data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input_base.rb +31 -0
  26. data/lib/ingenico/connect/sdk/domain/payment/order.rb +11 -0
  27. data/lib/ingenico/connect/sdk/domain/payment/payment_product771_specific_output.rb +31 -0
  28. data/lib/ingenico/connect/sdk/domain/payment/redirect_data.rb +2 -25
  29. data/lib/ingenico/connect/sdk/domain/payment/seller.rb +91 -0
  30. data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input.rb +2 -2
  31. data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input_base.rb +35 -0
  32. data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_output.rb +11 -0
  33. data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_product771_specific_input.rb +42 -0
  34. data/lib/ingenico/connect/sdk/merchant/mandates/mandates_client.rb +221 -0
  35. data/lib/ingenico/connect/sdk/merchant/merchant_client.rb +9 -0
  36. data/lib/ingenico/connect/sdk/meta_data_provider.rb +1 -1
  37. data/lib/ingenico/connect/sdk/modules.rb +10 -0
  38. metadata +26 -2
@@ -0,0 +1,31 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/domain/definitions/abstract_payment_method_specific_input'
6
+
7
+ module Ingenico::Connect::SDK
8
+ module Domain
9
+ module Payment
10
+
11
+ class EInvoicePaymentMethodSpecificInputBase < Ingenico::Connect::SDK::Domain::Definitions::AbstractPaymentMethodSpecificInput
12
+
13
+ # true/false
14
+ attr_accessor :requires_approval
15
+
16
+ def to_h
17
+ hash = super
18
+ add_to_hash(hash, 'requiresApproval', @requires_approval)
19
+ hash
20
+ end
21
+
22
+ def from_hash(hash)
23
+ super
24
+ if hash.has_key?('requiresApproval')
25
+ @requires_approval = hash['requiresApproval']
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -8,6 +8,7 @@ require 'ingenico/connect/sdk/domain/payment/additional_order_input'
8
8
  require 'ingenico/connect/sdk/domain/payment/customer'
9
9
  require 'ingenico/connect/sdk/domain/payment/line_item'
10
10
  require 'ingenico/connect/sdk/domain/payment/order_references'
11
+ require 'ingenico/connect/sdk/domain/payment/seller'
11
12
  require 'ingenico/connect/sdk/domain/payment/shopping_cart'
12
13
 
13
14
  module Ingenico::Connect::SDK
@@ -33,6 +34,9 @@ module Ingenico::Connect::SDK
33
34
  # {Ingenico::Connect::SDK::Domain::Payment::OrderReferences}
34
35
  attr_accessor :references
35
36
 
37
+ # {Ingenico::Connect::SDK::Domain::Payment::Seller}
38
+ attr_accessor :seller
39
+
36
40
  # {Ingenico::Connect::SDK::Domain::Payment::ShoppingCart}
37
41
  attr_accessor :shopping_cart
38
42
 
@@ -43,6 +47,7 @@ module Ingenico::Connect::SDK
43
47
  add_to_hash(hash, 'customer', @customer)
44
48
  add_to_hash(hash, 'items', @items)
45
49
  add_to_hash(hash, 'references', @references)
50
+ add_to_hash(hash, 'seller', @seller)
46
51
  add_to_hash(hash, 'shoppingCart', @shopping_cart)
47
52
  hash
48
53
  end
@@ -82,6 +87,12 @@ module Ingenico::Connect::SDK
82
87
  end
83
88
  @references = Ingenico::Connect::SDK::Domain::Payment::OrderReferences.new_from_hash(hash['references'])
84
89
  end
90
+ if hash.has_key?('seller')
91
+ if !(hash['seller'].is_a? Hash)
92
+ raise TypeError, "value '%s' is not a Hash" % [hash['seller']]
93
+ end
94
+ @seller = Ingenico::Connect::SDK::Domain::Payment::Seller.new_from_hash(hash['seller'])
95
+ end
85
96
  if hash.has_key?('shoppingCart')
86
97
  if !(hash['shoppingCart'].is_a? Hash)
87
98
  raise TypeError, "value '%s' is not a Hash" % [hash['shoppingCart']]
@@ -0,0 +1,31 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+
7
+ module Ingenico::Connect::SDK
8
+ module Domain
9
+ module Payment
10
+
11
+ class PaymentProduct771SpecificOutput < Ingenico::Connect::SDK::DataObject
12
+
13
+ # String
14
+ attr_accessor :mandate_reference
15
+
16
+ def to_h
17
+ hash = super
18
+ add_to_hash(hash, 'mandateReference', @mandate_reference)
19
+ hash
20
+ end
21
+
22
+ def from_hash(hash)
23
+ super
24
+ if hash.has_key?('mandateReference')
25
+ @mandate_reference = hash['mandateReference']
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -2,36 +2,13 @@
2
2
  # This class was auto-generated from the API references found at
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
- require 'ingenico/connect/sdk/data_object'
5
+ require 'ingenico/connect/sdk/domain/definitions/redirect_data_base'
6
6
 
7
7
  module Ingenico::Connect::SDK
8
8
  module Domain
9
9
  module Payment
10
10
 
11
- class RedirectData < Ingenico::Connect::SDK::DataObject
12
-
13
- # String
14
- attr_accessor :returnmac
15
-
16
- # String
17
- attr_accessor :redirect_url
18
-
19
- def to_h
20
- hash = super
21
- add_to_hash(hash, 'RETURNMAC', @returnmac)
22
- add_to_hash(hash, 'redirectURL', @redirect_url)
23
- hash
24
- end
25
-
26
- def from_hash(hash)
27
- super
28
- if hash.has_key?('RETURNMAC')
29
- @returnmac = hash['RETURNMAC']
30
- end
31
- if hash.has_key?('redirectURL')
32
- @redirect_url = hash['redirectURL']
33
- end
34
- end
11
+ class RedirectData < Ingenico::Connect::SDK::Domain::Definitions::RedirectDataBase
35
12
  end
36
13
  end
37
14
  end
@@ -0,0 +1,91 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+ require 'ingenico/connect/sdk/domain/definitions/address'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Payment
11
+
12
+ class Seller < Ingenico::Connect::SDK::DataObject
13
+
14
+ # {Ingenico::Connect::SDK::Domain::Definitions::Address}
15
+ attr_accessor :address
16
+
17
+ # String
18
+ attr_accessor :channel_code
19
+
20
+ # String
21
+ attr_accessor :description
22
+
23
+ # String
24
+ attr_accessor :geocode
25
+
26
+ # String
27
+ attr_accessor :id
28
+
29
+ # String
30
+ attr_accessor :invoice_number
31
+
32
+ # String
33
+ attr_accessor :mcc
34
+
35
+ # String
36
+ attr_accessor :name
37
+
38
+ # String
39
+ attr_accessor :type
40
+
41
+ def to_h
42
+ hash = super
43
+ add_to_hash(hash, 'address', @address)
44
+ add_to_hash(hash, 'channelCode', @channel_code)
45
+ add_to_hash(hash, 'description', @description)
46
+ add_to_hash(hash, 'geocode', @geocode)
47
+ add_to_hash(hash, 'id', @id)
48
+ add_to_hash(hash, 'invoiceNumber', @invoice_number)
49
+ add_to_hash(hash, 'mcc', @mcc)
50
+ add_to_hash(hash, 'name', @name)
51
+ add_to_hash(hash, 'type', @type)
52
+ hash
53
+ end
54
+
55
+ def from_hash(hash)
56
+ super
57
+ if hash.has_key?('address')
58
+ if !(hash['address'].is_a? Hash)
59
+ raise TypeError, "value '%s' is not a Hash" % [hash['address']]
60
+ end
61
+ @address = Ingenico::Connect::SDK::Domain::Definitions::Address.new_from_hash(hash['address'])
62
+ end
63
+ if hash.has_key?('channelCode')
64
+ @channel_code = hash['channelCode']
65
+ end
66
+ if hash.has_key?('description')
67
+ @description = hash['description']
68
+ end
69
+ if hash.has_key?('geocode')
70
+ @geocode = hash['geocode']
71
+ end
72
+ if hash.has_key?('id')
73
+ @id = hash['id']
74
+ end
75
+ if hash.has_key?('invoiceNumber')
76
+ @invoice_number = hash['invoiceNumber']
77
+ end
78
+ if hash.has_key?('mcc')
79
+ @mcc = hash['mcc']
80
+ end
81
+ if hash.has_key?('name')
82
+ @name = hash['name']
83
+ end
84
+ if hash.has_key?('type')
85
+ @type = hash['type']
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -2,13 +2,13 @@
2
2
  # This class was auto-generated from the API references found at
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
- require 'ingenico/connect/sdk/domain/definitions/abstract_payment_method_specific_input'
5
+ require 'ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input_base'
6
6
 
7
7
  module Ingenico::Connect::SDK
8
8
  module Domain
9
9
  module Payment
10
10
 
11
- class SepaDirectDebitPaymentMethodSpecificInput < Ingenico::Connect::SDK::Domain::Definitions::AbstractPaymentMethodSpecificInput
11
+ class SepaDirectDebitPaymentMethodSpecificInput < Ingenico::Connect::SDK::Domain::Payment::SepaDirectDebitPaymentMethodSpecificInputBase
12
12
 
13
13
  # String
14
14
  attr_accessor :date_collect
@@ -0,0 +1,35 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/domain/definitions/abstract_payment_method_specific_input'
6
+ require 'ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_product771_specific_input'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Payment
11
+
12
+ class SepaDirectDebitPaymentMethodSpecificInputBase < Ingenico::Connect::SDK::Domain::Definitions::AbstractPaymentMethodSpecificInput
13
+
14
+ # {Ingenico::Connect::SDK::Domain::Payment::SepaDirectDebitPaymentProduct771SpecificInput}
15
+ attr_accessor :payment_product771_specific_input
16
+
17
+ def to_h
18
+ hash = super
19
+ add_to_hash(hash, 'paymentProduct771SpecificInput', @payment_product771_specific_input)
20
+ hash
21
+ end
22
+
23
+ def from_hash(hash)
24
+ super
25
+ if hash.has_key?('paymentProduct771SpecificInput')
26
+ if !(hash['paymentProduct771SpecificInput'].is_a? Hash)
27
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct771SpecificInput']]
28
+ end
29
+ @payment_product771_specific_input = Ingenico::Connect::SDK::Domain::Payment::SepaDirectDebitPaymentProduct771SpecificInput.new_from_hash(hash['paymentProduct771SpecificInput'])
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -4,6 +4,7 @@
4
4
  #
5
5
  require 'ingenico/connect/sdk/domain/definitions/fraud_results'
6
6
  require 'ingenico/connect/sdk/domain/payment/abstract_payment_method_specific_output'
7
+ require 'ingenico/connect/sdk/domain/payment/payment_product771_specific_output'
7
8
 
8
9
  module Ingenico::Connect::SDK
9
10
  module Domain
@@ -14,9 +15,13 @@ module Ingenico::Connect::SDK
14
15
  # {Ingenico::Connect::SDK::Domain::Definitions::FraudResults}
15
16
  attr_accessor :fraud_results
16
17
 
18
+ # {Ingenico::Connect::SDK::Domain::Payment::PaymentProduct771SpecificOutput}
19
+ attr_accessor :payment_product771_specific_output
20
+
17
21
  def to_h
18
22
  hash = super
19
23
  add_to_hash(hash, 'fraudResults', @fraud_results)
24
+ add_to_hash(hash, 'paymentProduct771SpecificOutput', @payment_product771_specific_output)
20
25
  hash
21
26
  end
22
27
 
@@ -28,6 +33,12 @@ module Ingenico::Connect::SDK
28
33
  end
29
34
  @fraud_results = Ingenico::Connect::SDK::Domain::Definitions::FraudResults.new_from_hash(hash['fraudResults'])
30
35
  end
36
+ if hash.has_key?('paymentProduct771SpecificOutput')
37
+ if !(hash['paymentProduct771SpecificOutput'].is_a? Hash)
38
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct771SpecificOutput']]
39
+ end
40
+ @payment_product771_specific_output = Ingenico::Connect::SDK::Domain::Payment::PaymentProduct771SpecificOutput.new_from_hash(hash['paymentProduct771SpecificOutput'])
41
+ end
31
42
  end
32
43
  end
33
44
  end
@@ -0,0 +1,42 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+ require 'ingenico/connect/sdk/domain/mandates/create_mandate_base'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Payment
11
+
12
+ class SepaDirectDebitPaymentProduct771SpecificInput < Ingenico::Connect::SDK::DataObject
13
+
14
+ # {Ingenico::Connect::SDK::Domain::Mandates::CreateMandateBase}
15
+ attr_accessor :mandate
16
+
17
+ # String
18
+ attr_accessor :mandate_reference
19
+
20
+ def to_h
21
+ hash = super
22
+ add_to_hash(hash, 'mandate', @mandate)
23
+ add_to_hash(hash, 'mandateReference', @mandate_reference)
24
+ hash
25
+ end
26
+
27
+ def from_hash(hash)
28
+ super
29
+ if hash.has_key?('mandate')
30
+ if !(hash['mandate'].is_a? Hash)
31
+ raise TypeError, "value '%s' is not a Hash" % [hash['mandate']]
32
+ end
33
+ @mandate = Ingenico::Connect::SDK::Domain::Mandates::CreateMandateBase.new_from_hash(hash['mandate'])
34
+ end
35
+ if hash.has_key?('mandateReference')
36
+ @mandate_reference = hash['mandateReference']
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,221 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/api_resource'
6
+ require 'ingenico/connect/sdk/response_exception'
7
+ require 'ingenico/connect/sdk/domain/errors/error_response'
8
+ require 'ingenico/connect/sdk/domain/mandates/create_mandate_response'
9
+ require 'ingenico/connect/sdk/domain/mandates/get_mandate_response'
10
+
11
+ module Ingenico::Connect::SDK
12
+ module Merchant
13
+ module Mandates
14
+
15
+ # Mandates client. Thread-safe.
16
+ class MandatesClient < Ingenico::Connect::SDK::ApiResource
17
+
18
+ # parent:: {Ingenico::Connect::SDK::ApiResource}
19
+ # path_context:: Hash of String to String
20
+ def initialize(parent, path_context)
21
+ super(parent, path_context)
22
+ end
23
+
24
+ # Resource /{{merchantId}}/mandates
25
+ #
26
+ # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/mandates/create.html Create mandate}
27
+ # body:: {Ingenico::Connect::SDK::Domain::Mandates::CreateMandateRequest}
28
+ # context:: {Ingenico::Connect::SDK::CallContext}
29
+ # Returns:: {Ingenico::Connect::SDK::Domain::Mandates::CreateMandateResponse}
30
+ # Raises:: {Ingenico::Connect::SDK::ValidationException} if the request was not correct and couldn't be processed (HTTP status code 400)
31
+ # Raises:: {Ingenico::Connect::SDK::AuthorizationException} if the request was not allowed (HTTP status code 403)
32
+ # Raises:: {Ingenico::Connect::SDK::IdempotenceException} if an idempotent request caused a conflict (HTTP status code 409)
33
+ # Raises:: {Ingenico::Connect::SDK::ReferenceException} if an object was attempted to be referenced that doesn't exist or has been removed,
34
+ # or there was a conflict (HTTP status code 404, 409 or 410)
35
+ # Raises:: {Ingenico::Connect::SDK::GlobalCollectException} if something went wrong at the Ingenico ePayments platform,
36
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
37
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
38
+ # Raises:: {Ingenico::Connect::SDK::ApiException} if the Ingenico ePayments platform returned any other error
39
+ def create(body, context=nil)
40
+ uri = instantiate_uri('/{apiVersion}/{merchantId}/mandates', nil)
41
+ return @communicator.post(
42
+ uri,
43
+ client_headers,
44
+ nil,
45
+ body,
46
+ Ingenico::Connect::SDK::Domain::Mandates::CreateMandateResponse,
47
+ context)
48
+ rescue ResponseException => e
49
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
50
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
51
+ raise create_exception(e.status_code, e.body, error_object, context)
52
+ end
53
+
54
+ # Resource /{{merchantId}}/mandates/{{uniqueMandateReference}}
55
+ #
56
+ # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/mandates/get.html Get mandate}
57
+ # unique_mandate_reference:: String
58
+ # context:: {Ingenico::Connect::SDK::CallContext}
59
+ # Returns:: {Ingenico::Connect::SDK::Domain::Mandates::GetMandateResponse}
60
+ # Raises:: {Ingenico::Connect::SDK::ValidationException} if the request was not correct and couldn't be processed (HTTP status code 400)
61
+ # Raises:: {Ingenico::Connect::SDK::AuthorizationException} if the request was not allowed (HTTP status code 403)
62
+ # Raises:: {Ingenico::Connect::SDK::IdempotenceException} if an idempotent request caused a conflict (HTTP status code 409)
63
+ # Raises:: {Ingenico::Connect::SDK::ReferenceException} if an object was attempted to be referenced that doesn't exist or has been removed,
64
+ # or there was a conflict (HTTP status code 404, 409 or 410)
65
+ # Raises:: {Ingenico::Connect::SDK::GlobalCollectException} if something went wrong at the Ingenico ePayments platform,
66
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
67
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
68
+ # Raises:: {Ingenico::Connect::SDK::ApiException} if the Ingenico ePayments platform returned any other error
69
+ def get(unique_mandate_reference, context=nil)
70
+ path_context = {
71
+ 'uniqueMandateReference' => unique_mandate_reference,
72
+ }
73
+ uri = instantiate_uri('/{apiVersion}/{merchantId}/mandates/{uniqueMandateReference}', path_context)
74
+ return @communicator.get(
75
+ uri,
76
+ client_headers,
77
+ nil,
78
+ Ingenico::Connect::SDK::Domain::Mandates::GetMandateResponse,
79
+ context)
80
+ rescue ResponseException => e
81
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
82
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
83
+ raise create_exception(e.status_code, e.body, error_object, context)
84
+ end
85
+
86
+ # Resource /{{merchantId}}/mandates/{{uniqueMandateReference}}
87
+ #
88
+ # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/mandates/createWithMandateReference.html Create mandate with mandatereference}
89
+ # unique_mandate_reference:: String
90
+ # body:: {Ingenico::Connect::SDK::Domain::Mandates::CreateMandateRequest}
91
+ # context:: {Ingenico::Connect::SDK::CallContext}
92
+ # Returns:: {Ingenico::Connect::SDK::Domain::Mandates::CreateMandateResponse}
93
+ # Raises:: {Ingenico::Connect::SDK::ValidationException} if the request was not correct and couldn't be processed (HTTP status code 400)
94
+ # Raises:: {Ingenico::Connect::SDK::AuthorizationException} if the request was not allowed (HTTP status code 403)
95
+ # Raises:: {Ingenico::Connect::SDK::IdempotenceException} if an idempotent request caused a conflict (HTTP status code 409)
96
+ # Raises:: {Ingenico::Connect::SDK::ReferenceException} if an object was attempted to be referenced that doesn't exist or has been removed,
97
+ # or there was a conflict (HTTP status code 404, 409 or 410)
98
+ # Raises:: {Ingenico::Connect::SDK::GlobalCollectException} if something went wrong at the Ingenico ePayments platform,
99
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
100
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
101
+ # Raises:: {Ingenico::Connect::SDK::ApiException} if the Ingenico ePayments platform returned any other error
102
+ def create_with_mandate_reference(unique_mandate_reference, body, context=nil)
103
+ path_context = {
104
+ 'uniqueMandateReference' => unique_mandate_reference,
105
+ }
106
+ uri = instantiate_uri('/{apiVersion}/{merchantId}/mandates/{uniqueMandateReference}', path_context)
107
+ return @communicator.put(
108
+ uri,
109
+ client_headers,
110
+ nil,
111
+ body,
112
+ Ingenico::Connect::SDK::Domain::Mandates::CreateMandateResponse,
113
+ context)
114
+ rescue ResponseException => e
115
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
116
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
117
+ raise create_exception(e.status_code, e.body, error_object, context)
118
+ end
119
+
120
+ # Resource /{{merchantId}}/mandates/{{uniqueMandateReference}}/block
121
+ #
122
+ # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/mandates/block.html Block mandate}
123
+ # unique_mandate_reference:: String
124
+ # context:: {Ingenico::Connect::SDK::CallContext}
125
+ # Returns:: {Ingenico::Connect::SDK::Domain::Mandates::GetMandateResponse}
126
+ # Raises:: {Ingenico::Connect::SDK::ValidationException} if the request was not correct and couldn't be processed (HTTP status code 400)
127
+ # Raises:: {Ingenico::Connect::SDK::AuthorizationException} if the request was not allowed (HTTP status code 403)
128
+ # Raises:: {Ingenico::Connect::SDK::IdempotenceException} if an idempotent request caused a conflict (HTTP status code 409)
129
+ # Raises:: {Ingenico::Connect::SDK::ReferenceException} if an object was attempted to be referenced that doesn't exist or has been removed,
130
+ # or there was a conflict (HTTP status code 404, 409 or 410)
131
+ # Raises:: {Ingenico::Connect::SDK::GlobalCollectException} if something went wrong at the Ingenico ePayments platform,
132
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
133
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
134
+ # Raises:: {Ingenico::Connect::SDK::ApiException} if the Ingenico ePayments platform returned any other error
135
+ def block(unique_mandate_reference, context=nil)
136
+ path_context = {
137
+ 'uniqueMandateReference' => unique_mandate_reference,
138
+ }
139
+ uri = instantiate_uri('/{apiVersion}/{merchantId}/mandates/{uniqueMandateReference}/block', path_context)
140
+ return @communicator.post(
141
+ uri,
142
+ client_headers,
143
+ nil,
144
+ nil,
145
+ Ingenico::Connect::SDK::Domain::Mandates::GetMandateResponse,
146
+ context)
147
+ rescue ResponseException => e
148
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
149
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
150
+ raise create_exception(e.status_code, e.body, error_object, context)
151
+ end
152
+
153
+ # Resource /{{merchantId}}/mandates/{{uniqueMandateReference}}/unblock
154
+ #
155
+ # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/mandates/unblock.html Unblock mandate}
156
+ # unique_mandate_reference:: String
157
+ # context:: {Ingenico::Connect::SDK::CallContext}
158
+ # Returns:: {Ingenico::Connect::SDK::Domain::Mandates::GetMandateResponse}
159
+ # Raises:: {Ingenico::Connect::SDK::ValidationException} if the request was not correct and couldn't be processed (HTTP status code 400)
160
+ # Raises:: {Ingenico::Connect::SDK::AuthorizationException} if the request was not allowed (HTTP status code 403)
161
+ # Raises:: {Ingenico::Connect::SDK::IdempotenceException} if an idempotent request caused a conflict (HTTP status code 409)
162
+ # Raises:: {Ingenico::Connect::SDK::ReferenceException} if an object was attempted to be referenced that doesn't exist or has been removed,
163
+ # or there was a conflict (HTTP status code 404, 409 or 410)
164
+ # Raises:: {Ingenico::Connect::SDK::GlobalCollectException} if something went wrong at the Ingenico ePayments platform,
165
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
166
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
167
+ # Raises:: {Ingenico::Connect::SDK::ApiException} if the Ingenico ePayments platform returned any other error
168
+ def unblock(unique_mandate_reference, context=nil)
169
+ path_context = {
170
+ 'uniqueMandateReference' => unique_mandate_reference,
171
+ }
172
+ uri = instantiate_uri('/{apiVersion}/{merchantId}/mandates/{uniqueMandateReference}/unblock', path_context)
173
+ return @communicator.post(
174
+ uri,
175
+ client_headers,
176
+ nil,
177
+ nil,
178
+ Ingenico::Connect::SDK::Domain::Mandates::GetMandateResponse,
179
+ context)
180
+ rescue ResponseException => e
181
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
182
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
183
+ raise create_exception(e.status_code, e.body, error_object, context)
184
+ end
185
+
186
+ # Resource /{{merchantId}}/mandates/{{uniqueMandateReference}}/revoke
187
+ #
188
+ # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/mandates/revoke.html Revoke mandate}
189
+ # unique_mandate_reference:: String
190
+ # context:: {Ingenico::Connect::SDK::CallContext}
191
+ # Returns:: {Ingenico::Connect::SDK::Domain::Mandates::GetMandateResponse}
192
+ # Raises:: {Ingenico::Connect::SDK::ValidationException} if the request was not correct and couldn't be processed (HTTP status code 400)
193
+ # Raises:: {Ingenico::Connect::SDK::AuthorizationException} if the request was not allowed (HTTP status code 403)
194
+ # Raises:: {Ingenico::Connect::SDK::IdempotenceException} if an idempotent request caused a conflict (HTTP status code 409)
195
+ # Raises:: {Ingenico::Connect::SDK::ReferenceException} if an object was attempted to be referenced that doesn't exist or has been removed,
196
+ # or there was a conflict (HTTP status code 404, 409 or 410)
197
+ # Raises:: {Ingenico::Connect::SDK::GlobalCollectException} if something went wrong at the Ingenico ePayments platform,
198
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
199
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
200
+ # Raises:: {Ingenico::Connect::SDK::ApiException} if the Ingenico ePayments platform returned any other error
201
+ def revoke(unique_mandate_reference, context=nil)
202
+ path_context = {
203
+ 'uniqueMandateReference' => unique_mandate_reference,
204
+ }
205
+ uri = instantiate_uri('/{apiVersion}/{merchantId}/mandates/{uniqueMandateReference}/revoke', path_context)
206
+ return @communicator.post(
207
+ uri,
208
+ client_headers,
209
+ nil,
210
+ nil,
211
+ Ingenico::Connect::SDK::Domain::Mandates::GetMandateResponse,
212
+ context)
213
+ rescue ResponseException => e
214
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
215
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
216
+ raise create_exception(e.status_code, e.body, error_object, context)
217
+ end
218
+ end
219
+ end
220
+ end
221
+ end