How to Build a Payment Gateway — Definitions and Central Questions

Digital platforms are the go-to spots for e-commerce — and terminals for countless payment transactions. Online marketplaces like Amazon or Alibaba present themselves as the popular top dogs in this area. But they only compose a fraction of the platform economy.

Today’s online marketplace platforms offer goods, services, jobs, and business partners. And then, we’ve said nothing about comparison portals like Check24. They browse external platforms to find the best offers, acting as “meta marketplaces” of a kind.

But whatever platform you use: The point will come when you will have to pay for what you have obtained. At this point, Payment Service Providers and Payment Gateways make their appearance. It’s their job to detect fraud and validate the purchasing agreement. And ultimately, to debit your account and move your money — in the virtual as well as the physical sphere.

Payment: The Bottleneck of Online Marketplaces

But when we talk about jobs, we have to talk about qualifications.

A high number of PSPs aimed at single-merchant online stores struggle with the challenges posed by the platform economy. Digital marketplaces have a much broader scope than single e-commerce shops. They not only have to deal with multiple customers but also with multiple merchants. Therefore Payment Solutions are not only a potential point of failure in the relation buyer↔marketplace. They also have the potential to jeopardize the relation seller/supplier↔marketplace.

Also, the regulatory and contractual requirements prove different than those of isolated online shops.

As the owner of an online marketplace platform, choosing the right Payment Service Provider for your distinct business model demands much forethought. You have to weigh your possibilities and consider factors like customer experience, security, compliance, and fees.

And if you don’t find the exact fit, you don’t have to settle for subpar solutions. Creating your own Payment Gateway is always an option. And it gives you a possibility to integrate more than just one Payment Service Provider and to avoid vendor lock-in.

But it’s better to explore this option in detail. This will help you find your own answer to the pressing question of “Buy or Build?”.

Before anything else, we will look into how Payment Gateways for marketplaces differ from the more straightforward single-store variant.

Let’s go through those Payment Solutions. Step-by-step, right through the front door.

Primary Note: Defining Payment Terms

Digital payment and e-commerce, even the internet itself are fairly young technologies, as are their corresponding industries. This means that the terminology might not be as clear and indisputable as in other fields. In fact, definition-breaking innovations are developed and made public literally as you read these lines.

Accordingly, you might find varying definitions of Payment Gateways, Payment Providers, Payment Methods and the like around the web. Here are a few terms you will encounter throughout this article series and short definitions of them.

Payment Gateway

A payment solution authorizing and processing online payments, via one or more integrated Payment Service Providers. Refer to the section “What Is a Payment Gateway” for details.

Payment Service Provider (PSPs)

Technology providers, offering software for accepting certain payment methods like direct debit, bank transfer, PayPal, credit card, etc.

Payment Method

A specific way of paying, requiring specific payment processing. Credit card payment or direct debit would be different Payment Methods for example.

Payment Instrument

The definite personal means of payment used in a specific payment flow. For example, if you are choosing the Payment Method credit card during checkout at an online marketplace, you could pay with your Visa credit card as the Payment Instrument.


The party using an online marketplace or e-commerce platform to obtain goods or services by paying for them. The term buyer and customer is used synonymously here.


The party using an online marketplace of e-commerce platform to offer goods or services for consumers to purchase. The terms supplier and seller are often used as synonyms.

Now that the terms are clear, we can dive right into the details.

What Is a Payment Gateway?

In our sense, a Payment Gateway is defined as a piece of software used by online service providers, to authorize and conduct digital payments. Almost all online purchases require a Payment Gateway — from e-commerce shops, to marketplaces or to web-based service platforms.

You could picture a Payment Gateway as the digital equivalent to a physical point-of-sale in a brick-and-mortar shop. It acts as an interface between the consumer and the merchant. As such, a Payment Gateway manages payment data and passes them in both directions: It sends the Consumer’s payment data to one of the PSPs. The PSP then processes the payment, accepting or rejecting it. The amount of time this takes varies depending on the payment method. Finally, the Payment Gateway informs both parties, Merchant and Consumer, of the payment’s success or failure.

How Do Payment Gateways and Payment Service Providers Differ?

Payment Gateways are not to be confused with Payment Service Providers. Payment Gateways authenticate and trigger the actual transaction, passing on the transactional information to Payment Service Providers. The PSP’s Payment Processors become active then. It handles the accounting, i.e. the transfer of money from one account to the other.

