Class: VisaAcceptanceMergedSpec::UnifiedCheckoutCaptureContextApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/apis/unified_checkout_capture_context_api.rb

Overview

UnifiedCheckoutCaptureContextApi

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 VisaAcceptanceMergedSpec::BaseApi

Instance Method Details

#generate_unified_checkout_capture_context(body) ⇒ ApiResponse

Unified Checkout is a powerful product within the Digital Acceptance Suite. Unified Checkout is designed to assist merchants with the adoption and inclusion of digital payments within their payment acceptance page. With Unified Checkout Integration you can add digital payment methods to create familiar, convenient and seamless payment experiences that are designed to reduce checkout friction and increase conversions. Click to Pay Drop-in UI is built on the Unified Checkout platform. For more information about Unified Checkout, see the [Unified Checkout Developer Guides Page]( For examples on how to integrate Unified Checkout within your webpage please see our [GitHub Unified Checkout Samples]( Generate Unified Checkout Capture Context Generate a one-time use capture context used for the invocation of Unified Checkout. The Request wil contain all of the parameters for how Unified Checkout will operate within a client webpage. The resulting payload will be a JWT signed object that can be used to initiate Unified Checkout or Click to Pay Drop-in UI within a web page parameter: TODO: type description here

Parameters:

Returns:

  • (ApiResponse) —

    Complete http response with raw body and status code.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/visa_acceptance_merged_spec/apis/unified_checkout_capture_context_api.rb', line 28

def generate_unified_checkout_capture_context(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/up/v1/capture-contexts',
                                 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('BearerAuth', 'Accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:dynamic_deserializer))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             APIException))
    .execute
end