Class: CyberSource::MerchantBoardingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/api/merchant_boarding_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default, config) ⇒ MerchantBoardingApi

Returns a new instance of MerchantBoardingApi.



18
19
20
21
# File 'lib/cybersource_rest_client/api/merchant_boarding_api.rb', line 18

def initialize(api_client = ApiClient.default, config)
  @api_client = api_client
  @api_client.set_configuration(config)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'lib/cybersource_rest_client/api/merchant_boarding_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#get_registration(registration_id, opts = {}) ⇒ InlineResponse2001

Gets all the information on a boarding registration This end point will get all information of a boarding registration

Parameters:

  • registration_id

    Identifies the boarding registration to be updated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/cybersource_rest_client/api/merchant_boarding_api.rb', line 29

def get_registration(registration_id, opts = {})
  data, status_code, headers = get_registration_with_http_info(registration_id, opts)
  return data, status_code, headers
end

#get_registration_with_http_info(registration_id, opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>

Gets all the information on a boarding registration This end point will get all information of a boarding registration

Parameters:

  • registration_id

    Identifies the boarding registration to be updated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2001, Fixnum, Hash)>)

    InlineResponse2001 data, response status code and response headers



39
40
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
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/cybersource_rest_client/api/merchant_boarding_api.rb', line 39

def get_registration_with_http_info(registration_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantBoardingApi.get_registration ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'registration_id' is set
  if @api_client.config.client_side_validation && registration_id.nil?
    fail ArgumentError, "Missing the required parameter 'registration_id' when calling MerchantBoardingApi.get_registration"
  end
  # resource path
  local_var_path = 'boarding/v1/registrations/{registrationId}'.sub('{' + 'registrationId' + '}', registration_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2001')
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantBoardingApi#get_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#post_registration(post_registration_body, opts = {}) ⇒ InlineResponse2012

Create a boarding registration Create a registration to board merchant If you have Card Processing product enabled in your boarding request, select payment processor from Configuration -> Sample Request. You may unselect attributes from the Request Builder tree which you do not need in the request. For VPC, CUP and EFTPOS processors, replace the processor name from VPC or CUP or EFTPOS to the actual processor name in the sample request. e.g. replace VPC with &lt;your vpc processor&gt;

Parameters:

  • post_registration_body

    Boarding registration data

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :v_c_idempotency_id (String)

    defines idempotency of the request

Returns:



101
102
103
104
# File 'lib/cybersource_rest_client/api/merchant_boarding_api.rb', line 101

def post_registration(post_registration_body, opts = {})
  data, status_code, headers = post_registration_with_http_info(post_registration_body, opts)
  return data, status_code, headers
end

#post_registration_with_http_info(post_registration_body, opts = {}) ⇒ Array<(InlineResponse2012, Fixnum, Hash)>

Create a boarding registration Create a registration to board merchant If you have Card Processing product enabled in your boarding request, select payment processor from Configuration -&gt; Sample Request. You may unselect attributes from the Request Builder tree which you do not need in the request. For VPC, CUP and EFTPOS processors, replace the processor name from VPC or CUP or EFTPOS to the actual processor name in the sample request. e.g. replace VPC with &amp;lt;your vpc processor&amp;gt;

Parameters:

  • post_registration_body

    Boarding registration data

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :v_c_idempotency_id (String)

    defines idempotency of the request

Returns:

  • (Array<(InlineResponse2012, Fixnum, Hash)>)

    InlineResponse2012 data, response status code and response headers



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/cybersource_rest_client/api/merchant_boarding_api.rb', line 112

def post_registration_with_http_info(post_registration_body, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantBoardingApi.post_registration ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'post_registration_body' is set
  if @api_client.config.client_side_validation && post_registration_body.nil?
    fail ArgumentError, "Missing the required parameter 'post_registration_body' when calling MerchantBoardingApi.post_registration"
  end
  # resource path
  local_var_path = 'boarding/v1/registrations'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'v-c-idempotency-id'] = opts[:'v_c_idempotency_id'] if !opts[:'v_c_idempotency_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(post_registration_body)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostRegistrationBody', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2012')
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantBoardingApi#post_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end