Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions about-hyperswitch/ai-resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ icon: brain-circuit

AI resources enable you to intelligently interact with the entire Hyperswitch ecosystem through conversational AI. Whether you're a developer, product manager, or business stakeholder, you can ask both technical and non-technical questions, execute real API operations, and verify results - all through natural language conversations.

## 1. DeepWikis - AI-Powered Documentation
#### 1. DeepWikis - AI-Powered Documentation

Transform how you explore and understand Hyperswitch with AI-enhanced documentation across the entire ecosystem.

Expand Down Expand Up @@ -49,7 +49,7 @@ Transform how you explore and understand Hyperswitch with AI-enhanced documentat

</details>

## 2. MCP Server - Direct API Integration
#### 2. MCP Server - Direct API Integration

Execute real [Hyperswitch API](https://api-reference.hyperswitch.io/introduction) operations directly through your AI assistant using the [Model Context Protocol](https://modelcontextprotocol.io/introduction).

Expand Down
10 changes: 5 additions & 5 deletions about-hyperswitch/ai-resources/setup-mcp-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ This MCP server is only meant for product exploration while using sandbox enviro

**MCP URL:** `https://api-reference.hyperswitch.io/mcp`

## Step 1: Configure the Hyperswitch-Mintlify MCP server
#### Step 1: Configure the Hyperswitch-Mintlify MCP server

Hyperswitch's Mintlify MCP server lets your AI client search Hyperswitch docs and safely explore Sandbox APIs as tools (e.g., create a payment and get a 3DS/redirect URL).

### Recommended: Claude Code
#### Recommended: Claude Code

Add it via CLI:
```bash
Expand All @@ -32,12 +32,12 @@ Run `claude` and verify if MCP was configured properly using `/mcp`. You should

![Verifying the MCP server](../../.gitbook/assets/mcp-verify.png)

### For configuring other MCP clients (Cursor / Claude Desktop / etc.)
#### For configuring other MCP clients (Cursor / Claude Desktop / etc.)

Follow Mintlify's [client-specific setup guide](https://www.mintlify.com/docs/ai/model-context-protocol?_gl=1*1m5cmfd*_gcl_au*MTY1NjU2NDE1LjE3NjY0NzY1MzE.#example:-connect-to-the-mintlify-mcp-server) using the same MCP: `https://api-reference.hyperswitch.io/mcp`


## Step 2: Make your first payment
#### Step 2: Make your first payment

Paste below prompt in your AI client after replacing with your sandbox `API_KEY`:

Expand All @@ -46,7 +46,7 @@ Make a 100 EUR payment via Hyperswitch V1 in sandbox.
Sandbox API key: <YOUR_SANDBOX_API_KEY>
```

### **Output:**
#### **Output:**

You can head on to payment section in [Hyperswitch Control Center](https://app.hyperswitch.io/dashboard/payments) and verify the payment with the time stamp and status as `REQUIRES_CUSTOMER_ACTION` (depending on the flow you selected - 3DS vs No3DS).

Expand Down
12 changes: 6 additions & 6 deletions about-hyperswitch/payment-suite-1/payment-method-card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: hand-holding-circle-dollar

# Payment Method (Card)

Hyperswitch provides flexible payment processing with multiple flow patterns to accommodate different business needs. The system supports one-time payments, saved payment methods, and recurring billing through a comprehensive API design.
Juspay Hyperswitch provides flexible payment processing with multiple flow patterns to accommodate different business needs. The system supports one-time payments, saved payment methods, and recurring billing through a comprehensive API design.

{% hint style="info" %}
### Integration Path
Expand All @@ -21,19 +21,19 @@ The business can use the Payment Method SDK or `/payment-methods` API to first c

The business can then use the `payment_method_id` in `/payments` API to perform all functionalities supported by the [Payments](https://docs.hyperswitch.io/~/revisions/Moc8cqgBbfb8T8KrBi8V/about-hyperswitch/payment-suite-1/payments-cards) flow.&#x20;

### **Payment Method Lifecycle**
#### **Payment Method Lifecycle**

The Payment Method flow leverages the full suite of Hyperswitch [Payment](https://docs.hyperswitch.io/~/revisions/Moc8cqgBbfb8T8KrBi8V/about-hyperswitch/payment-suite-1/payments-cards) capabilities while granting businesses granular control over the user journey. By utilizing Server-to-Server (S2S) APIs and unique identifiers `payment_method_id`, businesses can separate the collection of payment credentials from the actual transaction logic.
The Payment Method flow leverages the full suite of Juspay Hyperswitch [Payment](https://docs.hyperswitch.io/~/revisions/Moc8cqgBbfb8T8KrBi8V/about-hyperswitch/payment-suite-1/payments-cards) capabilities while granting businesses granular control over the user journey. By utilizing Server-to-Server (S2S) APIs and unique identifiers `payment_method_id`, businesses can separate the collection of payment credentials from the actual transaction logic.

### **The Two-Step Integration Pattern**
#### **The Two-Step Integration Pattern**



1. **Credential Capture & Vaulting**
##### 1. **Credential Capture & Vaulting**

The business initiates the flow by capturing payment details (such as cards, wallets, or bank accounts) using either the Payment Method SDK or the `/payment-methods` API. This process securely vaults the payment instrument and generates a unique `payment_method_id`.

2. **Transaction Execution**
##### 2. **Transaction Execution**

Once the `payment_method_id` is generated, it serves as a reusable token. The business can pass this ID into the /payments API to execute any supported [Payment](https://docs.hyperswitch.io/~/revisions/Moc8cqgBbfb8T8KrBi8V/about-hyperswitch/payment-suite-1/payments-cards) functionality without re-collecting sensitive data.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ icon: money-bills-simple

The Payment Method SDK provides APIs to securely capture and tokenize payment credentials, with support for vaulting payment details during the initial checkout flow. Upon successful vaulting, a persistent payment method ID is generated, which merchants can store and use to programmatically initiate subsequent transactions without re-collecting sensitive payment data.

### **Key Features**
#### **Key Features**

* **Full Token Management** – Create, retrieve, update, and delete payment tokens directly from your server.
* **PSP and Network Tokenization** – Generate both PSP tokens and network tokens through a single API.
Expand All @@ -21,7 +21,7 @@ The Payment Method SDK provides APIs to securely capture and tokenize payment cr

<figure><img src="../../../.gitbook/assets/Payment Method SDK (1).svg" alt=""><figcaption></figcaption></figure>

### **Vaulting :**
#### **Vaulting :**

**1. Create Customer (Server-Side)**

Expand All @@ -43,7 +43,7 @@ Hyperswitch receives the request, securely stores the raw card data in the Vault

Hyperswitch returns the `payment_method_id` in the response. You can use this payment method ID for future payments for this customer without handling sensitive card data again.

### **Payment :**&#x20;
#### **Payment :**&#x20;

To charge the customer you will have to call the [create and confirm](https://api-reference.hyperswitch.io/v2/payments/payments--create-and-confirm-intent) API and pass the `payment_method_id` along with `confirm` as `true`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
---
description: Hyperswitch is designed to facilitate the management of saved payment methods
description: Juspay Hyperswitch is designed to facilitate the management of saved payment methods
icon: bars-progress
---

# Payment Methods Management

The Hyperswitch Payment Methods Management SDK provides a secure solution for merchants to handle and store payment information without the burden of PCI DSS compliance requirements. By leveraging Hyperswitch's Vault service, merchants can securely store customer payment methods (credit cards, digital wallets, etc.) while minimizing their exposure to sensitive payment data.
The Juspay Hyperswitch Payment Methods Management SDK provides a secure solution for merchants to handle and store payment information without the burden of PCI DSS compliance requirements. By leveraging Hyperswitch's Vault service, merchants can securely store customer payment methods (credit cards, digital wallets, etc.) while minimizing their exposure to sensitive payment data.

## **Key Features of Payment Method Management in Hyperswitch**
### **Key Features of Payment Method Management in Hyperswitch**

Hyperswitch simplifies the complexities of payment method management, so you can offer a seamless, secure experience to your customers with minimal effort.
Juspay Hyperswitch simplifies the complexities of payment method management, so you can offer a seamless, secure experience to your customers with minimal effort.

### **Payment Method Creation**:&#x20;
#### **Payment Method Creation**:&#x20;

Easily allow your customers to save new payment methods during checkout, providing a convenient option for future transactions.

### **Storing Payment Methods**:&#x20;
#### **Storing Payment Methods**:&#x20;

Hyperswitch securely stores customer payment details, enabling repeat purchases without requiring them to re-enter their information each time.
Juspay Hyperswitch securely stores customer payment details, enabling repeat purchases without requiring them to re-enter their information each time.

### **Retrieving Payment Methods**:&#x20;
#### **Retrieving Payment Methods**:&#x20;

Customers can quickly access their saved payment methods, streamlining their checkout process and enhancing their overall experience.

### **Deleting/Deactivating Payment Methods**:
#### **Deleting/Deactivating Payment Methods**:

Keep payment options up to date by allowing customers to manage outdated or inactive methods, ensuring a clean and efficient payment experience.

<figure><img src="../../../.gitbook/assets/Screenshot 2024-10-03 at 12.27.38 PM.png" alt="" width="563"><figcaption><p>image displaying the payment method management UI.</p></figcaption></figure>

## Integration Guide : <a href="#id-1.-server-side-setup" id="id-1.-server-side-setup"></a>
### Integration Guide : <a href="#id-1.-server-side-setup" id="id-1.-server-side-setup"></a>

### 1. Server-Side Setup <a href="#id-1.-server-side-setup" id="id-1.-server-side-setup"></a>
#### 1. Server-Side Setup <a href="#id-1.-server-side-setup" id="id-1.-server-side-setup"></a>

First, you'll need to set up your server to create payment method sessions, which establish secure connections between your frontend and the Hyperswitch Vault.

**Obtaining Your API Keys :**&#x20;
##### **Obtaining Your API Keys :**&#x20;

* Get your API key from the [Hyperswitch dashboard](https://app.hyperswitch.io/developers?tabIndex=1) under Developers -> API Keys section. You'll need both your API key and profile ID for server and client integration.

Expand All @@ -48,7 +48,7 @@ To generate your Vault API keys, follow these steps:

**Note:** We are currently working on unifying authentication across our platforms. Soon, you will be able to use a single API key for both Payments and Vault APIs.

**Creating a Payment Methods Session Endpoint**
##### **Creating a Payment Methods Session Endpoint**

Add an endpoint on your server that creates [payment methods sessions](https://api-reference.hyperswitch.io/v2/payment-method-session/payment-method-session--create-v1). This endpoint will return the necessary session information to your client application.

Expand Down Expand Up @@ -96,11 +96,11 @@ app.post("/create-payment-method-session", async (req, res) => {

> **Note**: Replace `YOUR_PROFILE_ID` and `YOUR_API_KEY` with your actual credentials from the Hyperswitch dashboard.

### 2. Client-Side Integration <a href="#id-2.-client-side-integration" id="id-2.-client-side-integration"></a>
#### 2. Client-Side Integration <a href="#id-2.-client-side-integration" id="id-2.-client-side-integration"></a>

Once your server endpoint is set up, you'll need to integrate the Vault/Payment Methods Management SDK into your client application.

**2.1 Define the Payment Methods Management Form**
###### **2.1 Define the Payment Methods Management Form**

Add one empty placeholder `div` to your page for the Payment Methods Management widget that you'll mount.

Expand All @@ -112,7 +112,7 @@ Add one empty placeholder `div` to your page for the Payment Methods Management
</form>
```

**2.2 Fetch the Payment Method Session and Mount the Payment Methods Management Element**
###### **2.2 Fetch the Payment Method Session and Mount the Payment Methods Management Element**

Make a request to the endpoint on your server to create a new payment method session. The `id` and `clientSecret` returned by your endpoint are used to initialize and display the customer's saved payment methods. Following this, create a `paymentMethodsManagementElements` element and mount it to the placeholder `div` in your form. This embeds an iframe with a dynamic interface that displays saved payment methods, allowing your customer to view, manage, and delete their payment methods.

Expand Down Expand Up @@ -170,7 +170,7 @@ async function initialize() {
initialize();
```

**2.3 Complete tokenization and handle errors**
###### **2.3 Complete tokenization and handle errors**

Call `confirmTokenization()`, passing the mounted Payment Methods Management widgets and a `return_url` to indicate where Hyper should redirect the user after any required authentication. Depending on the payment method, Hyper may redirect the customer to an authentication page. After authentication is completed, the customer is redirected back to the `return_url`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ icon: money-bills-simple

The Payment Method SDK and `/payment-methods` API work in tandem with the `/payments` API to achieve any business objective as listed below.

### Guest Checkout Flow (S2S)
##### Guest Checkout Flow (S2S)

1. Collect card details and tokenise with HS [Create PM API](https://api-reference.hyperswitch.io/v2/payment-methods/payment-method--create-v1) to get a [PM ID](https://api-reference.hyperswitch.io/v2/payment-methods/payment-method--create-v1#response-id) (payment\_methd\_id)
2. Use the PM ID to authorize the [payment request](https://api-reference.hyperswitch.io/v1/payments/payments--confirm) during order confirmation
Expand All @@ -21,7 +21,7 @@ Note - The PM ID in case of guest checkout is volatile in nature and has a defau
For guest checkout flow the PM ID is NOT unique to Customer + Payment method combination.
{% endhint %}

## Customer Checkout Flow - First Time Payment (S2S)
#### Customer Checkout Flow - First Time Payment (S2S)

1. Create a customer with HS using the [Create Customer API](https://api-reference.hyperswitch.io/v2/customers/customers--create-v1)
2. Use the customer\_id to tokenise the collected card details using Create PM API
Expand All @@ -34,14 +34,14 @@ Note - The CVV storage is volatile in nature and can be stored for 1-hour be def
For logged-in user checkout flow the PM ID is unique to Customer + Payment method combination.
{% endhint %}

## Customer Checkout Flow - Repeat Purchase (S2S)
#### Customer Checkout Flow - Repeat Purchase (S2S)

1. Fetch the stored cards for the customer using [List Saved PMs API](https://api-reference.hyperswitch.io/v2/payment-methods/payment-method--list-customer-saved-payment-methods-v1) which returns the masked card details with corresponding PM ID
2. Update the PM ID of the user selected card along with CVV value collected from the user using the [Update PM API](https://api-reference.hyperswitch.io/v2/payment-methods/payment-method--update-v1)
3. Use the PM ID to authorize the [payment request](https://api-reference.hyperswitch.io/v1/payments/payments--confirm) during order confirmation
4. For extended sessions, where token expires before order completion update the PM again with the collected CVV and use this PM ID to complete the payment

## Payment Method SDK Checkout - Guest, New Customer and Repeat Customer Flows
#### Payment Method SDK Checkout - Guest, New Customer and Repeat Customer Flows

1. Create a PM session using the [Session Create API](https://api-reference.hyperswitch.io/v2/payment-method-session/payment-method-session--create-v1) to get a [client secret](https://api-reference.hyperswitch.io/v2/payment-method-session/payment-method-session--create-v1#response-client-secret)
2. For guest user, pass "storage\_type" as "volatile" and skip sending the Customer ID
Expand All @@ -55,7 +55,7 @@ For logged-in user checkout flow the PM ID is unique to Customer + Payment metho
Note - When using the HS SDK, the response always contains a temp token and you'll need to exchange it to get the PM ID via a S2S call.
{% endhint %}

## HS SDK Checkout for repeat customer - no CVV flow
#### HS SDK Checkout for repeat customer - no CVV flow

1. Create a PM session using the [Session Create API](https://api-reference.hyperswitch.io/v2/payment-method-session/payment-method-session--create-v1) to get a [client secret](https://api-reference.hyperswitch.io/v2/payment-method-session/payment-method-session--create-v1#response-client-secret)
2. Initialize and mount the [Vault SDK](https://docs.hyperswitch.io/explore-hyperswitch/payments-modules/vault/vault-sdk-integration-1#id-2.2-fetch-the-payment-method-session-and-mount-the-payment-methods-management-element) using the client secret and session\_id
Expand Down
Loading