Class: CyberSource::MicroformIntegrationApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MicroformIntegrationApi.



18
19
20
21
# File 'lib/cybersource_rest_client/api/microform_integration_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/microform_integration_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#generate_capture_context(generate_capture_context_request, opts = {}) ⇒ String

Generate Capture Context This API is used to generate the Capture Context data structure for the Microform Integration. Microform is a browser-based acceptance solution that allows a seller to capture payment information is a secure manner from their website. For more information about Flex Microform transactions, see the [Flex Developer Guides Page](developer.cybersource.com/api/developer-guides/dita-flex/SAFlexibleToken.html). For examples on how to integrate Flex Microform within your webpage please see our [GitHub Flex Samples](github.com/CyberSource?q=flex&type=&language=) This API is a server-to-server API to generate the capture context that can be used to initiate instance of microform on a acceptance page. The capture context is a digitally signed JWT that provides authentication, one-time keys, and the target origin to the Microform Integration application.

Parameters:

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

    the optional parameters

Returns:

  • (String)


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

def generate_capture_context(generate_capture_context_request, opts = {})
  data, status_code, headers = generate_capture_context_with_http_info(generate_capture_context_request, opts)
  return data, status_code, headers
end

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

Generate Capture Context This API is used to generate the Capture Context data structure for the Microform Integration. Microform is a browser-based acceptance solution that allows a seller to capture payment information is a secure manner from their website. For more information about Flex Microform transactions, see the [Flex Developer Guides Page](developer.cybersource.com/api/developer-guides/dita-flex/SAFlexibleToken.html). For examples on how to integrate Flex Microform within your webpage please see our [GitHub Flex Samples](github.com/CyberSource?q&#x3D;flex&amp;type&#x3D;&amp;language&#x3D;) This API is a server-to-server API to generate the capture context that can be used to initiate instance of microform on a acceptance page. The capture context is a digitally signed JWT that provides authentication, one-time keys, and the target origin to the Microform Integration application.

Parameters:

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

    the optional parameters

Returns:

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

    String 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
# File 'lib/cybersource_rest_client/api/microform_integration_api.rb', line 39

def generate_capture_context_with_http_info(generate_capture_context_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MicroformIntegrationApi.generate_capture_context ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'generate_capture_context_request' is set
  if @api_client.config.client_side_validation && generate_capture_context_request.nil?
    fail ArgumentError, "Missing the required parameter 'generate_capture_context_request' when calling MicroformIntegrationApi.generate_capture_context"
  end
  # resource path
  local_var_path = 'microform/v2/sessions'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/jwt'])
  # 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(generate_capture_context_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'GenerateCaptureContextRequest', @api_client.config.host)
  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
    begin
    raise
        @api_client.config.logger.debug "API called: MicroformIntegrationApi#generate_capture_context\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end