One-Time Payments
Process Flow
Flow diagram
Explanation
- Step 1: Customer (user) checks out order and chooses to pay using domestic ATM card.
- Step 2: Your server creates a payment session and sends payment request to MoMo.
- Step 3: MoMo provides a URL for merchant.
- Step 4: Merchant website redirects to MoMo's domestic ATM card payment page, using provided URL in step 3.
- Step 5,6: User provides ATM card information and makes payment.
- Step 7: MoMo executes the transaction, notifies the merchant and redirects user back to merchant website.
- Step 8: Merchant verifies the transaction result & displays transaction result to user.
API Configuration
Initiate payment method
At merchant website, users choose products or services and make payment using domestic ATM card, then Merchant server will call MoMo API to retrieve the payment URL, and will redirect users to the payment page.
API information to retrieve payment URL
HTTP RequestPOST /v2/gateway/api/create
Attribute | Type | Required | Description |
---|---|---|---|
partnerCode | String | Integration information | |
partnerName | String | Partner name | |
storeId | String | Store ID | |
requestId | String(50) | Request ID, unique for each request, MoMo's partner uses the requestId field for idempotency control | |
amount | Long | Amount needs to be paid Min: 10.000 VND Max: 50.000.000 VND Currency: VND Data type: Long | |
orderId | String | OrderId of partner, unique for each request | |
orderInfo | String | Order's information | |
redirectUrl | String | A partner's URL. This URL is used to redirect from MoMo page to partner's page after customer's payment. Support: AppLink and WebLink | |
ipnUrl | String | Partner API. Used by MoMo to submit payment results by IPN method (server-to-server) method | |
requestType | String | payWithATM | |
extraData | String | Default value is empty "" Encode base64 follow Jsonformat: {"key": "value"} Example with data: {"username": "momo"} => data of extraData : eyJ1c2VybmFtZSI6ICJtb21vIn0= | |
lang | String | Language of returned message (vi or en ) | |
signature | String | Signature to confirm information. Secure transaction in Hmac_SHA256 with format: a String sort all key name of data field from a-z: accessKey=$accessKey&amount=$amount&extraData=$extraData &ipnUrl=$ipnUrl&orderId=$orderId&orderInfo=$orderInfo &partnerCode=$partnerCode&redirectUrl=$redirectUrl &requestId=$requestId&requestType=$requestType |
Redirecting information (redirectUrl)
WebLink: Links to open website. Example: http(s)://example.com/
AppLink: Link to open mobile application.
Learn more about AppLink
- Android: https://developer.android.com/training/app-links
- IOS: https://developer.apple.com/documentation/uikit/core_app/..
Example Request
{
"partnerCode": "MOMO",
"partnerName" : "Test",
"storeId" : "MoMoTestStore",
"requestType": "payWithATM",
"ipnUrl": "http://www.example.com",
"redirectUrl": "http://www.example.com",
"orderId": "6d0a1b10-b382-11e9-8fda-91fa25841420",
"amount": 30000,
"lang": "vi",
"orderInfo": "pay with MoMo ATM",
"requestId": "6d0a1b11-b382-11e9-8fda-91fa25841420",
"extraData": "email=abc@gmail.com",
"signature": "5344e1f4244173fe0ba2b4c865881aad79b86beff8154b4f74f3b92634ffa711",
}
Attribute | Type | Required | Description |
---|---|---|---|
partnerCode | String | Integration information | |
requestId | String | Same as the original request | |
orderId | String | OrderId of partner, unique for each request | |
amount | Long | Same as the original payment amount | |
responseTime | Long | Time to respond payment results to partner Format: timestamp | |
message | String | Error description, error language is based on lang | |
resultCode | Integer | Result Code | |
payUrl | String | URL for switching from the partner's page to the MoMo payment page |
Example Response
{
"partnerCode": "MOMO",
"requestId": "6d0a1b11-b382-11e9-8fda-91fa25841420",
"orderId": "6d0a1b10-b382-11e9-8fda-91fa25841420",
"amount": 30000,
"message": "Success",
"resultCode": 0,
"payUrl": "https://test-payment.momo.vn/v2/gateway/pay?t=TU9NT1NKSTEyMDE5MDgyM3wxNjEyODQwNTMyNDI3OjAxMjM0NTY3Nzg="
}
Payment
You can use ATM Cards Test to process payment.
Processing payment result
For more information, see Payment Notification.
Parameter description
Description for parameters which are used by MoMo in the URL redirectUrl
and the body content of ipnUrl
.
Attribute | Type | Required | Description |
---|---|---|---|
partnerCode | String | Integration Information | |
orderId | String | OrderId of partner, unique for each request | |
requestId | String | Partner's requestId | |
amount | Long | Payment amount | |
orderInfo | String | Order's information | |
orderType | String | momo_wallet | |
partnerUserId | String | MoMo's unique identifier for each MoMo eWallet account. | |
transId | Long | MoMo's transaction ID | |
resultCode | Integer | Transaction status of the order Result Code | |
message | String | Error description, languague is based on lang | |
payType | String | Payment type: napas | |
responseTime | Long | Time to respond payment results to partner Format: timestamp | |
extraData | String | Extra Data. Default: "" | |
signature | String | Signature to confirm information. Secure transaction in Hmac_SHA256 algorithm with format: a String sort all key name of data field from a-z: accessKey=$accessKey&amount=$amount&extraData=$extraData &message=$message&orderId=$orderId&orderInfo=$orderInfo &orderType=$orderType&partnerCode=$partnerCode&payType= $payType&requestId=$requestId&responseTime= $responseTime&resultCode=$resultCode&transId=$transId |
Result Codes & Messages
Kindly locate result codes and messages of One-time Payments of Local ATM Card Payments in the comprehensive list of result codes provided here.