# Mastercard Gateway
source: https://developer.mastercard.com/mastercard-gateway/documentation/index.md

## Overview {#overview}

The Mastercard Gateway API enables merchants to integrate secure payment functionality into websites or online stores. Before using the API, you select an integration method that fits your business needs. This allows you to:

* Collect customer payment information
* Process transactions, including:
  * One-time payments
  * Recurring payments
  * Refunds

### Key Benefits {#key-benefits}

* **Secure Transactions**
  Protects sensitive data and reduces fraud risk through industry-standard security measures.

* **Automated Payment Processing**
  Speeds up transactions, minimizes errors, and simplifies operations.

* **Global Reach**
  Supports multiple payment methods and currencies, helping merchants serve customers worldwide.

* **Compliance and Reliability**
  Meets industry standards for payment security and performance.

By streamlining payments and enhancing security, the Mastercard Gateway API improves the customer shopping experience and supports business growth.

## How It Works {#how-it-works}

To manage payments and integrate with Mastercard Gateway, you need to understand these fundamentals:

### 1. Payment Types {#1-payment-types}

* **Cardholder-Initiated Payments** and **Merchant-Initiated Payments**
* These define how payments occur within an order lifecycle.

### 2. Orders and Transactions {#2-orders-and-transactions}

* **Order**: A single instance of a sale between you and the payer.
* **Transaction** : An action performed on an order, such as:
  * Authenticating the payer or card
  * Reserving funds
  * Moving money between you and the payer

### 3. Payment Flow and Actors {#3-payment-flow-and-actors}

Your Payment Service Provider (PSP) creates a merchant profile for you to accept payments through Mastercard Gateway.
This profile is configured to process payments using acquirers such as your bank or other payment providers.
Diagram how_it_works

A single consumer order results in the flow as shown:

#### **Step 1: Consumer** {#step-1-consumerbr}

The consumer places an order on your website or in your app, or in person.

#### **Step 2: You, the Merchant** {#step-2-you-the-merchantbr}

The merchant sends an API operation request to the Mastercard Gateway.

#### **Step 3: Mastercard Gateway** {#step-3-mastercard-gatewaybr}

Mastercard Gateway forwards the transaction to the merchant's acquirer.

#### **Step 4: Acquirer** {#step-4-acquirerbr}

The merchant's acquirer manages the process with the payment network to move funds from the payer's account, with their issuer, to the merchant's account.

## Before You Start {#before-you-start}

See [API basics](https://developer.mastercard.com/mastercard-gateway/documentation/getting-started/api-basics/index.md).

#### Choose an integration type {#choose-an-integration-type}

To accept payments from your payers using the Mastercard Gateway, you must select an integration method. These all allow you to gather payment details from the payer and create the necessary transactions to manage the full order lifecycle from initiating a single payment with payer participation to making recurring payments and providing refunds, as necessary.

## Integration Types {#integration-types}

Choose one or more payment solutions that are most suitable for your business needs. You can also consider combining multiple payment solutions for added convenience.

#### Hosted Checkout {#hosted-checkout}

The gateway provides the payment page, so you do not have to handle sensitive payment data. It is secure and quick to set up, but you have limited control over the look and feel.

[Learn more →](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/hosted-checkout/index.md)

#### Hosted Session {#hosted-session}

You create your own payment page, but use fields provided by the gateway to collect payment data. This gives you more control over the user experience while keeping compliance costs low. You can also use this method for mobile apps.

[Learn more →](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/hosted-session/index.md)

#### Direct Payment {#direct-payment}

You have complete control over the payment page and user experience, collecting and storing payment details yourself. It is the most flexible but takes longer to set up.

[Learn more →](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/direct-payment/index.md)

#### Hosted Batch {#hosted-batch}

For bulk operations like capturing payments or tokenizing data, you can send large batches of transactions to the gateway. It is slower than API solutions but useful for processing many transactions at once.

[Learn more →](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/hosted-batch/index.md)

#### Mobile SDK {#mobile-sdk}

Our Mobile SDK helps you develop a mobile app that accepts digital payments. This ensures that you can cater to a wide range of customers, regardless of the device they use.

[Learn more →](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/mobile-integration/index.md)

#### Shopping Cart Plugin {#shopping-cart-plugin}

A shopping cart is a plugin of an online store that allows customers to select, review, and purchase products. The customers can browse and add products that they want to purchase in a virtual cart or basket.

[Learn more →](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/shopping-cart-plugin/index.md)

## Next Steps {#next-steps}

Here are some next steps for working with the Mastercard Gateway API.

#### Tutorials and guides {#tutorials-and-guides}

Learn about Mastercard Gateway from our tutorials and guides.

[Learn more →](https://developer.mastercard.com/mastercard-gateway/documentation/tutorials-and-guides/index.md)

#### Payment Methods {#payment-methods}

Learn how to navigate and set up with different payment methods.

[Learn more →](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/index.md)

#### API Reference {#api-reference}

Navigate the Mastercard Gateway version 100 API reference and JavaScript Libraries.

[Learn more →](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/index.md)
