Class: CyberSourceMergedSpec::PurchaseAndRefundDetailsController

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

Overview

PurchaseAndRefundDetailsController

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_purchase_and_refund_details(start_time, end_time, organization_id: nil, payment_subtype: 'ALL', view_by: 'requestDate', group_name: nil, offset: nil, limit: 2000) ⇒ ApiResponse

Download the Purchase and Refund Details report. This report report includes all purchases and refund transactions, as well as all activities related to transactions resulting in an adjustment to the net proceeds. 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 ALL: All Payment Subtypes - VI : Visa - MC : Master Card - AX : American Express - DI : Discover - DP : Pinless Debit or Submission Date. - requestDate : Request Date - submissionDate: Submission Date Name.User can define groups using CBAPI and Group Management Module in EBC2. Groups are collection of organizationIds Refund Results. Range(1-2000)

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

  • payment_subtype (String) (defaults to: 'ALL')

    Optional parameter: Payment Subtypes. -

  • view_by (String) (defaults to: 'requestDate')

    Optional parameter: View results by Request Date

  • group_name (String) (defaults to: nil)

    Optional parameter: Valid CyberSource Group

  • offset (Integer) (defaults to: nil)

    Optional parameter: Offset of the Purchase and

  • limit (Integer) (defaults to: 2000)

    Optional parameter: Results count per page.

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/cyber_source_merged_spec/controllers/purchase_and_refund_details_controller.rb', line 41

def get_purchase_and_refund_details(start_time,
                                    end_time,
                                    organization_id: nil,
                                    payment_subtype: 'ALL',
                                    view_by: 'requestDate',
                                    group_name: nil,
                                    offset: nil,
                                    limit: 2000)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/reporting/v3/purchase-refund-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'))
               .query_param(new_parameter(payment_subtype, key: 'paymentSubtype'))
               .query_param(new_parameter(view_by, key: 'viewBy'))
               .query_param(new_parameter(group_name, key: 'groupName'))
               .query_param(new_parameter(offset, key: 'offset'))
               .query_param(new_parameter(limit, key: 'limit'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ReportingV3PurchaseRefundDetailsGet200Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request',
                             ReportingV3PurchaseRefundDetailsGet400ResponseException)
                .local_error('401',
                             'Unauthorized',
                             ReportingV3PurchaseRefundDetailsGet401ResponseException)
                .local_error('404',
                             'Report not found',
                             ReportingV3PurchaseRefundDetailsGet404ResponseException)
                .local_error('500',
                             'Internal Server Error',
                             ReportingV3PurchaseRefundDetailsGet500ResponseException))
    .execute
end