Developer Guide Menu

Creating the Server-Side Context

The first step in integrating with Flex Microform is developing the server-side code that generates the capture context. The capture context is a digitally signed JWT that provides authentication, one-time keys, and the target origin to the Flex Microform application. The target origin is the protocol, URL, and port number (if used) of the page on which you will host the microform. You must use the
https://
protocol unless you use
http://localhost
. For example, if you are serving Microform on example.com, the target origin is
https://example.com.
Sample Flex Microform projects are available for download in the Flex samples on GitHub .
  1. Send an authenticated POST request to
    https://apitest.cybersource.com/flex/v1/keys?format=JWT
    . Include the target origin URL in the content of the body of the request.

    ADDITIONAL INFORMATION

    For Example:
                     
    { "targetOrigin": "http://localhost:3000" }
  2. Pass the capture context response data object to your front-end application. The capture context is valid for 15 minutes.

    ADDITIONAL INFORMATION

AFTER COMPLETING THE TASK

Important Security Note:
  • Ensure that all endpoints within your ownership are secure with some kind of authentication so they cannot be called at will by bad actors.
  • Do not pass the
    targetOrigin
    in any external requests. Hard code it on the server side.
Top