Class: CyberSourceMergedSpec::BinLookupController

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

Overview

BinLookupController

Constant Summary

Constants inherited from BaseController

CyberSourceMergedSpec::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_account_info(create_bin_lookup_request) ⇒ ApiResponse

The BIN Lookup Service is a versatile business tool that provides card network agnostic solution designed to ensure frictionless transaction experience by utilizing up-to-date Bank Identification Number (BIN) attributes sourced from multiple global and regional data sources. This service helps to improve authorization rates by helping to route transactions to the best-suited card network, minimizes fraud through card detail verification and aids in regulatory compliance by identifying card properties. The service is flexible and provides businesses with a flexible choice of inputs such as primary account number (PAN), network token from major networks (such as Visa, American Express, Discover and several regional networks) which includes device PAN (DPAN), and all types of tokens generated via CyberSource Token Management Service (TMS). Currently, the range of available credentials is contingent on the networks enabled for the business entity. Therefore, the network information specified in this documentation is illustrative and subject to personalized offerings for each reseller or merchant. 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
47
48
49
50
51
52
53
# File 'lib/cyber_source_merged_spec/controllers/bin_lookup_controller.rb', line 28

def (create_bin_lookup_request)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bin/v1/binlookup',
                                 Server::DEFAULT)
               .body_param(new_parameter(create_bin_lookup_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(GetAccountInfoResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request.',
                             BinLookupv400ResponseException)
                .local_error('403',
                             'Forbidden access. The request was rejected due to access'\
                              ' restrictions on the account or resource.',
                             BinLookup403ResponseException)
                .local_error('502',
                             'Unexpected system error or system timeout.',
                             GetAccountInfoException))
    .execute
end