# Test Your Integration

Once you've successfully implemented the Unified SDK in your iOS ePOS application, the next step is to validate that your integration works as expected. This ensures both the technical correctness and merchant readiness of your setup before moving to production.

## Pre-Testing Checklist

Before you begin testing your integration, ensure the following requirements are met:

- The SDK is integrated correctly and the app builds and runs without errors.
- [Partner credentials](/epos-sdk/setup-and-authentication#1-get-your-credentials) (Client ID and Client Secret) are generated from the Teya Developer/Partner Portal (Dev Environment) and properly configured in your application.
- The SDK is configured to route transactions to the development environment.
- The Teya Payment App is installed on a device and linked to a valid test merchant account. Use a physical iOS device and a test card machine.
- Your app is subscribed to payment state updates using the `TeyaPaymentStateChangeListener` and the subscription returned by `makePayment`.
- You have access to test cards/test scenarios provided by Teya to simulate various outcomes.

## Testing Scenarios

| Scenario                              | Action                                                                                     | Expected Result                                                                 |
|---------------------------------------|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| Initialise the SDK                    | Configure environment and credentials.                                                     | SDK initialises without errors.                                                 |
| Authenticate Partner                  | Authenticate using Device Code Flow.                                                       | Valid token is retrieved and stored.                                            |
| Pair Teya Payment App                 | Ensure Teya app is installed and linked to test merchant.                                  | Merchant context is successfully recognised.                                    |
| Initiate Payment                      | Call `makePayment` with a valid amount.                                                    | Card Machine shows Teya payment UI, payment completes successfully.                 |
| Subscribe to Status                   | Subscribe via `TeyaPaymentStateChangeListener` for updates.                                | App receives real-time status updates (e.g., InProgress, Successful).           |
| Cancel In-Progress                    | Call `cancelPayment` during an in-progress payment.                                        | Payment is cancelled, status becomes `Canceled`.                                |
| Refund a Payment                      | Use the stored `gatewayPaymentId` from a successful payment to issue a refund.             | Refund succeeds and confirmation is received.                                    |
| Add Tips in Payment Request from ePOS | Include a `tip` amount when calling `makePayment` from the ePOS app.                       | The tip is included in the total amount and processed by the SDK.               |
| Add Tips in Payment from Card Machine     | Start payment without tips from ePOS; tips option enabled on card machine; customer adds tip. | ePOS receives updated amount including tip and reflects it in transaction data. |
| Print Unified Receipt from ePOS       | Use your ePOS printing to generate unified receipt with itemised + transaction data.       | Receipt prints correctly with both itemised and transaction data.               |
