Class: NewStoreApi::ProvidersController

Inherits:
BaseController show all
Defined in:
lib/new_store_api/controllers/providers_controller.rb

Overview

ProvidersController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

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

Constructor Details

This class inherits a constructor from NewStoreApi::BaseController

Instance Method Details

#create_provider_session_token(location, newstore, body: nil) ⇒ SessionTokenResponse

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
description here

Parameters:

  • location (String)

    Required parameter: TODO: type description here

  • newstore (String)

    Required parameter: TODO: type description here

  • body (CreateSessionTokenRequest) (defaults to: nil)

    Optional parameter: TODO: type

Returns:



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/new_store_api/controllers/providers_controller.rb', line 195

def create_provider_session_token(location,
                                  newstore,
                                  body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/payment/providers/{newstore}/locations/{location}/tokens',
                                 Server::API)
               .template_param(new_parameter(location, key: 'location')
                                .should_encode(true))
               .template_param(new_parameter(newstore, key: 'newstore')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SessionTokenResponse.method(:from_hash)))
    .execute
end

#destroy_provider_account_mapping(newstore, account_id, body: {}) ⇒ Object

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
here

Parameters:

  • newstore (String)

    Required parameter: TODO: type description here

  • account_id (String)

    Required parameter: TODO: type description

  • body (Object) (defaults to: {})

    Optional parameter: Example:{}

Returns:

  • (Object)

    Response from the API call.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/new_store_api/controllers/providers_controller.rb', line 23

def (newstore,
                                     ,
                                     body: {})
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/payment/providers/{newstore}/accounts/{account_id}/mappings',
                                 Server::API)
               .template_param(new_parameter(newstore, key: 'newstore')
                                .should_encode(true))
               .template_param(new_parameter(, key: 'account_id')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(APIHelper.method(:json_serialize))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:json_deserialize)))
    .execute
end

#destroy_provider_location_mapping(newstore, location, body: {}) ⇒ Object

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.

Parameters:

  • newstore (String)

    Required parameter: TODO: type description here

  • location (String)

    Required parameter: TODO: type description here

  • body (Object) (defaults to: {})

    Optional parameter: Example:{}

Returns:

  • (Object)

    Response from the API call.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/new_store_api/controllers/providers_controller.rb', line 57

def destroy_provider_location_mapping(newstore,
                                      location,
                                      body: {})
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/payment/providers/{newstore}/locations/{location}/mappings',
                                 Server::API)
               .template_param(new_parameter(newstore, key: 'newstore')
                                .should_encode(true))
               .template_param(new_parameter(location, key: 'location')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(APIHelper.method(:json_serialize))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:json_deserialize)))
    .execute
end

#list_provider_location_mappings(newstore) ⇒ LocationMappingsResponse

TODO: type endpoint description here

Parameters:

  • newstore (String)

    Required parameter: TODO: type description here

Returns:



220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/new_store_api/controllers/providers_controller.rb', line 220

def list_provider_location_mappings(newstore)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/payment/providers/{newstore}/locations/mappings',
                                 Server::API)
               .template_param(new_parameter(newstore, key: 'newstore')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(LocationMappingsResponse.method(:from_hash)))
    .execute
end
🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
description here description here

Parameters:

  • newstore (String)

    Required parameter: TODO: type description here

  • location (String)

    Required parameter: TODO: type description here

  • payment_reference (String)

    Required parameter: TODO: type

  • body (CreatePaymentLinkRequest)

    Required parameter: TODO: type

Returns:



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/new_store_api/controllers/providers_controller.rb', line 156

def replace_location_payment_link(newstore,
                                  location,
                                  payment_reference,
                                  body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/payment/providers/{newstore}/locations/{location}/payment-links/{payment_reference}',
                                 Server::API)
               .template_param(new_parameter(newstore, key: 'newstore')
                                .should_encode(true))
               .template_param(new_parameter(location, key: 'location')
                                .should_encode(true))
               .template_param(new_parameter(payment_reference, key: 'payment_reference')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(PaymentLinkResponse.method(:from_hash)))
    .execute
end

#replace_provider_location_mapping(newstore, location, body) ⇒ Object

TODO: type endpoint description here description here

Parameters:

  • newstore (String)

    Required parameter: TODO: type description here

  • location (String)

    Required parameter: TODO: type description here

  • body (LocationMappingBody)

    Required parameter: TODO: type

Returns:

  • (Object)

    Response from the API call.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/new_store_api/controllers/providers_controller.rb', line 84

def replace_provider_location_mapping(newstore,
                                      location,
                                      body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/payment/providers/{newstore}/locations/{location}/mappings',
                                 Server::API)
               .template_param(new_parameter(newstore, key: 'newstore')
                                .should_encode(true))
               .template_param(new_parameter(location, key: 'location')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:json_deserialize)))
    .execute
end
🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
description here

Parameters:

  • payment_reference (String)

    Required parameter: TODO: type

  • location (String)

    Required parameter: TODO: type description here

  • newstore (String)

    Required parameter: TODO: type description here

Returns:



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/new_store_api/controllers/providers_controller.rb', line 119

def show_payment_link(payment_reference,
                      location,
                      newstore)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/payment/providers/{newstore}/locations/{location}/payment-links/{payment_reference}',
                                 Server::API)
               .template_param(new_parameter(payment_reference, key: 'payment_reference')
                                .should_encode(true))
               .template_param(new_parameter(location, key: 'location')
                                .should_encode(true))
               .template_param(new_parameter(newstore, key: 'newstore')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(PaymentLinkResponse.method(:from_hash)))
    .execute
end