Use the Test Environment
The Get Mini framework provides specific environments for development, testing, and certification to ensure transactions are handled correctly before going live.
Requirements
Before you begin, ensure you have:
- Credentials: Obtain test credentials (FUC and Terminal) specifically for the integration environment.
- Hardware: Unlike simulators, the Get Mini SDK is designed for use with physical PIN pad hardware. Testing on a physical device is required for Bluetooth connectivity.
- Other Linker Flags: Ensure your project includes
-ObjC,-lstdc++, and-lsqlite3in Build Settings.
Step 1: Configure Execution Environment
In the Get Mini framework, the environment is set globally using the CommonUtils class. You should call this method before any other SDK interaction (Login or PIN pad initialization).
| Environment | Identifier | Description |
|---|---|---|
| Development | "des" | Initial development testing. |
| Integration | "int" | Standard testing environment for most integrators. |
| Certification | "ccal" | Pre-production testing for final certification. |
| Production | "real" | Live environment (Default if not specified). |
Implementation Example
import CommonUtils
// Set to the Integration (Test) environment
CommonUtils.setEntorno("int")
// Set your application license provided by Get Mini
CommonUtils.setAppLicense("YOUR_APP_LICENSE")Step 2: Testing Logic (No Simulator Mode)
The Get Mini SDK does not provide a built-in “Simulator Reader”. If you are developing on the iOS Simulator, you will be unable to initialize Bluetooth hardware.
To test your application logic without a physical device:
- Mock the PIN pad Response: Create a wrapper around
RedsysPinpadManagerthat returns dummyRespuestaTransaccionDTOobjects when the app is running in the simulator. - Web Service Testing: Operations like
peticionConsultaFechaPaginaorpeticionDevolucion(which do not require a PIN pad) can be tested directly from the simulator if connected to the"int"or"des"environments.
Step 3: Test Transaction Scenarios
The test environments (“des”, “int”, “ccal”) route transactions to Get Mini test gateways. You can simulate various outcomes based on the test card used or specific amounts, depending on the test cases provided by Get Mini support.
Common result fields to verify:
| Field | Value | Description |
|---|---|---|
| Estado | “F” | Finalized |
| Estado | “G” | Denied |
| Estado | “T” | Technical failure |
| Resultado | “Autorizada” | Authorized |
| Resultado | “Denegada” | Denied |
| CodigoRespuesta | e.g., 117 | Authorization or rejection codes (e.g., incorrect PIN) |
Best Practices
- Environment Guard: Use compiler flags (e.g.,
#if DEBUG) to ensure the"real"environment is never used during development. - Bundle Notification: Ensure you have communicated your app’s Bundle ID to Get Mini, or the SDK will fail to authorize even in test environments.
- External Accessory Protocols: Ensure your
Info.plistincludes the protocols for your test hardware (e.g.,com.datecs.pinpadorcom.verifone.pmr.xpi).
Switching to Production
When moving to production:
- Change the environment string to
"real". - Update the
setAppLicensewith your production license. - Replace test FUC and Terminal IDs with production credentials.
// Production configuration
CommonUtils.setEntorno("real")
CommonUtils.setAppLicense("PRODUCTION_LICENSE")Next Steps
- Initialize the SDK - Complete initialization flow
- Create a Single-Step Payment - Implement sale transactions
- Refund a Payment - Learn how to return funds