To test Redsys, start with the sandbox and authorisation, 3DS and decline scenarios. If you need a Redsys test card with an expiry date and CVV, use the test card table and sandbox setup guide. This guide covers the full test plan for WooCommerce or an API integration, including subscription renewals.
Testing a payment integration means checking that the buyer, the payment system and your business all reach the same outcome. A “payment complete” screen is only part of that evidence. You also need to know what happens when the bank declines a transaction, the customer closes the tab or a confirmation arrives twice.
For an Andorran business connecting its online payment terminal to AndorPay, the goal is practical: collect the right payment, fulfil the purchase once and trace each operation through its references. This guide sets out scenarios and verifiable outcomes for both a custom application and a WooCommerce store.
What a payment test needs to prove
Every test needs an expected result in three places: the buyer's screen, the payment record and the order or service record. If the payment is confirmed but the order is still pending, the integration has an unresolved problem.
Add a fourth check: the action your business takes. Preparing a shipment, granting access or sending a confirmation must follow the agreed rule without duplicates. A correct database status is not enough if the warehouse receives two instructions to pack the same order.
For example, a purchase of a digital resource might require a confirmed payment, a paid order and one active entitlement. If the notification arrives again, that entitlement should remain the same. This turns a vague “it works” into a testable statement.
Keep the test environment separate from real sales
Use the appropriate sandbox credentials. With AndorPay, a key beginning with ap_test_ selects the test environment for the checkout session; production keys begin with ap_live_. A session's environment cannot change after it has been created.
Check the Redsys merchant, terminal and credentials used for testing as well. A valid application key cannot fix an incorrect banking configuration. When using card payments through inSite, the exact HTTPS origin that loads the form must be allowed.
Prepare an identifiable test order, a fictional buyer and a valid return address. Make sure the test cannot trigger a real shipment or a confusing message to an actual customer. Your notification endpoint must be reachable over HTTPS and use the signing secret for the relevant environment.
Our AndorPay testing guide contains the current test data and conditions. For cards, also consult the official Redsys test environments. Test card details cannot be used to pay in production.
Choose tools according to the question you need to answer
You do not need a large collection of applications. You need visibility into the request, the response, the buyer's interaction and the resulting business action.
| Tool | What it helps you check | What it cannot prove on its own |
|---|---|---|
| HTTP client or cURL | Authentication, submitted data and API responses | That the buyer has paid |
| Browser and developer tools | Redirects, messages, errors and mobile behaviour | The final banking outcome |
| Server logs | Event receipt and application of business rules | What the buyer saw |
| Order and payment lookup | Matching references and statuses | That every failure scenario is covered |
| Automated test | Repeatable, controlled scenarios | Real behaviour on every device and with every bank |
Start with a minimal working request, then integrate it into your application. This helps distinguish a credentials problem from an error introduced by your code. Keep the references needed to follow the operation between systems.
When a test fails, change one variable at a time. Changing credentials, domains and order data together makes it hard to establish which change fixed the issue. Run the original scenario again and record the version you actually tested.
Creating a session does not mean collecting a payment
In the REST integration, a successful creation response includes the hosted checkout address. Open that address exactly as the API returns it. Do not construct an approximate URL or treat session creation as a paid sale.
Before testing cards, check three cases: incorrect credentials, invalid data and valid session creation. The first two should produce a useful error and leave the order unpaid. The third should preserve the link between the order and session before sending the buyer to checkout.
Follow the contract for each operation. For example, POST /v1/checkouts does not accept the Idempotency-Key header. Adding it to every request as a general rule causes an error. The REST documentation explains this endpoint's behaviour.
If your application loses the response or receives a pending outcome, investigate the existing session and operation before creating another payment. Retrying a communication and requesting a fresh payment authorisation are different actions.
The essential card payment scenarios
Use the scenarios supported by your banking test environment and the corresponding test data. Write down the expected outcome before running each case.
| Scenario | What the buyer should see | What the business should verify |
|---|---|---|
| Authorised payment | Clear confirmation and next step | Confirmed payment and one fulfilment |
| Additional authentication | Instructions to complete verification | Order remains pending until the outcome is known |
| Declined payment | Helpful message and an appropriate way forward | No fulfilment or paid status |
| Customer cancellation | Clear return to the purchase | Status consistent with the actual outcome |
| Customer closes the tab | Ability to check the purchase later | Confirmation does not depend on their return |
| Pending response | A waiting message that does not prompt another payment | Existing operation is checked and resolved |
For additional authentication, test both completion and abandonment. Testing only the quickest path will not show whether your store recovers correctly when the bank requires another step.
Repeat a purchase on mobile. Check the keyboard, scrolling, switching to the banking app and returning to the browser. The buyer should recognise the product and total throughout the journey.
Include options your store actually uses, such as delivery, a discount or a quantity change. The amount submitted for payment must match the order your business will fulfil, including after a basket update. A successful authorisation for the wrong order total is still a failed integration test.
A browser return is not payment confirmation
A success return address continues the buyer's journey. It should not be the only condition for releasing an order. The customer may close the tab after authorising payment; they may also reopen a saved return address without making another purchase.
Check that your server acts on verified confirmation or an authenticated lookup of the payment status. Reopen the return page: it must not trigger another delivery or arbitrarily change the outcome.
Test the opposite situation too. Close the browser after authorisation and inspect the order. If the notification completes it correctly, you have verified that your business does not depend on that final customer click.
Test notifications, including failure cases
A webhook is a notification sent to your server. In AndorPay, its signature must be verified before it triggers business actions. The webhook guide covers verification against the original request body and the accepted time window.
Prepare these cases in a controlled environment:
- Valid signature: the receiver accepts the event and updates the correct operation.
- Modified signature: the message is rejected without changing orders or access rights.
- Timestamp outside the allowed window: the message is rejected according to the contract.
- Temporary receiver failure: a later delivery can finish the outstanding work.
- Repeated event: its identifier is recognised and fulfilment is not repeated.
- Events arriving in a different order: the system retains a consistent state instead of relying only on arrival order.
Duplicate handling must protect the resulting actions too. Check the email, access grant and fulfilment task as well as the order record. A repeated event should not produce several equivalent business actions.
Simulate an unavailable receiver in a test installation. Record which event remained outstanding, when it arrived again and what action followed. Do not deliberately interrupt notifications for real sales to perform this exercise.
A useful automated test can assert that the second delivery leaves the number of access grants unchanged. A separate check can confirm that a rejected signature makes no changes at all. These small assertions are more informative than checking only that the endpoint returned an HTTP response.
Testing a WooCommerce store
Use a private browser window and an identifiable test product. Check the plugin's test configuration, currency and the purchase journey your store actually uses. Include your checkout type and extensions that change fields, shipping or discounts.
After payment, inspect the order status, order notes and transaction reference. The screen message must agree with those records. If several tabs are open, also check that the operation belongs to the correct order.
The plugin uses notifications and recovery mechanisms. If a confirmation is delayed, inspect endpoint connectivity and scheduled tasks before concluding that the bank declined the payment. For technical diagnosis, the andorpay-card-gateway logs and the andorpay-card Action Scheduler group help trace the journey.
The payment synchronisation action checks the existing operation. It helps recover its status; it does not request a new authorisation or justify manually marking an order paid without verification. Follow the WooCommerce guide for the current configuration.
Apple Pay, Google Pay and Bizum need their own tests
A visible button does not prove that a full payment authorisation has succeeded. First check device and browser eligibility, then the payment method's presentation and finally the transaction outcome, where the environment supports it.
With Apple Pay, a test can validate the payment sheet and merchant session without completing an authorisation in the ordinary Redsys sandbox. Full testing depends on the agreed certification environment and enabled capabilities.
With Google Pay, opening the sheet in test mode also does not prove a Redsys authorisation. The terminal, X-PAY support and test credential type must meet the conditions described in the documentation.
Our Bizum integration uses RTP. Check its availability and the scenarios for the relevant environment. Do not assume a failure automatically switches the buyer to the traditional redirect flow. Record separately what you have tested and what still needs validation.
Subscriptions: test what happens after sign-up
If your business collects subscription payments, a successful first purchase does not validate renewal. Add a renewal cycle, a failed outcome and the subsequent actions your application actually uses.
Check which service period the payment covers and how it affects access. For example, a failed attempt should not create another subscription for the same service. Define the message the customer receives and the information available to the person handling the issue.
Available operations depend on account configuration and the documented contract. A capability that has not been enabled should produce a controlled outcome. Do not turn that error into a false confirmation to make the journey appear complete.
Keep refunds separate from payment collection as well. The refund API for Redsys is not enabled in AndorPay's documented flow. A test should verify that an unsupported operation does not falsely mark a payment as refunded. The applicable handling process needs to be agreed through the appropriate channel.
Keep enough evidence to investigate unexpected results
Prepare a short record for each test. Another person should be able to reconstruct what happened without initiating another charge “to see what happens”.
| Field | Example of useful information |
|---|---|
| Scenario | Authentication completed, then browser closed |
| Environment | Sandbox and integration version |
| References | Order, session, request_id and event.id, where available |
| Expected outcome | Paid order and one access grant |
| Observed outcome | Payment status, order status and action performed |
| Evidence | Time, relevant response and logs without secrets |
| Follow-up | Corrected error or limitation still to verify |
Do not include API keys, secrets, full card numbers or security codes. Keep the identifiers and messages needed for diagnosis. Evidence should explain an operation without becoming a copy of payment credentials.
When can you consider testing complete?
Close a scenario when the observed outcome matches the expected outcome and business actions happen once. If you have only verified that a wallet opens, record that precise scope. It is not yet approval of the entire payment method.
Before production, review credentials, allowed domains and event delivery for that environment. Live validation needs an agreed scope and authorisation for the operation. Sandbox and production checks are separate pieces of evidence.
Keep a small set of tests to repeat after updating the plugin, changing checkout or modifying fulfilment logic. Prioritise authorisation, decline, duplicate confirmation and status recovery: they directly affect correct collection and customer support.
Retest the specific failure after fixing it. If a duplicate event previously sent two emails, verify the corrected email behaviour as well as the payment status. This closes the original problem instead of relying on a different successful purchase as a substitute.
Build an integration your team can operate
If you are still choosing how to connect your business, start with the difference between hosted checkout and an API. For a custom application, our guide to payment integration SDKs explains what the tool handles and what remains your application's responsibility.
At AndorPay, we can review the payment journey your Andorran business needs and the checks required for its connection. Tell us which platform you use and how you collect payments so we can plan an integration with clear outcomes from the first test.