We have to take the plural of “Payment Service Providers” literally here. Payment Gateways generally include multiple PSPs and support multiple Payment Methods: Debit and credit card transactions, bank transfers, even cryptocurrency payments. In addition, many marketplaces settle for Payment Gateways supporting local payment methods of choice. Take Ali-Pay and WeChat Pay in China, e-cheques in the US, Sofortüberweisung in Germany or Boleto Bancario in Brazil.

All in all, we can understand Payment Gateways as Payment Service Provider Integrators. They typically have a routing logic to choose the best Payment Service Provider for the given payment flow based on criteria like country, merchant category code, verification level and risk level of the consumer, transaction costs and so on.

Who is Involved in a Marketplace Payment?

The exact number of parties and the nature of their connections depends on the payment method used during the checkout.

One thing is certain, though: On digital marketplaces, consumer accounts and merchant accounts are not the only parties involved and connected through the Payment Gateway. Most often selling parties and platform operators don’t coincide.

Thus, some Payment Gateways incorporate a usage fee, that merchants have to pay to a third party, the marketplace owner, just when the transaction takes place. For credit card payments, you may have additional parties between the merchant and the customer, such as Acquirer and Card Scheme Provider. And then, maybe you don’t pay with FIAT currencies at all — in case of cryptocurrency payments the players involved would be quite different.

Whatever the lineup, Payment Gateways connect all those parties as the payment-authorizing technology.

But let’s look at an example here. These are the parties, who would be part of a Payment Transaction, in which the consumer settles the bill via a bank transfer.

Involved Parties in Marketplace Payment Transactions

Also mind, that bundled transactions on marketplaces are common. Consumer’s baskets may contain multiple goods and services from different stores, and thus processing a single payment on the Consumer’s side will include handling the settlement of several merchants and merchant banks.

What Factors Are Important in Payment Gateways for Marketplaces?

It’s important to pay attention to these relationships when deciding on a Payment Gateway for your platform. Mainly, don’t take the first solution off the rack, but make sure it operates exactly how your business model and infrastructure need it too. These are the key factors to mind:

Data Processing and Historical Payment Data

The simple reason being: That is what Payment Gateways are here to do, passing on information from one payment party to the other. It’s not as simple as that, of course. Payment Gateways must be able to securely handle and process the data. Any leak might result in significant damage to reputation and finances.

Other crucial aspects of data processing would be reporting and management of historical payment data — important for recurring transactions, fraud prevention, callback handling and transaction reconciliation with PSPs.

Historical payment data is also where we enter the field of data analytics. Analytics functionalities give marketplace owners tools to optimize flows and costs based on preferred payment methods or to give out AI-calculated product or service suggestions to consumers.

Multi-Party Transactions

As mentioned above, Payment Gateways used in online marketplaces will have to support transactions with more than two parties involved. The exchange of goods for money between the Consumer and the Merchant is expanded by the third party: The Marketplace Owner, who may charge a fee for each transaction or hold back money for the Merchant until specific conditions are met.

Additionally, customers of online marketplaces often bundle their orders and purchase from multiple merchants at once in a single basket/payment process. Payment Gateways have to unknot and properly assign and process such transactions and real-world money flows, too.

Multi-Currency Support

The internet knows no borders. Of course, this also applies to all kinds of online commerce. Thus, multi-currency support is a must-have for marketplace owners. Consider choosing a Payment Gateway that can handle foreign currencies and authorize international payments. This does not only broaden the range of potential buyers. It also gives customers a feeling of familiarity. And this positively impacts the user experience — which takes us right to the next aspect.

User Experience

Cumbersome, non-transparent check-out and payment rank among the top reasons why consumers abandon their shopping cart mid-purchase. When planning how you want your marketplace’s payment to play out, take on a consumer’s mindset. They should never lose orientation during the check-out process on your marketplace platform. So make sure to present the relevant information when they are needed and keep the payment process simple and straightforward.

This might mean that you choose Payment Gateways, which don’t redirect to other pages and adjust the UI for an optimal experience. Also, request only information from the customer, which is unavoidable for the transaction to proceed.

Merchant Experience

As said above, consumers are only one side of a transaction. Don’t forget the merchants — they are users of your marketplace, too. For starters, make onboarding easy for merchants. Also, provide them with a clean UI, allowing them to report payment issues and take countermeasures.

Whatever you do, make sure to decide in favor of a Payment Gateway with recurring payment support. This way, your merchants can offer continuous services or subscriptions for products.

Fraud and Risk Prevention

