Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 2.1 KB

File metadata and controls

35 lines (23 loc) · 2.1 KB

Flex API Sample

A simple client-side tokenization example integration using Flex JavaScript SDK to access the Flex API. For more details on this see our Developer Guide at: https://developer.cybersource.com/api/developer-guides/dita-flex/SAFlexibleToken/FlexAPI.html

Prerequisites

Setup Instructions

  1. Modify ./src/main/webapp/credentials.properties with the CyberSource REST credentials created through EBC Portal.
merchantId=YOUR MERCHANT ID
keyId=YOUR KEY ID (SHARED SECRET SERIAL NUMBER)
sharedSecret=YOUR SHARED SECRET
  1. Build and run the application using maven
mvn clean package

This will produce a .war file that can be deployed to a Tomcat server instance. The deployed application will serve a demonstration card tokenization page on http://localhost:8080/. To serve from a different domain, ensure that targetOrigin domain is specified when making a call to the /keys endpoint. For a detailed example please see FlexKeyProvider.java, line 47.

Tips

  • If you are having issues, checkout the full FLEX API documentation.

  • If the application throws java.security.InvalidKeyException: Illegal key size you have probably not installed the JCE unlimited policy files.

  • Safari version 10 and below does not support RsaOaep256 encryption schema, for those browser please specify encryption type RsaOaep when making a call to the /keys endpoint. For a detailed example please see FlexKeyProvider.java, line 47.