Payments routed to another acquirer
Filter your acquirer's own webhooks for Pay.com payments, and see where refunds and disputes on a routed charge go.
When Pay.com routes a payment to an acquirer account you hold directly, that acquirer processes it as one of its own transactions. Pay.com reports the payment with its own IDs and webhook events, while the acquirer's systems also record the transaction and emit their own webhooks.
Pay.com's reference at the acquirer
Pay.com sends each attempt to the acquirer with its own reference, made of the
digits of the Pay.com ID, then aid, then the attempt number. For example, the
first attempt of chrg_685125114794084352 reaches the acquirer as
685125114794084352aid1. A later attempt for the same charge, such as a
fallback to a second acquirer, uses 685125114794084352aid2. A payment in a
payment session uses the digits of its ps_ ID.
Pay.com IDs carry 18 to 20 digits, and the attempt number has one or two digits, so this regular expression matches the start of a Pay.com reference:
^\d{18,20}aid\d{1,2}A refund is its own transaction with its own ID, so its reference uses the
refund's digits (687103676153594880aid1 for rfnd_687103676153594880).
Filter the acquirer's own webhooks
If you registered webhook endpoints directly with the acquirer, it keeps
sending them events for every transaction on your account with it, including
the ones Pay.com routed there. Pay.com sends you the same outcomes as its own
events, such as charge.succeeded and charge.failed, so handle a routed
payment once, from Pay.com's events.
In the handler for the acquirer's webhooks, read the event's merchant reference and skip the event when the reference matches Pay.com's format. Which field carries the reference depends on the acquirer, so check its webhook documentation.
const PAYCOM_REFERENCE = /^\d{18,20}aid\d{1,2}/
function isPayComTransaction(acquirerReference) {
return PAYCOM_REFERENCE.test(acquirerReference ?? '')
}To receive Pay.com's events, see Webhooks.
Refunds
A refund goes to the settlement account and processor that approved the charge. After a fallback, that's the fallback's account, not the first one Pay.com tried. Pay.com doesn't run routing rules or fallbacks for refunds, so if the acquirer declines a refund, the refund fails without retrying on another account. Captures and cancellations of a hold also go to the settlement account that authorized it.
To refund a charge, see Refund a charge.
Disputes
A dispute on a routed charge is raised through the acquirer that processed the
charge. In Pay.com, the dispute identifies the disputed charge in charge and
the settlement account it was booked to in settlement_account, so you can
tell which acquirer it came from. To respond, see Disputes on third-party acquirers.
Next steps
- How routing works: How Pay.com picks the settlement account for each payment.
- Fallbacks and retries: Read the attempts behind a charge that was retried on another route.
- Refund a charge: Return all or part of a charge with
POST /v1/refunds.