HTTPS Connection in Simulator | Running App in Simulator
After you have designed your application (see details at Hello World page), it's time to test your application by running it in the simulator. First you need to define the Configurations for the simulator. There are multiple ways to do this. To start the simulator, select Unnamed and click the green triangle to see the image.
Click the green plus sign on left upper corner to define configurations for your app.
A window will open where you can update the Trigger and API payload values. By editing the field values you can simulate the payment application, and test your application with variable payload data values. After desired payload values are updated, press Run.
Note: Updated Trigger and API payload values are saved and visible in related Trigger and API folders in the application package.
Select which of the supported display resolutions will be tested.
Using HTTPS Connections in the Simulator
HTTPS support is integrated with the Simulator by using a 3rd party SW called Stunnel. Support is limited to one external connection per application. If your app does not use external connections, or uses only an HTTP connection, you can skip the HTTPS connections setting. If your app uses HTTPS connections, you must execute the following steps.
First, make sure you have the stunnel.exe installed on your computer. Stunnel is a proxy designed to add TLS encryption functionality to existing clients and servers without any changes in the programs' code. Its architecture is optimized for security, portability, and scalability (including load-balancing), making it suitable for large deployments. Stunnel is a free software program and it can be downloaded at the www.stunnel.org.
Download a stunnel-5-41-installer.exe or newer. Run the .exe file after downloading it. Accept the license terms and select Install for anyone using this computer. Choose the default, proposed components including Tools and Shortcuts, and complete installation.
Before running your app in the simulator, please verify that the used urls are documented in the confApp.json file. The SDK must verify the need for application whitelisting for the simulator based on the confApp.json file content. If HTTPS url is found, whitelisting is requested when you start the simulator.
Example content in the confApp.json:
When you initiate the simulator, verify that Stunnel path is accurately set. If not, set it manually by clicking on Browse. After the path to the Stunnel is in place, click on Add Connection. Update the domain name for the HTTPS connection your app uses. Make sure you add only the domain name, not the entire path to the APIs your app uses.
Next, add the path to the .pem certificate file corresponding to the external connection in use. Note: Simulator supports only PEM-format configuration files. You must save the PEM-file in Stunnel's config-folder, typically at C:\Program Files (x86)\stunnel\config
Click on Save and OK to complete this process. The settings for HTTPS connections are added to the application folder structure. You’re now ready to run the application in the Simulator.
The next step is to configure the external connections for the Simulator. Please note that the connection configuration is needed only if your app is using HTTPS connections. If your app uses only HTTP connections, or does not use external connections at all, you can skip this. HTTPS connections are defined when you start the Simulator and after you select the display resolution to be simulated.
First, verify the Stunnel path is correct. If needed, update the path to be correct.
Next, select Add Connection to define the HTTPS URL your app connects to. Please note that you should only add the domain name, not the entire path to the APIs your app uses. Make sure to add the .pem certificate file for the external service. Save your settings.
Running the App in the Simulator
Aside from the simulation window, you have options to simulate your application in different terminal models. ARGV, Logging Console and Network fields are available to monitor application parameters, console logs, and network traffic. You can operate your application with a mouse.
The ARGV field includes the value inspector for the command line arguments your application includes. You can update the ARGV field values in real time, in the simulator. This is a useful feature for testing your app; for example, you can implement a test page by reloading the same page continuously. By updating the ARGV value, you can test the impact of different values; for example, by updating trigger payload data value or updating payment app response on the Commerce Platform APIs.
The Logging Console field includes the data you defined in your application to be exported to the console log for debugging purposes.
The Network field includes a list of API queries to external services and related responses.
You can initiate your application by clicking on the trigger name in the upper half of the simulation window. Triggers available here were defined in the application manifest file.
New Feature Introduced From Release 184.108.40.206:
Support for editing ADK environment variables, before launching simulator:
In Edit configuration, SDK provides facility for the developer to edit the values of ADK environmental variables. Currently, SDK provides this facility for below variables:
Other ADK variables are set as per application configuration.
- Create VeriFone terminal application.
- Go to the ‘VeriFone’ menu >> Edit Configuration >> Commerce Application.
- ADK variables data will be display in ‘AdkData’ tab with default option.
- Update the values of these variables and click on OK button.
- ‘adkData.json’ file is created in project level. Also, user is able to see the updated values by opening this file.
- Run the application.
- All the updated values display in Simulator ARGV tab.