Skip to main content
Next Defence - Next-Gen AI Cyber Security Firm
Australia & New Zealand[email protected](02) 9064 2614
INSIGHT

Retail POS integrations: what a valid payment token can still do

Guidance for Retail, Hospitality & E-Commerce on retail pos integrations: what a valid payment token can still do: assess the real access path, supporting evidence and safe control tests.

A payment token should not decide which order can be refunded

A retailer integrates point-of-sale terminals with a payment gateway. A terminal uses a valid token to obtain a transaction confirmation, and that token also happens to call a refund endpoint. If the refund request can reference an unrelated purchase or another merchant account, an authenticated integration may create an unauthorised financial action. The security control cannot be reduced to whether the token is genuine. It must decide whether this merchant, operator and transaction are allowed to perform the specific refund.

An ordinary store will have complex returns. Customers may split payments, exchange goods, receive partial refunds or return to a different branch. A restrictive design that ignores those legitimate cases can create queues and pressure staff to use shared supervisor accounts. Start with the end-to-end financial instruction: original capture, order relationship, return authorisation, beneficiary or card-token destination, refund approval, gateway response and settlement reconciliation. Authentication is only the first step in that chain.

Find the merchant and transaction boundaries

Inventory the terminal identity, merchant identifier, gateway permissions, checkout service, refund service and any background worker that retries failed callbacks. A token might be issued to a store but interpreted as an enterprise-wide merchant credential at the gateway. The retailer needs to establish whether a refund can be created without naming and validating the source payment. A form field showing the original sale does not prove that the server checked it against the requested refund.

Ask how payment actions are scoped: by merchant account, token audience, permitted operation, original capture, currency, amount remaining refundable and authorising staff role. In a multi-brand group, a central account may legitimately settle several merchants; the application must still prevent funds being credited from an unrelated order. If the gateway supplies only broad API scope, the retailer’s own service may need to enforce the narrower business rule before calling the provider.

Build the expected transaction from the ledger

Use synthetic purchases to create an approved sale, a partial return and a completed refund. The operator should be able to link the point-of-sale receipt to the payment capture and final refund confirmation, even when those records use different identifiers. Check that the amount remaining refundable reduces after each accepted return. A refund screen that displays “success” before the gateway has committed the payment does not show the final ledger state; follow the transaction to settlement or an equivalent safe test confirmation.

Now attempt a wrong-order refund while using a technically valid terminal token. The target transaction should not belong to the caller’s merchant or authorised return. The expected outcome is a refusal without financial side effect, with an audit event that identifies the merchant, initiating application and reason for denial. Test that the outcome is the same through any direct API path, administrative tool or queued callback, not only the customer-service screen.

Webhook retries are not new payment instructions

Payment notifications can arrive late, twice or out of order. Those behaviours are normal enough that an integration must not treat every callback as permission to create another refund. Associate the provider event with a unique business refund request, store its processed state and ensure retries cannot produce an additional release. Distinguish an attempt to refund, a provider acceptance, a pending settlement and a confirmed completed transaction. The finance team should be able to reconcile all of them.

An attacker may not need a stolen token if a legitimate service mishandles these states. For example, a cancelled return might trigger an old background retry after the order state changes. The relevant negative test is not simply an invalid signature; it can be a valid signed callback attached to a request that is no longer eligible. A robust design checks current transaction authority as well as message authenticity, and leaves evidence explaining why a stale event was ignored.

Test legitimate edge cases before restricting scope

A split tender can produce multiple payment captures for one basket. A partial refund may have to be allocated across those captures, while a gift-card adjustment follows a different accounting path. Write these expected cases with finance and store operations before deployment. Compare the original net value with the sum of authorised refunds and outstanding balance. The correct control should permit an authorised partial return without allowing a second callback to release the same amount again.

Cross-store returns are another important case. If central policy permits them, the authorising location should not gain unrestricted access to every shopper’s purchase history. Prefer a narrow reference to the original sale and the approved refund amount, with additional verification when the merchant relationship changes. Staff should not be forced to search a broad payments database to validate one authorised return. Document how chargebacks, voids and cancellations interact with the same ledger.

Preserve the distinction between fraud and integration failure

When an anomalous refund appears, collect terminal identification, token issue and scope, original order reference, return approval, API request ID, callback ID and bank settlement. Join events using provider and retailer timestamps without assuming their clocks match. A duplicated webhook, staff data-entry error and maliciously altered instruction can produce similar accounting symptoms. Investigators should identify which mechanism the evidence supports instead of automatically assigning every duplicate to credential theft.

Assess where the money or credit actually went. A suspicious refund request that the provider rejected has a different consequence from a completed payment to an unexpected card token. If personal information was retrieved, record which customer fields were visible and to whom. A high call volume may reflect a bulk store closure or reconciliation job; align analysis to the business calendar before declaring a compromise. Preserve enough detail to support disputes without copying payment-sensitive material into general incident documents.

Revoke overbroad credentials with a workable store fallback

If the same token permits both sale confirmation and unrestricted refund creation, create distinct credentials or server-side entitlements for those functions. Retire the old scope through a staged change. Recheck mobile tills, offline checkout queues and terminal caches so a previously issued token cannot continue privileged operations unnoticed. For a temporary gateway outage, offer an approved manual return process with independent supervisor approval and later finance reconciliation, not an unlogged bypass to the refund API.

The payments product owner should set a cutover date and test the refused cross-merchant case at the actual gateway enforcement point or a representative contracted test environment. Finance should sign off the settlement reconciliation and verify that accepted refunds remain correctly recorded. Customer-service management should confirm that the process still supports genuine returns within acceptable time. These acceptance decisions should be named separately because a technically successful token rotation can still create double refunds or trapped orders if state handling is wrong.

Demonstrate the financial outcome, not merely the API response

A useful completion pack includes the original payment, allowed refund, denied unrelated refund, duplicate callback test, current token scopes and final reconciliation. Ask another reviewer to repeat the cases after the next gateway SDK update or merchant account migration. If a vendor cannot expose sufficient logs to prove the result, describe that assurance gap and obtain compensating reconciliation evidence rather than declaring it irrelevant.

The central question remains whether a valid credential can carry out a business action on the wrong transaction. Strong authentication protects who is calling; merchant-, order- and settlement-aware authorisation protects what that caller can do. Both are necessary to preserve customer trust and the accuracy of the retailer’s financial records.

Measure authorisation failures alongside refund defects

Maintain a small operational review that compares wrong-merchant denials, duplicate callback suppression and ledger exceptions. An increase in refused requests could mean attempted misuse, a terminal misconfiguration or a legitimate business-policy change. Assign investigation to payments engineering and retail finance together, preserving transaction references without copying cardholder secrets into the monitoring system. Use the findings to refine merchant assignments and alert thresholds, not to replace the transaction-bound permission check.

Sources and further reading

Explore Next Defence expertise

Next Defence can help retail payment and application owners validate a gateway token against the specific merchant, order and permitted refund action. A controlled test can compare payment-token scope, POS calls, settlement records and attempted cross-order requests without touching live transactions. Success means a legitimate refund remains possible but the same token cannot expose another shopper’s purchase or create an unrelated refund.

Explore Application Security & DevSecOps ↗

LET'S TALK

Let’s talk about your security.

Tell us what you are protecting, where you need greater visibility or what you want to achieve. We will help identify the right next step.

Talk to a Security Specialist

Describe your security requirements. Please do not submit passwords, credentials or confidential incident evidence. This form is not an emergency incident-response channel.

Form powered by HubSpot. Review our Privacy Policy. If the form doesn’t load, email [email protected].