It’s not a question of having it or not having it: Your Payment Gateway must be secure. Fraud and risk estimation functionalities form the backbone of any Payment Gateway worth its code.

But it must not only be secure: It must also be perceived as secure by your customers as well as your merchants. Perception is just as important as reality. If a merchant or customer makes only a single experience with security breaches, fraud or the like, they may stop using your marketplace platform.

Thus, you should pick a Payment Gateway with a high-security profile, including top-notch encryption standards, PCI DSS compliance, and tight KYC and Anti-Money Laundering processes. If you are dealing with high-volume purchases and large sums, you should not go without a Payment Gateway specialized in fraud detection.


If there is one thing no merchant likes, it’s waiting for the money to arrive. While it’s self-evident, that the online authorization by a Payment Gateway should only take seconds — don’t use a slower Gateway unless you have good reasons, such as multi-level security calls — transferring the money from the customer’s to the merchant’s bank account usually takes longer.

Mind though, that Payment Gateways work with what they come upon. Payment Service Providers and their associated Payment Processors play a huge role in how fast transactions will proceed. In any case, you should optimize the payment process as well as you can, so it runs smoothly. Ultimately, this means that you should have as much control over the outline and the functionalities of your Payment Gateway as possible.

Scalability and Compatibility

Payment Gateways are not built for eternity. Innovation in digital finance and online payment happens in a matter of months — take the rise of cryptocurrencies for example. Consequently, you may want to put extra focus on a flexible Payment Gateway, which you can easily adapt and update.

Ultimately, this equals building one yourself, as you cannot influence how third parties will update and maintain their Payment Gateway solutions. Yet, even if you settle for a turn-key product, you should at least aim for high scalability. Your Payment Gateway should be able to grow as your business grows and not suddenly hit the glass ceiling that is its own productivity.

Also, you must take into account that changes in the company providing the Payment Gateway for you might bring forth changes in the Payment Gateway’s reliability.


While it’s nice to dream about all the features you want your Payment Gateways to have, your budget tells you what is feasible. Compare costs and fees associated with different Payment Gateways and factor in development costs, if building your own Payment Gateway is an option. Payment Gateways that keep initial costs low, could make their profit via high fees and vice versa.

Keep your business plan in mind to evaluate how and when you will redeem initial costs.

Build or Buy — External vs. Self-Hosted Payment Gateways

Check the factors security, costs, performance, and usability against your business plan. This will give you a good idea of what your Payment Gateway has to accomplish.

But now you are confronted with a fundamental decision: Will you settle for an External or rather a Self-Hosted Gateway? It’s the notorious choice between Buy or Build.

External Payment Gateways are the Buy option. Such Gateways are offered by third-party providers and can be used in exchange for fees. And as they are hosted offsite, the provider in question takes full responsibility for data security, KYC procedures, and PCI DSS compliance. The external hosting also means that customers are typically redirected to a checkout page during the checkout process and enter their payment details there.

Self-Hosted or simply Self-Built Payment Gateways are exactly that: Payment Gateways developed in-house by your own software engineers or by an external partner development company. If you decide to go for this solution, you have to run your Payment Gateway on your own servers, for the benefit of having full control over the functionality and usability of the software.

Self-Built Payment Gateways are fitting solutions for online marketplaces — mostly because they are tailored to fit the unique payment flows of marketplaces, which many External Payment Gateways cannot always address.

But are custom-made PSP integrators generally the best option for you? That depends. For clarity, let’s explore the advantages and disadvantages of the Build approach in detail.

What Are the Downsides of Self-Hosted Payment Gateways?

For many marketplace businesses, handing payment processing to the most popular Payment Gateways is tempting. Especially small businesses don’t have the resources or the workforce ready to fully commit their business to develop their own Payment Gateway and Payment Processing solution.

Indeed, building your own Gateway instead of using a ready-made solution has a few downsides.

Development and Maintenance Expenses

“Expenses” doesn’t just refer to “monetary expenses” only. It’s true that a marketplace business has to factor in development costs as well as recurring spendings on maintenance, let alone insurance/compliance costs. Besides that, resources like available workforce and domain knowledge limit what is possible in terms of creating a Payment Gateway. In any case, the marketplace owner will have to employ a development team — a small one might suffice if working with external software development partners is feasible.

Slower Time to Market

Time is money, especially if you have to find ways to transfer it. Building your own Payment Gateway will certainly take longer than simply integrating a third-party solution. To reduce development time, Payment Gateways should be among the first things your developers start to work on, once you have decided on how your marketplace should look. Also factor in the certification processes required to comply with government regulations. Usually, they are especially time-consuming.

