# Make a payment

After the account binding process is completed, the merchant can initiate an auto debit payment to Alipay+ with the obtained access token. Alipay+ then initiates a payment to the MPP. To make a payment to Alipay+, the MPP needs to take the following steps:

## Step 1: Handle a payment request

Alipay+ calls the **pay** API to initiate a payment to the MPP.

> **Note**: The MPP must support transactions in multiple currencies within a single country, as acquirers might provide services in both local and foreign currencies.

### Processing logic

When handling the **pay** API request, take the following things into consideration:

-   Handle the request properly, especially the following parameters:

-   _paymentExpiryTime_: If the payment order is not completed before the time that is specified for this parameter, Alipay+ closes the order.
-   _paymentMethodId_: The value of this parameter is set to the value of the access token that is provided by the MPP in [Step 5. Provide the access token](account_binding#bUOia) of the _Bind the user account_ topic.

-   Ensure the following parameters are configured properly in the response:

-   _result.resultCode_: The following table shows how to set the value of the _result.resultCode_ parameter under different conditions.

| **Condition** | **Value of** **_result.resultCode_** | **Required or not** |
| --- | --- | --- |
| The payment timed out. | `ORDER_IS_CLOSED` | Required |
| The payment amount exceeds the limit of a single transaction. | `PAYMENT_AMOUNT_EXCEED_LIMIT` | Required |
| The accumulated payment amount exceeds the user payment limit. | `USER_AMOUNT_EXCEED_LIMIT` | Required |
| The number of payments exceeds the limit. | `PAYMENT_COUNT_EXCEED_LIMIT` | Required |
| The access token is invalid. | `INVALID_TOKEN` | Required |
| The scope of the access token is incorrect. | `INVALID_TOKEN` | Required |
| The access token is expired. | `INVALID_TOKEN`/`EXPIRED_ACCESS_TOKEN` | Required |
| The user's account balance is not enough. | `USER_BALANCE_NOT_ENOUGH` | Required |
| The user does not exist. | `USER_NOT_EXIST` | Required |
| The user status is abnormal. | `USER_STATUS_ABNORMAL` | Required |
| The payment is declined because the user's KYC verification failed. | `USER_KYC_NOT_QUALIFIED` | Required |
| The payment is declined due to risk control. | `RISK_REJECT` | Recommended |
| The payment failed because the user has no available payment method. | `UNAVAILABLE_PAYMENT_METHOD` | Recommended |
| The payment is declined because the user's identity verification failed. | `USER_PAYMENT_VERIFICATION_FAILED` | Recommended |
| The payment is declined because the merchant verification failed. | `MERCHANT_NOT_REGISTERED` | Recommended |

### Sample

Alipay+ sends a request to the MPP.

```json
{
  "order":{
    "referenceOrderId":"OrderID_0100000101",
    "orderDescription":"SHOES",
    "orderAmount":{
       "value":"100",
       "currency":"JPY"
    },
       "merchant":{
          "referenceMerchantId":"M00000000001",
          "merchantMCC":"5411",
          "merchantName":"UGG",
          "merchantAddress":{
          "region":"JP",
          "city":"xxx"
          }
       }
 },
 "acquirerId": "1020000000000000001",
 "pspId":"1020000000000000001",
 "paymentRequestId":"2010000000000000000000000007771",
 "paymentAmount":{
    "value":"100",
    "currency":"JPY"
 },
  "paymentMethod":{
       "paymentMethodType": "CONNECT_WALLET",
       "paymentMethodId": "2810000000000000000000000000JWDQ"
  },
  "payToAmount":{
    "value":"1000",
    "currency":"KRW"
 },
 "paymentQuote":{
    "quoteId":"1234567",
    "quoteCurrencyPair":"JPY/KRW",
    "quotePrice":"10.0000"
  },
 "paymentFactor": {
    "isAgreementPayment":"true"
 }
}
```

The MPP returns the payment result to Alipay+.

```json
{
 "result": {
    "resultCode":"SUCCESS",
    "resultStatus":"S",
    "resultMessage":"success"
 },
 "paymentId":"201000000000000000000000004444",
 "paymentTime": "2020-01-01T12:01:01+08:30",
 "customerId":"2160000000000001"
}
```

### More information

For more information about how to handle the **pay** API request and send the response, see [pay](../api_mpp/pay).

## Step 2: Return the payment result

After the payment is processed, the MPP needs to inform both the user and Alipay+ of the payment result by taking the following actions:

-   Display the Transaction Detail Page to the user in the MPP app. For how to design the transaction detail page, see [Transaction Detail Page](../product_intro_mpp/product_debit_mpp#e8ZA7).
-   Return the payment result to Alipay+ in the request of **notifyPayment** API or the response of the **inquiryPayment** API. For more information, see [Return payment results](obtain_payment_results).

## Further actions

During the process of making a payment, due to special business needs, you can further take the following actions:

-   **Perform payment evaluation**: If merchants need to verify the available funds in the MPP account before initiating a payment, Alipay+ calls the **pay** API to send a payment evaluation to you. In this case, you need to handle the request and return the response correctly. For more information, see [Perform payment evaluation](pay_evaluation).
-   **Conduct risk control**: When certain risks are detected in payment transactions, merchants initiate risk challenges to verify the user's identity. In this case, you need to handle requests to enable merchants to verify the user's identity. For more information, see [Conduct risk control](risk_control).