# MoMo

## **Features**

| Processing currencies | VND  |
| --------------------- | ---- |
| Settlement currencies | USD  |
| Refunds               | ❌    |

# **Integration Method**

**Payment method enumeration values:** **`momo`**

**There is integration method for ShopeePay**

1. Direct API
2. Checkout

## **Direct** **API** 

### **How to integration**

For direct API integration, you can create a PaymentIntent and get url in only one step. The following is the demo of creating payment intent:

[**Create a PaymentIntent**](/api-42631218)

A PaymentIntent is an object that represents your intent to collect payment from your customer and tracks the lifecycle of the payment process. Create a PaymentIntent on your server and specify the amount to collect and a supported currency. If you have an existing Payment Intents integration, add **`momo`** to the list of payment method types.

***Request*** 

```JSON
{
    "amount":200,
    "currency":"VND",
    "confirm":true,
    "payment_method_data" : {
        "type":"momo",
        "billing_details":{
            "name":"buyer name",
            "email":"test@gmail.com"
        }
    },
    "return_url":"https://your.website"
}
```

***Response***

```JSON
{
    "id": "pi_1906980953264226304",
    "object": "payment_intent",
    "created": 1743494664000,
    "livemode": false,
    "currency": "VND",
    "amount": 100000000,
    "status": "requires_action",
    "client_secret": "pi_1906980953264226304_secret_w9ltuoDvny1sYDo4iVUHlDqM",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": {
            "url": "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        }
    },
    "payment_method_types": [
        "momo"
    ],
    "confirmation_method": "automatic",
    "return_url": "https://your.website",
    "payment_method": "pm_1906980953150980096",
    "capture_method": "automatic"
}
```

## **Checkout**

### Payment flow

1. Customer selects MoMo from the list of payment methods available and clicks on the Pay botton

![img](https://u0sf1t5xqzx.feishu.cn/space/api/box/stream/download/asynccode/?code=YTE2ZDI1NGY2MzlkMDY5YzVhNDk2MTAyOTMxNGE0ZTdfaDV3cFlEZVVsNzI5THlFVDdQdkRrejF4R1JpMUVvcE5fVG9rZW46Tjc2SmJySlhvb1BVc0t4WXg4YmNUUmFyblNnXzE3NTczMjU0Mzg6MTc1NzMyOTAzOF9WNA)

1. Scan QR and approve the payment 

![img](https://u0sf1t5xqzx.feishu.cn/space/api/box/stream/download/asynccode/?code=Y2NjMDJjY2VhZmU5OTQ3MjAwYjg5N2RhM2JjYjNjNTlfTDQzTGtDTWYwQ2xlWllzVkhHcmNjdzVYMENEVFZxaWxfVG9rZW46TmVuTmJQYWxzb3o3aEh4akJyVmNMQmE2bmhkXzE3NTczMjU0Mzg6MTc1NzMyOTAzOF9WNA)

### [Create a Session](api-42654181)

***Request*** 

```JSON
{
    "mode": "payment",
    "success_url": "https://yourwebsite.com",
    "payment_method_types": ["momo"],
    "line_items": [
        {
            "price_data": {
                "currency": "VND",
                "unit_amount": 100000,
                "product_data": {
                    "name": "Kettle"
                },
                "billing_scheme": "testscheme",
                "lookup_key": "test_lookup_key"
            },
            "quantity": 1
        }
    ]
}
```

***Response***

```JSON
{
    "id": "cs_1964989708362579968",
    "object": "checkout.session",
    "created": 1757325029000,
    "livemode": true,
    "acctId": "516684936777874841601",
    "currency": "VND",
    "customer": "",
    "mode": "payment",
    "status": "open",
    "url": "https://checkout.wooshpay.com/XXXXXXXXXXXXXXXx",
    "allowPromotionCodes": false,
    "cancel_url": "https://baidu.com/",
    "line_items": {
        "object": "list",
        "data": [
            {
                "id": "li_1964989708375162880",
                "object": "item",
                "currency": "VND",
                "description": "Kettle",
                "price": {
                    "id": "price_1964989708383551488",
                    "object": "price",
                    "created": 1757325029000,
                    "livemode": true,
                    "active": true,
                    "currency": "VND",
                    "product": {
                        "id": "prod_1964989708396134400",
                        "object": "product",
                        "created": 1757325029000,
                        "livemode": true,
                        "active": true,
                        "name": "Kettle",
                        "updated": 1757325029000
                    },
                    "type": "one_time",
                    "unit_amount": 100000,
                    "billing_scheme": "per_unit",
                    "lookup_key": "test_lookup_key"
                },
                "quantity": 1,
                "amount_subtotal": 100000,
                "amount_total": 100000
            }
        ]
    },
    "payment_intent": "pi_1964989708782010368",
    "payment_method_types": [
        "momo"
    ],
    "payment_status": "unpaid",
    "success_url": "https://yourewebsite.com/"

}
```

# **Next step**

You can add more features to your integration as needed

## Webhook

Listen to events on your WooshPay account so your integration can automatically trigger reactions. Create a webhook that mainly focuses on enabled_events and url.

## Refund

Create a refund to repay funds to your customer. You can also perform partial refunds, but not every payment method supports them. A partial refund is when you refund only part of the original transaction amount.
