Class: NewStoreApi::PaymentLinksController

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

Overview

PaymentLinksController

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

🚧 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

Returns:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/new_store_api/controllers/payment_links_controller.rb', line 21

def list_payment_link(payment_reference)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/payment/payment-links/{payment_reference}',
                                 Server::API)
               .template_param(new_parameter(payment_reference, key: 'payment_reference')
                                .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(PaymentLinkGetResponse.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:

  • payment_reference (String)

    Required parameter: TODO: type

  • body (PaymentLinkRequest)

    Required parameter: TODO: type

Returns:



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/new_store_api/controllers/payment_links_controller.rb', line 50

def replace_payment_link(payment_reference,
                         body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/payment/payment-links/{payment_reference}',
                                 Server::API)
               .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