|
3 | 3 | Flex Microform is a CyberSource-hosted HTML/JavaScript component that replaces the card number input field on your checkout page and calls the Flex API on your behalf. This simple example integration demonstrates using the Flex Microform SDK to embed this PCI SAQ A level component in your form. For more details on this see our Developer Guide at: https://developer.cybersource.com/api/developer-guides/dita-flex/SAFlexibleToken/FlexMicroform.html |
4 | 4 |
|
5 | 5 | ## Prerequisites |
| 6 | +- [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) |
| 7 | +- [JCE unlimited policy files](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html) |
| 8 | +- [Maven](https://maven.apache.org/install.html) |
| 9 | +- [Tomcat 8 Web Server](http://tomcat.apache.org) |
6 | 10 |
|
7 | | -- Node.js 10.15.1 or later |
8 | | -- Express web application framework |
9 | | -- NPM |
10 | 11 |
|
11 | 12 | ## Setup Instructions |
12 | | - |
13 | | -1. Clone or download this repo. |
14 | | - |
15 | | -2. Modify app.js with the CyberSource REST credentials created through [EBC Portal](https://ebc2test.cybersource.com/). |
16 | | - |
17 | | - ```javascript |
18 | | - const MerchantId = 'YOUR MERCHANT ID'; |
19 | | - const MerchantKeyId = 'YOUR KEY ID (SHARED SECRET SERIAL NUMBER)'; |
20 | | - const MerchantSecretKey = 'YOUR SHARED SECRET'; |
| 13 | +1. Modify `./src/main/webapp/credentials.properties` with the CyberSource REST credentials created through [EBC Portal](https://ebc2test.cybersource.com/). |
| 14 | + ``` |
| 15 | + merchantId=YOUR MERCHANT ID |
| 16 | + keyId=YOUR KEY ID (SHARED SECRET SERIAL NUMBER) |
| 17 | + sharedSecret=YOUR SHARED SECRET |
21 | 18 | ``` |
22 | 19 |
|
23 | | -3. Pull down the package dependencies |
| 20 | +2. Build and run the application using maven |
24 | 21 | ```bash |
25 | | - cd express-microform |
26 | | - npm install |
| 22 | + mvn clean install |
| 23 | + mvn clean package |
27 | 24 | ``` |
28 | 25 |
|
29 | | -4. Run the web server |
30 | | -```bash |
31 | | -DEBUG=express-microform:* npm start |
32 | | -``` |
33 | | - |
34 | | -5. Navigate to http://localhost:3000 to try the sample application |
35 | | - |
36 | | - |
37 | | - |
| 26 | + 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](./src/main/java/com/cybersource/example/FlexKeyProvider.java), line 47. |
| 27 | + |
| 28 | + |
38 | 29 | ## Tips |
39 | | - |
40 | 30 | - If you are having issues, checkout the full [FLEX Microform documentation](https://developer.cybersource.com/api/developer-guides/dita-flex/SAFlexibleToken/FlexMicroform.html). |
41 | 31 |
|
| 32 | +- If the application throws `java.security.InvalidKeyException: Illegal key size` you have probably not installed the [JCE unlimited policy files](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html). |
| 33 | + |
42 | 34 | - 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](./src/main/java/com.cybersource/example/FlexKeyProvider.java), line 47. |
0 commit comments