Site Search for Web Apps: Postgres vs Elasticsearch vs Algolia
Choosing search for your web app? Compare Postgres full-text search, Elasticsearch and Algolia on cost, relevance, effort and when to outsource the build.
How to integrate a payment gateway into a web or mobile app: choosing a provider, hosted vs custom checkout, webhooks, security and testing before launch.
Taking money online looks simple from the outside: add a “Pay” button and connect a gateway. In practice, payment integration is one of the riskiest parts of a product. Mistakes lead to double charges, lost orders, failed reconciliation and compliance headaches. This guide walks a CTO, founder or product manager through the decisions that matter before a developer writes the first line of code.
Technical choices follow from a few business answers:
Compare providers on fit, not on brand recognition. A practical shortlist checklist:
| Question | Why it matters |
|---|---|
| Does it support your customers’ countries, currencies and local methods? | Missing a popular local method can cost conversions. |
| Is documentation clear, with official SDKs for your stack? | Poor SDKs raise build and maintenance effort. |
| Does it provide a sandbox with realistic test scenarios? | You need to test declines, refunds and disputes safely. |
| How are fees, payout timing and chargebacks handled? | Read the provider’s own terms; do not assume. |
| What does it offer for subscriptions, invoicing and tax? | Building these yourself is expensive. |
| Can you migrate away later? | Avoid locking your data model to one vendor. |
This is the most important architectural decision.
Hosted or embedded provider components. Card details are entered on a page or fields controlled by the provider. Your servers never touch raw card numbers, which greatly reduces your PCI DSS scope. It is faster to build and easier to keep compliant, with less control over design.
Fully custom card forms that post to your server. Maximum control, but you take on far more security and compliance responsibility. For most startups and mid-sized products this is not worth it.
A sensible default: use the provider’s hosted or embedded components, and style them to match your brand. Revisit only if a clear business need appears.
The client can tell your backend that a payment succeeded, but only the provider can confirm it. Always verify payment status server-side, either by calling the provider’s API or by processing a signed webhook.
Webhooks are how providers tell you about payments, refunds, failed renewals and disputes. Treat them as a first-class part of the system:
Network timeouts happen. If your server retries a “create charge” call, the customer must not be charged twice. Most providers support idempotency keys; use one per order attempt.
Store a payment record with clear states such as pending, authorised, paid, failed, refunded and disputed. Allow only valid transitions. This makes support queries and reconciliation far easier.
Store amounts in the smallest currency unit as integers, along with a currency code. Avoid floating-point numbers for money.
In mobile apps, store-policy rules can affect how you sell. Digital goods and subscriptions inside iOS and Android apps often must use the platform’s own billing system, while physical goods and services generally can use external gateways. Check the current App Store and Google Play policies before designing the flow. Wallet options such as Apple Pay and Google Pay can reduce friction considerably.
Payment bugs are expensive, so test deliberately:
Automating these cases in your pipeline pays off over time; see our third-party API integration best practices for related guidance on resilience and monitoring.
Track payment success rate, failed webhooks and refund volume. Alert on sudden drops in successful payments, which often signal an outage or configuration change. Reconcile your records against provider payouts regularly, and keep SDKs and API versions up to date.
Payment flows touch security, finance and customer experience at once, so they benefit from experienced engineers and careful testing. AkMo Technologies builds and tests checkout and billing for clients worldwide through our web development services. If you are planning a payment integration or need an existing one reviewed, contact us to discuss your requirements.
Choosing search for your web app? Compare Postgres full-text search, Elasticsearch and Algolia on cost, relevance, effort and when to outsource the build.
WebSockets vs SSE vs polling: how to choose the right approach for live dashboards, chat and notifications, with cost, scaling and testing trade-offs.
A practical guide to web application caching strategies: browser, CDN, application and database layers, plus invalidation rules and common mistakes.
Tell us about your platform, your product idea or the systems you want to modernise. Someone from our Chennai engineering team will get back to you personally.