Production monitoring

When a payment gateway fails: monitoring third-party integrations

An online shop commonly relies on third-party services during a purchase: a payment gateway, delivery providers, third-party sign-in, or stock and ERP systems connected through an API. You do not control these dependencies, but customers experience their failure as a problem with the shop as a whole. Monitoring the server alone may not detect it.

What the problem is

Infrastructure monitoring will often alert you when your own server goes down. If the payment gateway begins rejecting payments, however, your website may appear to be running perfectly. The server responds, the page loads and the “Pay” button is in place. The process fails only after the customer clicks it.

Healthy infrastructure indicators may accompany failing purchases. If checks do not cover the integration, customers may report the issue first. A drop in order count is another signal to investigate.

How we address it

Monitoring does not end at the boundary of your code. A real browser can complete an entire, safely prepared purchase scenario, including third-party services. It uses a separate test account and, where the payment gateway permits it, a test mode so that it does not create real payments. If the controlled journey does not reach its expected outcome, monitoring records the failed step even though your website is technically available. Test mode alone does not establish live gateway and bank behaviour.

Delivery selection, third-party sign-in and key APIs can be monitored in the same way. Depending on the tool used, a failure may include a screenshot, video or technical trace that helps distinguish between a problem in your system and one at the supplier more quickly.

We therefore add purchase-outcome checks to monitoring whether the “server is running”.

What each check actually establishes

For each integration, record the monitored journey, environment, account and final outcome. “Payments work” is insufficient. API availability, opening a payment form and a correctly paid order provide different kinds of evidence. This table proposes check layers, rather than measured availability:

Check What it may establish What remains outside it
Your website and payment preparation Basket, price and request creation Completion at the provider
Gateway test journey A controlled result in its test environment Live configuration and bank behaviour
Supported production signal A particular service or actual transaction state Every payment method and country
Order state after confirmation Correct records in the shop and downstream processing Other unverified purchase variants

Stripe recommends simulating test payments in a sandbox and prohibits live testing with real payment details. Internal approval or a small amount cannot override that prohibition. If a safe complete journey is unavailable, combine a check of your own part with operational signals and state the limitation in the report.

Verify the downstream effects of the dedicated account and test product. A test payment may be isolated at the gateway while your own system still sends an email or reserves inventory. Monitoring without fake orders explains the procedure.

Refusal does not automatically mean an outage

An expected test-payment refusal is a successful scenario if the shop shows the correct message and does not create a paid order. For actual transactions, distinguish business outcomes, technical errors and unknown states. A refusal code alone does not explain the cause. Read its meaning and reason in the provider’s documentation.

Adyen distinguishes Refused, Error and intermediate payment states. In Stripe, requires_action, processing or requires_capture may require a further step. Do not treat them as completed payment. Match success criteria to the particular method and any separate capture step.

A timeout may mean that the response never arrived even though the operation completed. First locate the transaction state. Monitoring must not repeatedly create a new payment without verification. For an unknown outcome, the alert should state that uncertainty rather than invent confirmation of failure.

Production signals help reveal gaps in the journey

Track started payments, confirmed outcomes, technical errors and older pending cases. Separate synthetic data and compare matching time windows. A payment success ratio needs a clear denominator. Website visits and payment attempts are not interchangeable.

Our example: two errors out of three attempts are approximately 67%, while 100 errors out of 1,000 attempts are 10%. A percentage alone does not represent impact or certainty. This illustrates working with volume, rather than a recommended alert threshold. At low traffic, falling order counts may also reflect ordinary variation or stock availability.

Where useful, split the signal by gateway, payment method, country and integration version. An aggregate may hide a single-method problem. Rules must remain understandable and every alert needs a clear expected response. Google SRE separates symptoms from causes and combines external checks with internal metrics.

Payment confirmation must reach the order

The customer’s return from the gateway is not the only evidence. Monitor event receipt and processing, pending jobs and discrepancies between payment and order states. Stripe documents repeated webhooks and unordered event delivery. A repeated event must therefore not fulfil the same purchase again.

Distinguish webhook arrival, signature verification and successful application processing of the business change. A 200 response from the receiver does not prove every subsequent step. Retain event and transaction identifiers for investigation. Full payment details and secret keys do not belong in an alert.

When comparing states, allow for the method’s normal asynchronous completion time. Investigate longer waits against an agreed limit rather than universally after a few seconds. Resolve a discrepancy through a supported procedure with protection against duplicate order changes.

Prepare incident evidence and verify recovery

First identify the last successful step. A missing payment form may point to your own configuration, a failed call to the network or provider, and a paid order without a state change to event receipt or processing. These are diagnostic leads. Confirm the cause with further evidence.

Give the owner the time and environment, affected method, attempt and error volumes, investigation identifiers and the last relevant change. A supplier’s public status page may help, but a healthy indicator alone cannot exclude an account or local integration problem. Send the supplier the necessary technical extract without customer data or secrets.

Enable an alternative payment method only if it is prepared and verified. Reconcile unknown transactions first so the customer does not pay twice. After repair, verify the previously failed journey, pending-event processing and correct orders. One successful run does not explain earlier discrepancies.

Before introducing monitoring, induce an agreed failure in a controlled environment and verify alerting, human acknowledgement and incident closure. Repeat the check after account, key or integration changes. A working journey with broken alerting cannot provide the agreed operational response.

What you gain

Next step

Does your purchase journey depend on a payment gateway or another third-party service? During a no-obligation consultation, we will propose a safe scenario scope, interval and alerting method.

Related topics

You might also be interested in

Detect an outage before a customer reports it

We write scripts that validate purchase, login and payment in production and plug them into your pipeline or scheduler - you run them.