Class: Bfwd::TokenizationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bf_ruby2/api/tokenization_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TokenizationApi

Returns a new instance of TokenizationApi.



19
20
21
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#auth_capture(auth_capture_request, opts = {}) ⇒ PaymentMethodPagedMetadata

Note: this API can be invoked more simply by our client-side card capture library, <a href="github.com/billforward/billforward-js">BillForward.js</a>; you should not need to interact with this API manually unless you have particularly bespoke requirements

card capture","response":"BFJSAuthCapture.html","request":"BFJSAuthCapture.request.html"

Parameters:

  • auth_capture_request

    The auth capture request.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 28

def auth_capture(auth_capture_request, opts = {})
  data, _status_code, _headers = auth_capture_with_http_info(auth_capture_request, opts)
  return data
end

#auth_capture_with_http_info(auth_capture_request, opts = {}) ⇒ Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>

Note: this API can be invoked more simply by our client-side card capture library, &lt;a href&#x3D;&quot;github.com/billforward/billforward-js&quot;&gt;BillForward.js&lt;/a&gt;; you should not need to interact with this API manually unless you have particularly bespoke requirements

card capture&quot;,&quot;response&quot;:&quot;BFJSAuthCapture.html&quot;,&quot;request&quot;:&quot;BFJSAuthCapture.request.html&quot;

Parameters:

  • auth_capture_request

    The auth capture request.

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

    the optional parameters

Returns:

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

    PaymentMethodPagedMetadata data, response status code and response headers



38
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
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 38

