PAM Reconciliation Process¶
The Gamnify reconciliation engine handles two types of reconciliations:
- Debit Reversal Recon: Occurs when a Reversible error code is returned from the PAM or the request fails.
- Credit Retry Retry: Occurs when a Retriable error code is returned from the PAM or the request fails.
The reconciliation engine expects that the integration is idempotent against PlatformTxId as explained in earlier sections. This will be used as outlined in the diagrams below.
Debit Reversal Process¶
sequenceDiagram
participant PAM
participant GamnifyReconService
participant GamnifyPlayerApi
participant GamnifyDeadletter
activate GamnifyPlayerApi
GamnifyPlayerApi->>+PAM: Debit Transaction {PlatformTxId: 12345, type: debit}
PAM->>-GamnifyPlayerApi: Failed {UnknownError}
GamnifyPlayerApi->>GamnifyReconService: Reverse Transacition 12345
deactivate GamnifyPlayerApi
activate GamnifyReconService
loop while attemptNumber < maxAttempts && response != ok
GamnifyReconService ->>PAM: Debit Transaction {PlatformTxId: 12345, type: debit}
PAM ->> GamnifyReconService: Failed {!ok}
end
break attemptNumber = maxAttempts && response != ok
GamnifyReconService ->> GamnifyDeadletter: Reversal Recon {PlatformTxId: 12345, type: Reveral}
end
PAM ->> GamnifyReconService: Success {OK, ResponsePayload}
loop while attemptNumber < maxAttempts && response != ok
GamnifyReconService ->>PAM: Credit Transaction {PlatformTxId: 56789, type: credit}
PAM ->> GamnifyReconService: Failed {!ok}
end
break attemptNumber = maxAttempts && response != ok
GamnifyReconService ->> GamnifyDeadletter: Reversal Recon {PlatformTxId: 56789, type: Reveral}
end
PAM ->> GamnifyReconService: Success {OK, ResponsePayload}
deactivate GamnifyReconService
Credit Retry Process¶
sequenceDiagram
participant PAM
participant GamnifyReconService
participant GamnifyPlayerApi
participant GamnifyDeadletter
activate GamnifyPlayerApi
GamnifyPlayerApi->>+PAM: Credit Transaction {PlatformTxId: 12345, type: credit}
PAM->>-GamnifyPlayerApi: Failed {UnknownError}
GamnifyPlayerApi->>GamnifyReconService: Retry Transaction 12345
deactivate GamnifyPlayerApi
activate GamnifyReconService
loop while attemptNumber < maxAttempts && response != ok
GamnifyReconService ->>PAM: Credit Transaction {PlatformTxId: 12345, type: credit}
PAM ->> GamnifyReconService: Failed {!ok}
end
break attemptNumber = maxAttempts && response != ok
GamnifyReconService ->> GamnifyDeadletter: Retry Recon {PlatformTxId: 12345, type: Retry}
end
PAM ->> GamnifyReconService: Success {OK, ResponsePayload}
deactivate GamnifyReconService
Valid Response Codes¶
The below are applicable for all of the requests above. Please note that Debit requests will only be reversed, and Credit requests will only be retried.
Non-Reconciled Codes
| Code | Description |
|---|---|
| OK | Success |
| InvalidAmount | The amount is invalid. |
| InsufficientFunds | The user has insufficient funds. |
Reconciled Codes
- Trigger Debit Reversal if returned as a response to a Debit transaction type
- Trigger Credit Retry if returned as a response to a Credit transction type
| Code | Description |
|---|---|
| UnknownError | An unknown server error has occurred. |
| SystemError | A system error has occurred and could not be handled. |
Debit Reversible Codes
- Trigger Debit Reversal if returned as a response to a Debit transaction type
- Should not be returned in response of a failed Credit transaction type
| Code | Description |
|---|---|
| InvalidReversalTransactionId | The specified reversal transaction is invalid. |
Credit Retriable Error Codes
- Will NOT trigger a Debit Reversal in response to a Debit tranaction.
- Will trigger a Credit Retry in response to a Credit transaction.
| Code | Description |
|---|---|
| IntegrationError | An error occurred while integrating with another system. |
| BadRequest | An invalid request was made. |
| MissingAuthHeaders | The authentication headers are missing. This might indicate a bug or an attack. |
| HashMismatch | The authentication hash doesn't match. This might indicate a bug or an attack. |
| InvalidPlayerToken | The session token is invalid. |
| UserInactive | The user is not active. |
| UserBlocked | The user is blocked. |
| UserSelfExcluded | The user has self-excluded. |
| UserNotFound | The user was not found. |
| IPBlocked | The user's IP Address is blocked. |
| ExpiredPlayerToken | The session has expired. |
| InvalidTransactionType | The transaction type is invalid. |
| AccountStakeLimitExceeded | The stake limit has been exceeded. |
| AccountLossLimitExceeded | The loss limit has been exceeded. |
| PlacedBetNotFound | The placed bet was not found. |
| WalletNotFound | The wallet was not found. |
| TransactionNotFound | The transaction was not found. |
| InvalidExchangeRate | The exchange rate is invalid. |