Class: CyberSourceMergedSpec::ConversionDetailsController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/controllers/conversion_details_controller.rb

Overview

ConversionDetailsController

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, user_agent_parameters

Constructor Details

This class inherits a constructor from CyberSourceMergedSpec::BaseController

Instance Method Details

#get_conversion_detail(start_time, end_time, organization_id: nil) ⇒ ApiResponse

Get conversion detail of transactions for a merchant. in ISO 8601 format Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor 14) Example date format: - yyyy-MM-dd'T'HH:mm:ss.SSSZ (e.g. 2018-01-01T00:00:00.000Z) ISO 8601 format Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor 14) Example date format: - yyyy-MM-dd'T'HH:mm:ss.SSSZ (e.g. 2018-01-01T00:00:00.000Z) Id

Parameters:

  • start_time (DateTime)

    Required parameter: Valid report Start Time

  • end_time (DateTime)

    Required parameter: Valid report End Time in

  • organization_id (String) (defaults to: nil)

    Optional parameter: Valid Organization

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/cyber_source_merged_spec/controllers/conversion_details_controller.rb', line 25

def get_conversion_detail(start_time,
                          end_time,
                          organization_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reporting/v3/conversion-details',
                                 Server::DEFAULT)
               .query_param(new_parameter(start_time, key: 'startTime')
                             .is_required(true))
               .query_param(new_parameter(end_time, key: 'endTime')
                             .is_required(true))
               .query_param(new_parameter(organization_id, key: 'organizationId'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ReportingV3ConversionDetailsGet200Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request',
                             ReportingV3ConversionDetailsGet400ResponseException)
                .local_error('404',
                             'Conversion detail not found',
                             APIException))
    .execute
end