Class: SplititWebApiV4::InstallmentPlanApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/splitit_web_api_v4/apis/installment_plan_api.rb

Overview

InstallmentPlanApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseApi

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from SplititWebApiV4::BaseApi

Instance Method Details

#installment_plan_authorize(installment_plan_number, body) ⇒ ApiResponse

TODO: type endpoint description here description here here

Parameters:

  • installment_plan_number (String)

    Required parameter: TODO: type

  • body (AuthorizeRequest)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/splitit_web_api_v4/apis/installment_plan_api.rb', line 128

def installment_plan_authorize(installment_plan_number,
                               body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/api/v1/installmentplans/{installmentPlanNumber}/authorize',
                                 Server::DEFAULT)
               .template_param(new_parameter(installment_plan_number, key: 'installmentPlanNumber')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('OAuth2', 'ApiKey')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AuthorizeResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error',
                             ApiErrorResponseException))
    .execute
end

#installment_plan_check_card_validity(body, x_splitit_touch_point: nil, x_splitit_idempotency_key: nil) ⇒ ApiResponse

TODO: type endpoint description here description here description here

Parameters:

  • body (CardValidityRequest)

    Required parameter: TODO: type

  • x_splitit_touch_point (String) (defaults to: nil)

    Optional parameter: Example:

  • x_splitit_idempotency_key (String) (defaults to: nil)

    Optional parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/splitit_web_api_v4/apis/installment_plan_api.rb', line 16

def installment_plan_check_card_validity(body,
                                         x_splitit_touch_point: nil,
                                         x_splitit_idempotency_key: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/api/v1/installmentplans/card-validity',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter(x_splitit_touch_point, key: 'X-Splitit-TouchPoint'))
               .header_param(new_parameter(x_splitit_idempotency_key, key: 'X-Splitit-IdempotencyKey'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('OAuth2', 'ApiKey')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CardValidityResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error',
                             ApiErrorResponseException))
    .execute
end

#installment_plan_create_offers(body) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • body (OffersRequest)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/splitit_web_api_v4/apis/installment_plan_api.rb', line 45

def installment_plan_create_offers(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/api/v1/installmentplans/offers',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('OAuth2', 'ApiKey')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(OffersResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error',
                             ApiErrorResponseException))
    .execute
end

TODO: type endpoint description here description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/splitit_web_api_v4/apis/installment_plan_api.rb', line 70

def installment_plan_generate_payment_link(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/api/v1/installmentplans/payment-link/generate',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('OAuth2', 'ApiKey')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(PaymentLinkResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error',
                             ApiErrorResponseException))
    .execute
end

#installment_plan_get_by_installment_plan_number(installment_plan_number) ⇒ ApiResponse

TODO: type endpoint description here description here

Parameters:

  • installment_plan_number (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/splitit_web_api_v4/apis/installment_plan_api.rb', line 188

def installment_plan_get_by_installment_plan_number(installment_plan_number)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/v1/installmentplans/{installmentPlanNumber}',
                                 Server::DEFAULT)
               .template_param(new_parameter(installment_plan_number, key: 'installmentPlanNumber')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(And.new('OAuth2', 'ApiKey')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(InstallmentPlanDetailsResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error',
                             ApiErrorResponseException))
    .execute
end

#installment_plan_refund(installment_plan_number, body) ⇒ ApiResponse

TODO: type endpoint description here description here here

Parameters:

  • installment_plan_number (String)

    Required parameter: TODO: type

  • body (RefundRequest)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/splitit_web_api_v4/apis/installment_plan_api.rb', line 239

def installment_plan_refund(installment_plan_number,
                            body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/api/v1/installmentplans/{installmentPlanNumber}/refund',
                                 Server::DEFAULT)
               .template_param(new_parameter(installment_plan_number, key: 'installmentPlanNumber')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('OAuth2', 'ApiKey')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(RefundResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error',
                             ApiErrorResponseException))
    .execute
end

#installment_plan_search(body) ⇒ ApiResponse

TODO: type endpoint description here description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/splitit_web_api_v4/apis/installment_plan_api.rb', line 212

def installment_plan_search(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/api/v1/installmentplans/search',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('OAuth2', 'ApiKey')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(InstallmentPlanSearchDetailsResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error',
                             ApiErrorResponseException))
    .execute
end

#installment_plan_update_offers(installment_plan_number, body) ⇒ ApiResponse

TODO: type endpoint description here description here description here

Parameters:

  • installment_plan_number (String)

    Required parameter: TODO: type

  • body (UpdateOffersRequest)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/splitit_web_api_v4/apis/installment_plan_api.rb', line 97

def installment_plan_update_offers(installment_plan_number,
                                   body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/api/v1/installmentplans/offers/{installmentPlanNumber}',
                                 Server::DEFAULT)
               .template_param(new_parameter(installment_plan_number, key: 'installmentPlanNumber')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('OAuth2', 'ApiKey')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(OffersResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error',
                             ApiErrorResponseException))
    .execute
end

#installment_plan_update_order(installment_plan_number, body) ⇒ ApiResponse

TODO: type endpoint description here description here description here

Parameters:

  • installment_plan_number (String)

    Required parameter: TODO: type

  • body (UpdateOrderRequest)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/splitit_web_api_v4/apis/installment_plan_api.rb', line 159

def installment_plan_update_order(installment_plan_number,
                                  body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/api/v1/installmentplans/{installmentPlanNumber}/updateorder',
                                 Server::DEFAULT)
               .template_param(new_parameter(installment_plan_number, key: 'installmentPlanNumber')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('OAuth2', 'ApiKey')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(UpdateOrderResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error',
                             ApiErrorResponseException))
    .execute
end