Class: PostfinancecheckoutRubySdk::ExpressCheckoutService

Inherits:
Object
  • Object
show all
Defined in:
lib/postfinancecheckout-ruby-sdk/service/express_checkout_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ExpressCheckoutService

Returns a new instance of ExpressCheckoutService.



30
31
32
# File 'lib/postfinancecheckout-ruby-sdk/service/express_checkout_service.rb', line 30

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



27
28
29
# File 'lib/postfinancecheckout-ruby-sdk/service/express_checkout_service.rb', line 27

def api_client
  @api_client
end

Instance Method Details

#patch_express_checkout_shipping_address_change(session_token, space, express_checkout_shipping_address_change_request, opts = {}) ⇒ ExpressCheckoutShippingAddressChangeResponse

Change shipping address

Parameters:

  • session_token (String)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • express_checkout_shipping_address_change_request (ExpressCheckoutShippingAddressChangeRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



39
40
41
42
# File 'lib/postfinancecheckout-ruby-sdk/service/express_checkout_service.rb', line 39

def patch_express_checkout_shipping_address_change(session_token, space, express_checkout_shipping_address_change_request, opts = {})
  data, _status_code, _headers = patch_express_checkout_shipping_address_change_with_http_info(session_token, space, express_checkout_shipping_address_change_request, opts)
  data
end

#patch_express_checkout_shipping_address_change_with_http_info(session_token, space, express_checkout_shipping_address_change_request, opts = {}) ⇒ Array<(ExpressCheckoutShippingAddressChangeResponse, Integer, Hash)>

Returns ExpressCheckoutShippingAddressChangeResponse data, response status code and response headers.

Parameters:

  • session_token (String)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • express_checkout_shipping_address_change_request (ExpressCheckoutShippingAddressChangeRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/postfinancecheckout-ruby-sdk/service/express_checkout_service.rb', line 51

def patch_express_checkout_shipping_address_change_with_http_info(session_token, space, express_checkout_shipping_address_change_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExpressCheckoutService.patch_express_checkout_shipping_address_change ...'
  end
  # verify the required parameter 'session_token' is set
  if @api_client.config.client_side_validation && session_token.nil?
    fail ArgumentError, "Missing the required parameter 'session_token' when calling ExpressCheckoutService.patch_express_checkout_shipping_address_change"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling ExpressCheckoutService.patch_express_checkout_shipping_address_change"
  end
  # verify the required parameter 'express_checkout_shipping_address_change_request' is set
  if @api_client.config.client_side_validation && express_checkout_shipping_address_change_request.nil?
    fail ArgumentError, "Missing the required parameter 'express_checkout_shipping_address_change_request' when calling ExpressCheckoutService.patch_express_checkout_shipping_address_change"
  end
  # resource path
  local_var_path = '/express-checkout/shipping/address-change'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sessionToken'] = session_token

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(express_checkout_shipping_address_change_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ExpressCheckoutShippingAddressChangeResponse'

  new_options = opts.merge(
    :operation => :"ExpressCheckoutService.patch_express_checkout_shipping_address_change",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExpressCheckoutService#patch_express_checkout_shipping_address_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#patch_express_checkout_shipping_method_change(session_token, space, express_checkout_shipping_method_change_request, opts = {}) ⇒ ExpressCheckoutShippingMethodChangeResponse

Change shipping method

Parameters:

  • session_token (String)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • express_checkout_shipping_method_change_request (ExpressCheckoutShippingMethodChangeRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



120
121
122
123
# File 'lib/postfinancecheckout-ruby-sdk/service/express_checkout_service.rb', line 120

def patch_express_checkout_shipping_method_change(session_token, space, express_checkout_shipping_method_change_request, opts = {})
  data, _status_code, _headers = patch_express_checkout_shipping_method_change_with_http_info(session_token, space, express_checkout_shipping_method_change_request, opts)
  data
end

#patch_express_checkout_shipping_method_change_with_http_info(session_token, space, express_checkout_shipping_method_change_request, opts = {}) ⇒ Array<(ExpressCheckoutShippingMethodChangeResponse, Integer, Hash)>

Returns ExpressCheckoutShippingMethodChangeResponse data, response status code and response headers.

Parameters:

  • session_token (String)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • express_checkout_shipping_method_change_request (ExpressCheckoutShippingMethodChangeRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/postfinancecheckout-ruby-sdk/service/express_checkout_service.rb', line 132

def patch_express_checkout_shipping_method_change_with_http_info(session_token, space, express_checkout_shipping_method_change_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExpressCheckoutService.patch_express_checkout_shipping_method_change ...'
  end
  # verify the required parameter 'session_token' is set
  if @api_client.config.client_side_validation && session_token.nil?
    fail ArgumentError, "Missing the required parameter 'session_token' when calling ExpressCheckoutService.patch_express_checkout_shipping_method_change"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling ExpressCheckoutService.patch_express_checkout_shipping_method_change"
  end
  # verify the required parameter 'express_checkout_shipping_method_change_request' is set
  if @api_client.config.client_side_validation && express_checkout_shipping_method_change_request.nil?
    fail ArgumentError, "Missing the required parameter 'express_checkout_shipping_method_change_request' when calling ExpressCheckoutService.patch_express_checkout_shipping_method_change"
  end
  # resource path
  local_var_path = '/express-checkout/shipping/method-change'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sessionToken'] = session_token

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(express_checkout_shipping_method_change_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ExpressCheckoutShippingMethodChangeResponse'

  new_options = opts.merge(
    :operation => :"ExpressCheckoutService.patch_express_checkout_shipping_method_change",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExpressCheckoutService#patch_express_checkout_shipping_method_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#post_express_checkout_create_session(space, express_checkout_session_create, opts = {}) ⇒ ExpressCheckoutCreateResponse

Create a new Express Checkout Session

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • express_checkout_session_create (ExpressCheckoutSessionCreate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



200
201
202
203
# File 'lib/postfinancecheckout-ruby-sdk/service/express_checkout_service.rb', line 200

def post_express_checkout_create_session(space, express_checkout_session_create, opts = {})
  data, _status_code, _headers = post_express_checkout_create_session_with_http_info(space, express_checkout_session_create, opts)
  data
end

#post_express_checkout_create_session_with_http_info(space, express_checkout_session_create, opts = {}) ⇒ Array<(ExpressCheckoutCreateResponse, Integer, Hash)>

Returns ExpressCheckoutCreateResponse data, response status code and response headers.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • express_checkout_session_create (ExpressCheckoutSessionCreate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/postfinancecheckout-ruby-sdk/service/express_checkout_service.rb', line 211

def post_express_checkout_create_session_with_http_info(space, express_checkout_session_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExpressCheckoutService.post_express_checkout_create_session ...'
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling ExpressCheckoutService.post_express_checkout_create_session"
  end
  # verify the required parameter 'express_checkout_session_create' is set
  if @api_client.config.client_side_validation && express_checkout_session_create.nil?
    fail ArgumentError, "Missing the required parameter 'express_checkout_session_create' when calling ExpressCheckoutService.post_express_checkout_create_session"
  end
  # resource path
  local_var_path = '/express-checkout/create-session'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(express_checkout_session_create)

  # return_type
  return_type = opts[:debug_return_type] || 'ExpressCheckoutCreateResponse'

  new_options = opts.merge(
    :operation => :"ExpressCheckoutService.post_express_checkout_create_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExpressCheckoutService#post_express_checkout_create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end