Class: CyberSourceMergedSpec::PaymentBatchSummariesController

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

Overview

PaymentBatchSummariesController

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_payment_batch_summary(start_time, end_time, organization_id: nil, roll_up: nil, breakdown: nil, start_day_of_week: nil) ⇒ ApiResponse

Scope can be either account/merchant or reseller. 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 for day/week/month. Required while getting breakdown data for a Merchant account_rollup/all_merchant/selected_merchant. Required while getting breakdown data for a Merchant. day of week to breakdown data for weeks in a month

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

  • roll_up (String) (defaults to: nil)

    Optional parameter: Conditional - RollUp for data

  • breakdown (String) (defaults to: nil)

    Optional parameter: Conditional - Breakdown on

  • start_day_of_week (Integer) (defaults to: nil)

    Optional parameter: Optional - Start

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/cyber_source_merged_spec/controllers/payment_batch_summaries_controller.rb', line 32

def get_payment_batch_summary(start_time,
                              end_time,
                              organization_id: nil,
                              roll_up: nil,
                              breakdown: nil,
                              start_day_of_week: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reporting/v3/payment-batch-summaries',
                                 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'))
               .query_param(new_parameter(roll_up, key: 'rollUp'))
               .query_param(new_parameter(breakdown, key: 'breakdown'))
               .query_param(new_parameter(start_day_of_week, key: 'startDayOfWeek'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ReportingV3PaymentBatchSummariesGet200Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request',
                             ReportingV3PaymentBatchSummariesGet200Response1Exception)
                .local_error('404',
                             'Payment Batch Summary not found',
                             APIException))
    .execute
end