def auth_capture_with_http_info(auth_capture_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokenizationApi.auth_capture ..."
  end
  # verify the required parameter 'auth_capture_request' is set
  if @api_client.config.client_side_validation && auth_capture_request.nil?
    fail ArgumentError, "Missing the required parameter 'auth_capture_request' when calling TokenizationApi.auth_capture"
  end
  # resource path
  local_var_path = "/tokenization/auth-capture"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/xml', 'application/xml', 'application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(auth_capture_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 => 'PaymentMethodPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokenizationApi#auth_capture\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#braintree_card_capture(opts = {}) ⇒ PaymentMethodPagedMetadata

Warning: for use only in PCI-compliant environments; for more information, <a href="[email protected]">contact us</a> regarding provisioning of your own on-premise BillForward instance

Captures raw credit card details into Braintree’s vault.

Tokenization","response":"braintreeDirectTokenization.html","request":"braintreeDirectTokenization.request.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



83
84
85
86
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 83

def braintree_card_capture(opts = {})
  data, _status_code, _headers = braintree_card_capture_with_http_info(opts)
  return data
end

#braintree_card_capture_with_http_info(opts = {}) ⇒ Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>

Warning: for use only in PCI-compliant environments; for more information, &lt;a href&#x3D;&quot;[email protected]&quot;&gt;contact us&lt;/a&gt; regarding provisioning of your own on-premise BillForward instance

Captures raw credit card details into Braintree&#39;s vault.

Tokenization&quot;,&quot;response&quot;:&quot;braintreeDirectTokenization.html&quot;,&quot;request&quot;:&quot;braintreeDirectTokenization.request.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    PaymentMethodPagedMetadata data, response status code and response headers



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 93

def braintree_card_capture_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokenizationApi.braintree_card_capture ..."
  end
  # resource path
  local_var_path = "/tokenization/braintree"

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  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 => 'PaymentMethodPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokenizationApi#braintree_card_capture\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pay_vision_shout_v1(opts = {}) ⇒ String

Note: this API is intended to be invoked by the PayVision servers – they are BillForward’s way of informing client-side of the result of card-capture from within an iframe

Generates iframe to which customer will be directed upon success or failure. The iframe contains JavaScript which attempts to send a message to BillForward.js on the client-side, which will handle the result.

PayVision iframe redirect","response":"payVisionShoutV1.html","request":"payVisionShoutV1.request.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :resource_path (String)
  • :id (String)

Returns:

  • (String)


135
136
137
138
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 135

def pay_vision_shout_v1(opts = {})
  data, _status_code, _headers = pay_vision_shout_v1_with_http_info(opts)
  return data
end

#pay_vision_shout_v1_with_http_info(opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Note: this API is intended to be invoked by the PayVision servers – they are BillForward&#39;s way of informing client-side of the result of card-capture from within an iframe

Generates iframe to which customer will be directed upon success or failure. The iframe contains JavaScript which attempts to send a message to BillForward.js on the client-side, which will handle the result.

PayVision iframe redirect&quot;,&quot;response&quot;:&quot;payVisionShoutV1.html&quot;,&quot;request&quot;:&quot;payVisionShoutV1.request.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :resource_path (String)
  • :id (String)

Returns:

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

    String data, response status code and response headers



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
175
176
177
178
179
180
181
182
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 146

def pay_vision_shout_v1_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokenizationApi.pay_vision_shout_v1 ..."
  end
  # resource path
  local_var_path = "/tokenization/payvision-shout-v1"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/html'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}
  form_params["resourcePath"] = opts[:'resource_path'] if !opts[:'resource_path'].nil?
  form_params["id"] = opts[:'id'] if !opts[:'id'].nil?

  # http body (model)
  post_body = nil
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokenizationApi#pay_vision_shout_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pre_auth(pre_auth_request, opts = {}) ⇒ TokenizationPreAuthPagedMetadata

Note: this API can be invoked more simply by our client-side card capture library, <a href="github.com/billforward/billforward-js">BillForward.js</a>; you should not need to interact with this API manually unless you have particularly bespoke requirements

card capture","response":"BFJSPreAuth.html","request":"BFJSPreAuth.request.html"

Parameters:

  • pre_auth_request

    The auth request.

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

    the optional parameters

Returns:



189
190
191
192
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 189

def pre_auth(pre_auth_request, opts = {})
  data, _status_code, _headers = pre_auth_with_http_info(pre_auth_request, opts)
  return data
end

#pre_auth_with_http_info(pre_auth_request, opts = {}) ⇒ Array<(TokenizationPreAuthPagedMetadata, Fixnum, Hash)>

Note: this API can be invoked more simply by our client-side card capture library, &lt;a href&#x3D;&quot;github.com/billforward/billforward-js&quot;&gt;BillForward.js&lt;/a&gt;; you should not need to interact with this API manually unless you have particularly bespoke requirements

card capture&quot;,&quot;response&quot;:&quot;BFJSPreAuth.html&quot;,&quot;request&quot;:&quot;BFJSPreAuth.request.html&quot;

Parameters:

  • pre_auth_request

    The auth request.

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

    the optional parameters

Returns:



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 199

def pre_auth_with_http_info(pre_auth_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokenizationApi.pre_auth ..."
  end
  # verify the required parameter 'pre_auth_request' is set
  if @api_client.config.client_side_validation && pre_auth_request.nil?
    fail ArgumentError, "Missing the required parameter 'pre_auth_request' when calling TokenizationApi.pre_auth"
  end
  # resource path
  local_var_path = "/tokenization/pre-auth"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/xml', 'application/xml', 'application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(pre_auth_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 => 'TokenizationPreAuthPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokenizationApi#pre_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#sage_pay_notify_v300(opts = {}) ⇒ String

Note: this API is intended to be invoked by the SagePay servers – they are BillForward’s way of receiving a callback from a SagePay card capture operation, using SagePay’s FORM Protocol, v3.0

Handles SagePay Notification.

SagePay Notification","response":"sagePayNotifyV3_00.html","request":"sagePayNotifyV3_00.request.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.Multiple organization-IDs may be specified by repeated use of the queryparameter. Example: …&amp;organizations&#x3D;org1&amp;organizations&#x3D;org2

  • :bill_forward_url_root (String)

    The URL through which BFJS connected to BillForward.

  • :access_token (String)

    The public token through which BFJS connected to BillForward.

  • :vps_protocol (String)
  • :tx_type (String)
  • :vendor_tx_code (String)
  • :status (String)
  • :vps_tx_id (String)
  • :card_type (String)
  • :token (String)
  • :status_detail (String)
  • :last4_digits (String)
  • :vps_signature (String)
  • :expiry_date (String)

Returns:

  • (String)


257
258
259
260
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 257

def sage_pay_notify_v300(opts = {})
  data, _status_code, _headers = sage_pay_notify_v300_with_http_info(opts)
  return data
end

#sage_pay_notify_v300_with_http_info(opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Note: this API is intended to be invoked by the SagePay servers – they are BillForward&#39;s way of receiving a callback from a SagePay card capture operation, using SagePay&#39;s FORM Protocol, v3.0

Handles SagePay Notification.

SagePay Notification&quot;,&quot;response&quot;:&quot;sagePayNotifyV3_00.html&quot;,&quot;request&quot;:&quot;sagePayNotifyV3_00.request.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.Multiple organization-IDs may be specified by repeated use of the queryparameter. Example: …&amp;organizations&#x3D;org1&amp;organizations&#x3D;org2

  • :bill_forward_url_root (String)

    The URL through which BFJS connected to BillForward.

  • :access_token (String)

    The public token through which BFJS connected to BillForward.

  • :vps_protocol (String)
  • :tx_type (String)
  • :vendor_tx_code (String)
  • :status (String)
  • :vps_tx_id (String)
  • :card_type (String)
  • :token (String)
  • :status_detail (String)
  • :last4_digits (String)
  • :vps_signature (String)
  • :expiry_date (String)

Returns:

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

    String data, response status code and response headers



280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 280

def sage_pay_notify_v300_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokenizationApi.sage_pay_notify_v300 ..."
  end
  # resource path
  local_var_path = "/tokenization/sagepay-notify-v3-00"

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'billForwardURLRoot'] = opts[:'bill_forward_url_root'] if !opts[:'bill_forward_url_root'].nil?
  query_params[:'access_token'] = opts[:'access_token'] if !opts[:'access_token'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}
  form_params["VPSProtocol"] = opts[:'vps_protocol'] if !opts[:'vps_protocol'].nil?
  form_params["TxType"] = opts[:'tx_type'] if !opts[:'tx_type'].nil?
  form_params["VendorTxCode"] = opts[:'vendor_tx_code'] if !opts[:'vendor_tx_code'].nil?
  form_params["Status"] = opts[:'status'] if !opts[:'status'].nil?
  form_params["VPSTxId"] = opts[:'vps_tx_id'] if !opts[:'vps_tx_id'].nil?
  form_params["CardType"] = opts[:'card_type'] if !opts[:'card_type'].nil?
  form_params["Token"] = opts[:'token'] if !opts[:'token'].nil?
  form_params["StatusDetail"] = opts[:'status_detail'] if !opts[:'status_detail'].nil?
  form_params["Last4Digits"] = opts[:'last4_digits'] if !opts[:'last4_digits'].nil?
  form_params["VPSSignature"] = opts[:'vps_signature'] if !opts[:'vps_signature'].nil?
  form_params["ExpiryDate"] = opts[:'expiry_date'] if !opts[:'expiry_date'].nil?

  # http body (model)
  post_body = nil
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokenizationApi#sage_pay_notify_v300\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#sage_pay_shout_v300(opts = {}) ⇒ String

Note: this API is intended to be invoked by the SagePay servers – they are BillForward’s way of informing client-side of the result of card-capture from within an iframe, using SagePay’s FORM Protocol, v3.0

Generates iframe to which customer will be directed upon success or failure. The iframe contains JavaScript which attempts to send a message to BillForward.js on the client-side, which will handle the result.

SagePay iframe redirect","response":"sagePayShoutV3_00.html","request":"sagePayShoutV3_00.request.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.Multiple organization-IDs may be specified by repeated use of the queryparameter. Example: …&amp;organizations&#x3D;org1&amp;organizations&#x3D;org2

  • :s (String)
  • :t (String)
  • :c (String)
  • :e (String)
  • :l (String)
  • :d (String)

Returns:

  • (String)


341
342
343
344
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 341

def sage_pay_shout_v300(opts = {})
  data, _status_code, _headers = sage_pay_shout_v300_with_http_info(opts)
  return data
end

#sage_pay_shout_v300_with_http_info(opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Note: this API is intended to be invoked by the SagePay servers – they are BillForward&#39;s way of informing client-side of the result of card-capture from within an iframe, using SagePay&#39;s FORM Protocol, v3.0

Generates iframe to which customer will be directed upon success or failure. The iframe contains JavaScript which attempts to send a message to BillForward.js on the client-side, which will handle the result.

SagePay iframe redirect&quot;,&quot;response&quot;:&quot;sagePayShoutV3_00.html&quot;,&quot;request&quot;:&quot;sagePayShoutV3_00.request.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.Multiple organization-IDs may be specified by repeated use of the queryparameter. Example: …&amp;organizations&#x3D;org1&amp;organizations&#x3D;org2

  • :s (String)
  • :t (String)
  • :c (String)
  • :e (String)
  • :l (String)
  • :d (String)

Returns:

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

    String data, response status code and response headers



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/bf_ruby2/api/tokenization_api.rb', line 357

def sage_pay_shout_v300_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TokenizationApi.sage_pay_shout_v300 ..."
  end
  # resource path
  local_var_path = "/tokenization/sagepay-shout-v3-00"

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'s'] = opts[:'s'] if !opts[:'s'].nil?
  query_params[:'t'] = opts[:'t'] if !opts[:'t'].nil?
  query_params[:'c'] = opts[:'c'] if !opts[:'c'].nil?
  query_params[:'e'] = opts[:'e'] if !opts[:'e'].nil?
  query_params[:'l'] = opts[:'l'] if !opts[:'l'].nil?
  query_params[:'d'] = opts[:'d'] if !opts[:'d'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokenizationApi#sage_pay_shout_v300\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end