Test based payment flows
To give merchants a consistent payment experience, you must test and verify your app integration.
The test scenarios include steps to make sure your integration processes transactions correctly.
Test #1: Sale without tipping prompt and signature prompt
- (POS) Create a sale request of the amount.
- (CodePay) Swipe a test card number.
The sale is processed without any tipping option and signature prompt.
Test #2: Cancel a transaction
- (POS) Select the transaction from test #1.
- (CodePay) Cancel the full amount of the sale.
The cancel is complete. The transaction was voided
Test #3: Sale without tipping prmopt but with signature prmopt
- (POS) Create a sale request of the amount.
- (CodePay) Swipe a test card number.
- (CodePay) On the signature screen, draw a name and tap Done.
The sale is processed without any tipping option.
Test #4: Tip adjustment
- (POS) Select the transaction from test #3 and adjust the tip amount.
- (CodePay) The transaction total is updated to include the tip.
Test #5: Batch close
- (POS) Create a batch close request.
- (CodePay) Close the current batch of transactions.
Test #6: Refund a referenced transaction
- (POS) Select the transaction from test #3 that was settled.
- (CodePay) Refund the full amount of the sale.
Test #7: Refund a unreferenced transaction
- (POS) Create a refund request of the amount.
- (CodePay) Swipe any test card number.
- (CodePay) Refund the amount entered in the POS.
Failure and recovery scenarios
A real integration also has to handle transactions that don't go smoothly. Test these scenarios using the test cards for specific responses before you go live.
Test #8: Declined sale
- (POS) Create a sale request of the amount.
- (CodePay) Swipe the Decline test card for your card brand.
The sale is declined. Your app shows the decline to the cashier/customer and does not treat it as a successful payment.
Test #9: Timeout / unknown result
- (POS) Create a sale request of the amount.
- (CodePay) Swipe the Timeout test card for your card brand.
Your app should not assume the sale failed. Instead of retrying with a new order, call Query order using the same merchant_order_no to confirm the final result.
Test #10: Duplicate order number
- (POS) Create a sale request using a
merchant_order_nothat already belongs to a completed transaction. - (CodePay) Swipe any test card number.
The second request is rejected with E04112 ("Merchant order number repeat") — that rejection is not the transaction result. Your app should call Query order with the same merchant_order_no to retrieve the original outcome, instead of showing the rejection as a failed payment or resubmitting under a new order number.
Test #11: Terminal offline or unreachable
- (POS) Disconnect the terminal from the network (or turn off ECR Hub), then create a sale request.
Your app should detect the failed connection and show a clear error instead of leaving the cashier waiting or assuming the sale went through. Reconnect the terminal and confirm normal sales resume.
Test #12: Missed payment notification
- (POS) Create a sale request through the cloud API, but stop your backend from acknowledging the
notify_urlcallback (for example, take the endpoint offline or return an error). - (CodePay) Swipe a test card that approves the sale.
Your backend never receives a usable notification. Confirm your polling fallback (see Verify payment results reliably) still detects the completed payment and updates the order.