| Card Number | Expiry Date | PIN | Result | Description |
|---|---|---|---|---|
| 8888880000000001 | 09/25 | 1234 | CAPTURED | Successful payment |
| 8888880000000002 | 05/25 | 1234 | NOT CAPTURED | Failed payment |
| 8888880000000003 | 09/25 | 1234 | DECLINED | Card declined |
| 8888880000000004 | 05/25 | 1234 | RESTRICTED | Card restricted |
| Result Code | Description | Action |
|---|---|---|
| CAPTURED | Payment successfully processed | Process order |
| NOT CAPTURED | Payment failed to process | Retry payment or contact support |
| DECLINED | Card declined by issuing bank | Try different card |
| RESTRICTED | Card restricted from online transactions | Contact card issuer |
| ABANDONED | Customer abandoned the payment | Allow customer to retry |
| CANCELLED | Customer cancelled the payment | Allow customer to retry |
| TIMEDOUT | Session timed out | Start new payment session |
| UNKNOWN | Unknown error occurred | Contact KNET support |
<?xml version="1.0" encoding="UTF-8"?>
<request>
<id>YOUR_TRANSPORT_ID</id>
<password>YOUR_TRANSPORT_PASSWORD</password>
<action>8</action>
<amt>10.000</amt>
<transid>TRACK_ID</transid>
<udf5>TrackID</udf5>
<trackid>TRACK_ID</trackid>
</request><?xml version="1.0" encoding="UTF-8"?>
<request>
<id>YOUR_TRANSPORT_ID</id>
<password>YOUR_TRANSPORT_PASSWORD</password>
<action>2</action>
<amt>10.000</amt>
<transid>TRACK_ID</transid>
<udf5>TrackID</udf5>
<trackid>TRACK_ID</trackid>
</request>{
"result": "CAPTURED",
"auth": "123456",
"ref": "123456789012",
"tranid": "123456789012345",
"postdate": "0123",
"trackid": "track_id_123",
"payid": "123456789012345",
"amt": "10.000",
"udf1": null,
"udf2": null,
"udf3": null,
"udf4": null,
"udf5": "TrackID"
}{
"Error": "Invalid Card",
"ErrorText": "Card number is not valid",
"trackid": "track_id_123"
}- Always use 3 decimal places
- Use dot (.) as decimal separator
- No thousands separator
- Example: "10.000" for 10 KWD
- Payment URL:
?param=tranInit - Response URL: Must be absolute URL
- Error URL: Must be absolute URL and should accept query parameters
- Always validate the response signature
- Store the transaction ID and amount
- Compare response amount with stored amount
- Use HTTPS for all endpoints
- Implement request timeouts
- Log all transactions
- Implement idempotency for payment operations
- Handle network timeouts gracefully
- Implement proper error logging
- Use database transactions where appropriate
- Validate all input data
- Implement proper exception handling
- Use event listeners for payment status changes
- Enable debug mode in development:
'debug' => env('KNET_DEBUG_MODE', true)- Check logs for detailed error messages:
Log::channel('knet')->error('Payment failed', [
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString()
]);- Monitor transaction status:
$transaction->refresh();
Log::info('Transaction status', [
'id' => $transaction->id,
'status' => $transaction->result,
'paid' => $transaction->paid
]);-
Invalid Response Format
- Check XML structure
- Verify content type headers
- Ensure proper encoding
-
Payment Timeouts
- Implement proper retry logic
- Set appropriate timeout values
- Handle network errors
-
Refund Failures
- Verify transaction is refundable
- Check refund amount
- Validate transaction status
-
URL Encoding Issues
- Use proper URL encoding for parameters
- Handle special characters
- Validate URL format
For technical support:
- Email: support@asciisd.com
- Documentation: https://docs.asciisd.com/knet
- GitHub Issues: https://github.com/asciisd/knet/issues