Class: CyberSourceMergedSpec::PayoutsController

Inherits:
BaseController show all
Defined in:
lib/cyber_source_merged_spec/controllers/payouts_controller.rb

Overview

PayoutsController

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

#oct_create_payment(oct_create_payment_request) ⇒ ApiResponse

Send funds from a selected funding source to a designated credit/debit card account or a prepaid card using an Original Credit Transaction (OCT). The availability of API features for a merchant can depend on the portfolio configuration and may need to be enabled at the portfolio level before they can be added to merchant accounts. parameter: TODO: type description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/cyber_source_merged_spec/controllers/payouts_controller.rb', line 17

def oct_create_payment(oct_create_payment_request)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/pts/v2/payouts',
                                 Server::DEFAULT)
               .body_param(new_parameter(oct_create_payment_request)
                            .is_required(true))
               .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(PtsV2PayoutsPost201Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request.',
                             PtsV2PayoutsPost400ResponseException)
                .local_error('502',
                             'Unexpected system error or system timeout.',
                             PtsV2PayoutsPost502ResponseException))
    .execute
end