Class: OrbipayPaymentsapiClient::OrbipayPaymentsapiClientApis::PaymentAuthorizationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/orbipay_paymentsapi_client/api/payment_authorization_api.rb

Overview

.

############################################################################################
## This class subject to change without prior notice, Please dont use this class directly.##
############################################################################################

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PaymentAuthorizationApi

Returns a new instance of PaymentAuthorizationApi.



15
16
17
# File 'lib/orbipay_paymentsapi_client/api/payment_authorization_api.rb', line 15

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



13
14
15
# File 'lib/orbipay_paymentsapi_client/api/payment_authorization_api.rb', line 13

def api_client
  @api_client
end

Instance Method Details

#cancel_payment_authorization(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, id_authorization, cancel_payment_authorization_request, opts = {}) ⇒ nil

Cancel Payment Authorization The API is used to cancel a payment authorization. Payment Authorizations that are already been processed into Payment cannot be cancelled. It returns 204 http status code with empty body in successful case.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • id_customer

    The unique identifier assigned by EBPP to the customer.

  • id_authorization

    The unique identifier assigned by EBPP to the payment authorization.

  • cancel_payment_authorization_request

    Details of payment authorization to be cancelled

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

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

  • (nil)


34
35
36
37
# File 'lib/orbipay_paymentsapi_client/api/payment_authorization_api.rb', line 34

def cancel_payment_authorization(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, id_authorization, cancel_payment_authorization_request, opts = {})
  data, _status_code, _headers = cancel_payment_authorization_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, id_authorization, cancel_payment_authorization_request, opts)
  [_status_code, _headers]
end

#cancel_payment_authorization_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, id_authorization, cancel_payment_authorization_request, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Cancel Payment Authorization The API is used to cancel a payment authorization. Payment Authorizations that are already been processed into Payment cannot be cancelled. It returns 204 http status code with empty body in successful case.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • id_customer

    The unique identifier assigned by EBPP to the customer.

  • id_authorization

    The unique identifier assigned by EBPP to the payment authorization.

  • cancel_payment_authorization_request

    Details of payment authorization to be cancelled

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

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

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

    nil, response status code and response headers



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
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/orbipay_paymentsapi_client/api/payment_authorization_api.rb', line 55

def cancel_payment_authorization_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, id_authorization, cancel_payment_authorization_request, opts = {})

  # resource path
  local_var_path = '/customers/{ID_CUSTOMER}/payments/auth/{ID_AUTHORIZATION}/cancel'
  if  !id_customer.nil? && id_customer.to_s.strip != ""
  		local_var_path = local_var_path.sub('{' + 'ID_CUSTOMER' + '}', id_customer.to_s)
	  else
	fail ArgumentError, "Missing the required parameter 'id_customer' when calling PaymentAuthorizationApi.cancel_payment_authorization"
  end
  
  if  !id_authorization.nil? && id_authorization.to_s.strip != ""
  		local_var_path = local_var_path.sub('{' + 'ID_AUTHORIZATION' + '}', id_authorization.to_s)
	  else
	fail ArgumentError, "Missing the required parameter 'id_authorization' when calling PaymentAuthorizationApi.cancel_payment_authorization"
  end
  
  # 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['channel'] = channel
  header_params['client_key'] = client_key
  header_params['product'] = product
  header_params['timestamp'] = timestamp
  header_params['idempotent_request_key'] = idempotent_request_key
  header_params['requestor_type'] = requestor_type
  header_params['requestor'] = opts[:'requestor'] if !opts[:'requestor'].nil?
  header_params['X-OPAY-Headers'] = opts[:'x_opay_headers'] if !opts[:'x_opay_headers'].nil?
  header_params['trace_id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(cancel_payment_authorization_request)
  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 data, status_code, headers
end

#create_payment_authorization(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_payment_authorization_request, opts = {}) ⇒ [PaymentAuthorizationResponse, headers]

Create Payment Authorization The API is used to create a payment authorization with certain amount on a given card account. Client systems can provide the unique identifier for the payment authorization in their system as payment_auth_reference. As of now this API is supported only for voyager fleet card payments

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • create_payment_authorization_request

    JSON containing all the fields required to make a payment.

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

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

  • ([PaymentAuthorizationResponse, headers])


118
119
120
121
# File 'lib/orbipay_paymentsapi_client/api/payment_authorization_api.rb', line 118

def create_payment_authorization(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_payment_authorization_request, opts = {})
  data, _status_code, _headers = create_payment_authorization_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_payment_authorization_request, opts)
  [data, _status_code, _headers]
end

#create_payment_authorization_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_payment_authorization_request, opts = {}) ⇒ Array<(PaymentAuthorizationResponse, Fixnum, Hash)>

Create Payment Authorization The API is used to create a payment authorization with certain amount on a given card account. Client systems can provide the unique identifier for the payment authorization in their system as payment_auth_reference. As of now this API is supported only for voyager fleet card payments

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • create_payment_authorization_request

    JSON containing all the fields required to make a payment.

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

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

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

    PaymentAuthorizationResponse data, response status code and response headers



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
165
166
167
168
169
170
171
172
173
174
# File 'lib/orbipay_paymentsapi_client/api/payment_authorization_api.rb', line 137

def create_payment_authorization_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_payment_authorization_request, opts = {})

  # resource path
  local_var_path = '/payments/auth'
  # 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['channel'] = channel
  header_params['client_key'] = client_key
  header_params['product'] = product
  header_params['timestamp'] = timestamp
  header_params['idempotent_request_key'] = idempotent_request_key
  header_params['requestor_type'] = requestor_type
  header_params['requestor'] = opts[:'requestor'] if !opts[:'requestor'].nil?
  header_params['X-OPAY-Headers'] = opts[:'x_opay_headers'] if !opts[:'x_opay_headers'].nil?
  header_params['trace_id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_payment_authorization_request)
  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 => 'PaymentAuthorizationResponse')
  return data, status_code, headers
end