An SDK can simplify a payment integration, but the job is complete when the payment is linked to the order and produces the right result in your application. Start by identifying what you are connecting: the bank's payment processing, a hosted checkout or the system that manages your collections.
If you are building a website or service for an Andorran business, this guide helps separate the library's work from your application's responsibilities. With AndorPay, you can prepare an API connection and use payment events to continue the sale, without treating an accepted request as a completed payment.
SDK, API and plugin: understand their roles
An API defines how two systems communicate. An SDK provides tools for working with a service in a particular language or environment. A plugin connects that service to a platform, such as an online store, and usually includes decisions about how the connection works.
These are not interchangeable options. A custom application might call an API through an SDK. A store might install a plugin that makes those calls internally. The merchant needs to understand the final journey; the technical team needs a connection it can maintain.
The official Redsys integration libraries help prepare parameters, requests and signatures. Your application still needs to connect the transaction to the purchase and update its state appropriately.
Begin with your application's problem
If you already use WooCommerce, first check the integration available for your setup. Building a connection from scratch can introduce work the plugin already handles. Our WooCommerce guide explains how AndorPay connects the payment journey to the order.
For a custom application, identify who creates the purchase, which server holds its reference and which event permits fulfilment. That tells you where a library could help. Choosing a package simply because it installs quickly does not resolve the relationships between your systems.
Choose the service you need to connect
Integrating directly with a processor and connecting a platform that manages collections involve different responsibilities. Map the parts first: application, server, payment screen, confirmation and the system delivering the product or service.
In an AndorPay journey, your server can create a checkout session and direct the customer to the returned URL. The application then receives the relevant notifications to continue. Our REST guide documents that contract; you do not need to assume an official SDK exists for every language.
Make this choice clear before combining code examples. A Redsys key, signature or field does not necessarily have the same format or purpose in an AndorPay request. At each stage, follow the documentation for the service you are actually calling.
What a library can save you
A library that fits the contract reduces repeated communication code and helps you use the expected formats. It can also make the connection easier to understand: the team knows where a request is constructed and where its response is interpreted.
That matters during maintenance. If a service changes its format, you want to find the affected code and check the update without searching the whole application. Keep the connection in a focused module and translate its results into the states your business uses.
An order screen, for example, should not need to know every banking parameter. It can show whether confirmation is pending, the payment is complete or a customer action is required. Technical details remain available for diagnosis in the component responsible for the connection.
What your server still owns
The server links the purchase to its customer, product and agreed terms. It also controls what it accepts from the browser. A buyer can choose an option, but the application needs to check that the choice corresponds to a valid offer.
In AndorPay's REST integration, the API key is a server secret. It does not belong in public JavaScript or in the response sent to the buyer. The browser receives what it needs to continue, such as the checkout URL provided by the service.
| Responsibility | Question your implementation must answer |
|---|---|
| Purchase | What is being bought, and under which reference? |
| Customer | Which account does this transaction belong to? |
| Request | Which service and environment receive the data? |
| Confirmation | How is the returned result verified? |
| Fulfilment | What action should this payment trigger? |
| Follow-up | Where can a pending transaction be checked? |
Check who is allowed to initiate each action too. A correctly formatted request does not establish that it should run for any user or order. Your application keeps that responsibility even when a library constructs the request.
A technical response does not complete the sale
Creating a session starts a payment journey. It does not confirm the customer has completed it. Likewise, a return URL gets the buyer back to your website, but should not be your only basis for marking an order as paid.
The customer may close the window after authorising, lose their connection or return while the result is still being updated. Your system needs to receive confirmation and associate it with the purchase independently of that screen.
Our payment lifecycle documentation explains this distinction. Use it to define the states shown in your application and prevent a navigation problem from becoming another payment attempt.
Include notifications from the start
Webhooks let your server receive events about what happened. Verify the message according to the documented contract before applying its contents. Keep the relationship between event, transaction and order so the effect can be traced.
Your application should recognise a notification it has already received. If the first message activated a service period, receiving it again should not extend access for another period. Record which effects have already been applied, even when the sending service redelivers the message.
See our webhook guide for the AndorPay contract. Separate message verification from the business action that follows. This lets you investigate a fulfilment issue without requesting a payment that has already been confirmed.
Check the contract before automating retries
Services can have different rules for repeating requests. General advice about idempotency does not replace the documentation for a specific operation. Check which headers it accepts and what sending the request again will do.
Our REST guide specifically states that POST /v1/checkouts rejects the Idempotency-Key header. Do not copy an example from another provider that adds it by default. If a response leaves the result uncertain, retain the available reference and check the state before creating another payment action.
Also distinguish repeating a status query, creating another session and executing a charge. They have different consequences. Error handling should follow the operation involved rather than a blanket rule that retries every failed request.
Assess a dependency before adding it
Check who publishes the package and which documentation describes its scope. Review supported languages and versions, the integration type and the update process. A name resembling the provider's brand does not establish that a package is official.
Prepare a small test in the right environment and record the version used. It should show that you can construct a valid request, interpret the response and handle a known error. Then connect that result to a test purchase in your own application.
Avoid adding a dependency solely to hide a straightforward request. If your existing tools make the API connection clear, weigh the package's additional maintenance work. The useful choice is one that leaves the integration understandable to whoever will investigate an issue later.
Leave a clear handover
Record where configuration is stored, how the environment is selected and which references support diagnosis. Include the path from a customer-facing order to its payment result. Someone who did not build the integration should be able to follow that path without asking the original developer to reconstruct it.
Keep the handover short and tied to the running system. A diagram of the actual journey and a few verified scenarios are more useful than pages of generic payment terminology. Update the notes when the connection changes.
Test the complete journey
Check an accepted payment, a decline and an abandonment. Add a repeated notification and a confirmation arriving after the browser closes. In each case, compare the payment result with the order or service-access state.
Use credentials and test methods for the appropriate environment. Do not mix production settings into a demonstration to make it succeed. Our testing guide describes scenarios and limitations for the different payment methods.
Before launch, name the person who handles issues and the references they will need. A useful test should also show that you can explain a failure without searching logs for keys or full card details. Diagnosis needs transaction context, not information your team should not be storing.
Frequently asked questions
Does an SDK remove all integration work?
It can simplify communication with a service, but your application must still link the payment to the purchase, verify events and apply their results. The exact scope depends on the tool you choose.
Do I need an AndorPay SDK for my language?
You can connect a backend through the documented REST API. Review its contract and required capabilities before choosing a dependency. If you use a compatible store platform, start by examining its available integration.
What do you need to review my project?
Share the platform, server language, bank and a sketch of the purchase journey. Explain whether you sell products, services or subscriptions and what should happen after payment. Tell us about your integration so we can define the connection with you.
