Summary
For a high-risk payment gateway handling large volumes of bank transfers, reliable slip verification means decoding the QR payload on the slip and matching it against bank-clearing data, not reading numbers from the pixels of an image. Pictures can be edited, but a payload checked against the bank's side and stored as a cryptographic hash exposes edited slips and rejects replays. It is Layer 3 of the three-way confirmation: it complements the signed webhook and the query API, and does not replace either.
01Why the slip is still the last line of defence
In a push-payment world the player initiates the transfer and the money then lands in the destination account. With cards the merchant pulls funds. That difference means there is always a window between the customer tapping confirm in a banking app and your system seeing the credit. That window is where support chats begin, usually with a screenshot and the sentence 'I paid, why is my balance empty?'
Picture a Friday-night spike. Your webhook endpoint is slow because the servers are saturated, or a callback was delivered but your own job failed halfway through crediting. The customer knows none of this. All they know is that money left their account, and the only thing they hold is a slip. Your support team is pressured to decide quickly.
The trouble is that a slip image is one of the easiest pieces of evidence in the whole flow to forge. If a platform credits balances from slips without a strong check, attackers learn fast that editing a number in a picture is cheaper than making a real transfer. This article explains why reading pixels is weak and how checking the QR payload is a different class of control.
02What a transfer slip actually contains
A slip on a customer's screen has two parts of very different nature. The first part is what a human reads: the sending bank, a partly masked name and account of the recipient, the amount, a date and time, and a transaction reference. These are rendered as characters in an image, which means any ordinary photo editor can change them.
The second part is a small QR code that the sending bank embeds in the slip. In general it carries a short payload, such as the sending bank identifier and a transaction reference, which works as a key for looking the real transaction up on the bank side. The exact format differs between banks, so a robust implementation should not assume every bank behaves the same way.
The important difference is that the text drawn on the image is not bound to the real transaction by anything. Anyone can paint over it. The QR payload, by contrast, points to data held in the bank's systems. If someone edits the visible amount but leaves the QR alone, the two sides disagree and the mismatch can be detected. If they fabricate a QR, there is no real transaction behind it when it is compared with clearing data.
03How OCR reads a slip, and where it fails
OCR converts the slip image into text and then uses rules or a model to extract fields such as amount and time. Its strength is coverage: it works across many banks without knowing their payload formats, and it can be deployed quickly. Its weakness is that it trusts what is drawn on the image, and that is exactly the thing an attacker controls.
The common failure cases are easy to list. An edited screenshot can change 100 into 1,000 with a font so close that both the OCR engine and a tired human reviewer accept it. A cropped image can remove fields or the QR itself, and OCR may then guess values from what remains. Look-alike glyphs, such as the digit 0 and the letter O, or the digit 1 and a lowercase l, cause accidental misreads and deliberate camouflage alike.
The most serious problem is a genuine slip used twice. A perfectly authentic image passes OCR every time because nothing in it is wrong. If the merchant does not keep a record of slips already used, one real transfer can be submitted against many orders, and a better OCR engine does not help, because the root cause is not misreading. It is the absence of any check against the source.
04Verifying the QR payload against clearing data
The stronger approach is to decode the QR on the slip and match its payload against bank-clearing data. This confirms that a real transaction exists for that reference and that its amount, time and destination agree with what your system expects. With SF PayGate, the customer or merchant submits the slip through the hosted PayPage or via POST /api/v1/payins/{id}/slip, and the platform checks the QR payload against clearing data.
This resists forgery because it moves trust from the picture to the source data. A forger can polish an image as much as they like, but cannot make a bank hold a transaction that did not happen. If they edit the visible amount, the value decoded from the payload will not match the number shown, and the slip can be rejected or routed to a review queue.
It helps to be honest about the limits. The check proves that a transaction exists and matches the order. It does not decide every other rule, such as the requirement that the sender be the customer's registered account. That is verified separately through sender matching, using POST /api/v1/customers/{id}/accounts to register the player's bank accounts in advance.
05Storing a cryptographic hash to stop replays
Even a real slip is a risk when it can be reused, so the system has to remember which slips it has already consumed. SF PayGate stores a cryptographic hash of the slip data. When a slip that produces the same hash arrives again, it is rejected, whether it comes from a different order or from a different user account.
The reason to hash the decoded transaction data rather than compare images is that the same slip can be re-saved, resized or re-screenshotted, producing different files for the same underlying transfer. A hash computed from the decoded transaction data is far more stable than a file comparison, and it can be stored without keeping the image around for matching.
Consider a user who makes one genuine 500 THB transfer and then submits that slip against ten different 500 THB orders. Without a hash, every order passes as long as OCR reads the slip normally. With a hash, only the first submission is accepted, and the rest are bounced with a reason that can be audited later.
06Layer 3 of the three-way confirmation
SF PayGate confirms incoming funds in three layers. Layer 1 is the HMAC-SHA256 signed webhook, retried automatically until the merchant returns HTTP 200. Layer 2 is the query API, available 24/7. Layer 3 is the slip fallback, either through the hosted PayPage or the slip verification endpoint.
It needs to be stated plainly: slip verification complements the first two layers and does not replace them. Your webhook should remain the primary path, and GET /api/v1/payins/{id} should be your check when a callback does not arrive. The slip is for the case where a customer insists they have paid and the first two layers have not yet shown the credit, for instance when a bank is slow to clear.
This layering means no single mechanism carries the whole burden. If the webhook path fails, the query API can still answer. If neither has seen the transaction, the slip is evidence that can be checked against source data. The result is that support staff are not forced to decide based on how convincing a customer's screenshot looks.
07An operational flow for support staff
Support teams need a fixed order of checks so that a noisy chat at midnight does not lead anyone to skip steps. The principle is: check system status first, consider the slip second, and never credit a balance by hand from looking at a picture.
The steps below work for merchants who integrate through the API and for teams who answer through their private SF PayGate Telegram room. Each step leaves a trace that can be reviewed during month-end reconciliation.
- 1Ask the customer for the order or payin id, then call GET /api/v1/payins/{id} to read the current status.
- 2If the status is already completed, check that your webhook handler processed it and that the credit was applied as normal.
- 3If it is still pending, ask for the original slip from the banking app and do not accept screenshots cropped so far that the QR is gone.
- 4Submit the slip through the PayPage or POST /api/v1/payins/{id}/slip and wait for the QR payload and hash result.
- 5If it passes, wait for the status change and webhook to fire; do not adjust the balance manually.
- 6If it fails, record the reason, tell the customer, and open a case with POST /api/me/issues so that a request_id exists for follow-up.
08Edge cases you will meet in practice
The first is the late slip: the customer transferred but submits the slip after the order has expired. The system should not auto-credit an expired order. Expired orders are not charged and are considered closed, so the correct path is a case that confirms whether funds really arrived and then resolves it under the merchant agreement.
The second is the wrong amount. A customer transfers 1,000 THB against a 500 THB order, or the reverse. This should not be quietly rounded into a pass, because that invites trial and error. Route it to a human-reviewed case. For THB it also helps to remind users that amounts must be multiples of 100, except for the 50 THB minimum deposit, and that deposits must come from the registered bank account.
The third is a slip for a different order. A user may submit a genuine slip that was already used for an earlier order, which the hash will catch. If the slip has never been used and fits another pending order, staff must decide whether to rematch it, following written policy. Related to this, Active Payin Protection returns PAYIN_ACTIVE_EXISTS with the existing paypage_url, which reduces overlapping orders that make it unclear which order a slip belongs to.
09Manual review vs OCR vs QR-payload verification
The table below summarises mechanical differences and does not quote performance figures, because real results depend on data quality, volume and how each organisation configures its process.
Pay particular attention to the replay and source-check rows, because they are what separates QR-payload verification from the other two methods at a fundamental level.
| Aspect | Manual review | OCR | QR payload + hash |
|---|---|---|---|
| What is checked | The visible image | Text read from the image | Payload matched to clearing data |
| Edited image | Easy to miss with similar fonts | Reads the edited value as normal | Mismatch with source is detectable |
| Cropped slip | Depends on judgement | May guess missing values | No QR, so it fails automated checks |
| Speed at high volume | Slow, becomes a bottleneck | Fast | Fast and automated |
| Replay resistance | Depends on staff memory | None built in, must be added | Stored hash rejects repeats |
| Audit trail | Manual notes | Only the extracted text | Result and hash as evidence |
10Implementing it, and when it is the right fit
If your platform handles few transactions a day, manual slip review may look sufficient. For a merchant receiving large volumes of transfers, such as an iGaming platform, manual review becomes a bottleneck and a source of error and internal fraud risk. Moving to QR-payload verification leaves support with only the cases the system rejected and that need judgement.
Before going live, request sandbox access and test with a valid slip, a cropped slip, a duplicate and a wrong-amount slip, and observe how the platform responds. Then write an internal policy stating which cases may be credited, which need a ticket, and who can approve. Merchants remain responsible for their own licensing and for compliance with the rules of the markets they operate in, and SF PayGate reviews merchants before going live.
Use the checklist below as a pre-launch review, and keep one idea in mind: the slip is a fallback, not the main road. Most transactions should finish at the webhook and the query API.
- Your webhook verifies HMAC-SHA256 and returns HTTP 200 only after successful processing.
- A query API check exists as a backstop when a callback does not arrive.
- No process credits a balance by hand from looking at a slip image.
- Players' bank accounts are registered in advance for sender matching.
- A written policy covers late slips, wrong amounts and slips for other orders.
Frequently asked questions
- Can QR payload verification replace the webhook?
- No, the layers are meant to work together. The signed webhook is the primary path and the query API is the backstop. The slip is Layer 3, used when a customer says they paid and the first two layers have not shown the credit yet.
- Why is a highly accurate OCR engine still not enough?
- Because OCR accuracy means reading the image correctly, not proving the image is genuine. A cleanly edited number will be read exactly as drawn, and OCR has no built-in way to know whether a slip was already used.
- What does the stored hash do?
- It lets the platform remember that a transaction has already been used to confirm an order. If the same slip is submitted again, it is rejected, even when the image file differs because it was screenshotted or recompressed.
- What if the customer sends a slip cropped so the QR is missing?
- Ask for the original slip from the banking app again. If the customer cannot provide it, open a case with POST /api/me/issues so the team can investigate and a request_id exists for tracking.
- Is a slip submitted after the order expires credited automatically?
- It should not be. Treat it as a case that needs checking to see whether funds actually arrived, then resolve it under the merchant agreement. Expired orders are not charged.
- Do I need to register player accounts first?
- It is recommended, using POST /api/v1/customers/{id}/accounts, because deposits must come from the customer's registered bank account. Sender matching lets you confirm that the payer is the account holder you expected.