Responsibilities for Functionality and Compliance

As the developer and the owner of a Payment Gateway, all responsibilities for ensuring the 99,9% uptime fall to you. That means you have to rely on comprehensive testing and continuous maintenance and bugfixing. Furthermore, you are held accountable for compliance and data security, which requires additional know-how within your company or a reliable, external partner.

What Are the Benefits of Building a Payment Gateway?

The bad news is out, now to the good part. Despite the challenges posed by Payment Gateways development, one should not reject it right away. Many external providers promise that their “size” of Payment Gateway fits all. But marketplaces often have fairly unique business logic and yours quite certainly isn’t an exception.

Settling for a custom-built solution has a lot of unique benefits for marketplace owners, which address the particularities of your solution.

No Vendor Lock-In

Running your own Payment Gateway has the advantage of being independent of other companies. If you are using a Payment Gateway by an external company, your influence on the business of this company is limited. Terms of use and usage fees might change over time to your disadvantage. In the worst case, the Payment Gateway provider gets in economical trouble or suffers from security issues, which hurts the reputation of your own platform.

More importantly, however, dependency on an external provider can easily lead to vendor lock-in, a situation in which you can’t simply switch your Payment Gateway without massive drawbacks, even when the costs of your current one are high or its feature range lacking. Simply correcting the shortcomings in one’s own solution is more practical: The Payment Gateway scales at the same pace as your business.

Custom-Tailored Features

In the ever-accelerating digital finance sector, innovation, and clever functionalities often separate successful from truly successful platforms. If your business model is fairly unique, Payment Gateways off-the-rack will not deliver all features you wish for (like recurring payments, support for specific marketing campaigns or cryptocurrency support for example). A custom Payment Gateway will likely fit your business to a T — you must know, for you designed it that way.

Seamless User Experience

Using an external Payment Gateway also means, you are giving up control over a crucial part of your marketplace business: the payment flow. If it strikes customers as inconvenient or obscure — and therefore not trustworthy — your options to bring about changes are limited.

On the other hand, if you design the Payment Gateway’s feature catalog from scratch, you can also fine-tune the user experience. Polishing the user interface and the payment flow helps you offer a seamless checkout experience and reduce friction. For example, you allow customers to enter their payment details directly on the checkout page of the marketplace, without any redirects.

That said, remember that the merchants on your platform are users, too. You should make onboarding easy and (when you can) founded in digital registration processes and smart contracting — no one wants to scan pages upon pages of trade register excerpts if one would be sufficient.

The same is true for consumers: Only demand information from a user that’s absolutely necessary for their authenticating and the payment authorization.

Data Sovereignty

Using a custom-built solution means that it runs on your own infrastructure — and this leaves all the customer data and historical payment data with you. While additional costs may present themselves when self-hosting, data sovereignty comes with many advantages. You can analyze your customers’ payment data to learn more about how your marketplace is used, what PSPs are popular etc.

In the end, this means you can offer products or solutions tailored to your customers or use the learnings to polish your marketplaces’ usability. It also can save costs, as you can choose between different Payment Service Providers via smart routing.

Long-Term Cost Savings

Many companies shy away from the development costs of a Payment Gateway. But really you are not so much buying a product now as you are investing in the long-term growth of your company. Third-party Payment Gateways come with their own costs, taking the shape of sign-up fees and per-transaction charges, which add up over time. In the end, you’ll find yourself giving a significant part of your profits to other companies, way after your initial costs have amortized.

Side Businesses

That’s actually two points in one.

First, when you run other businesses or hold subsidiaries in need of a Payment Gateway, you can simply use your own. Thus, you forego registration fees or additional per-transaction costs.

Secondly, you could even run your own Payment Gateway as a side business. You could then sell or rent it off to other companies needing a solution with the same feature set.

Building a Payment Gateway — Next Steps

Creating your own Payment Gateway might not be an easy task, but it is worth considering. Plus, there are partners, who can support you with expertise in entrepreneurship and technology (have a look at the trimplement rooster and the aye4fin portfolio for starters). In articles following this one, we will dive into the business aspects and the challenges of software realization of Payment Gateways.

Originally published at on February 12, 2020.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
The trimplement Team

The trimplement Team

We are the fintech enabler. Explore our scalable and secure emoney, cryptocurrency and stored value solutions and follow our journey: