Apply Drop-In Session
- Endpoint:
POST /aggregate-pay/api/gateway/applyDropinSession - Tags: Collection Service/DropIn Payment
Description
Call this interface from the merchant server to retrieve the primary parameters required for initializing Drop-In components.
Note: If you have foreign exchange or marketing needs, please contact PayerMax technical support.
Parameters
| Field | In | Type | Required | Constraints | Description |
|---|---|---|---|---|---|
Content-Type | header | string | Yes | ||
sign | header | string | Yes | 签名信息请参考技术文档 |
Parameter Examples
Content-Type:"application/json"sign:"FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="
Request Body
Content-Type: application/json
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
version | string | Yes | API version. Current value: 1.5 | ||
keyVersion | string | Yes | Signature Algorithm Version, Current value: 1 | ||
requestTime | string | Yes | Request time, compliant with rfc3339 specification, format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX The time must be within two minutes of the current time | ||
appId | string | Yes | Merchant AppId,The unique identifier assigned to the merchant app by PayerMax | ||
merchantNo | string | No | maxLength: 32 | Merchant Id, the unique identifier generated when the merchant signs the contract with PayerMax | |
data | object | Yes | Request data body. | ||
data.totalAmount | number | Yes | The order amount is passed in by the merchant. The unit of the amount is yuan, and it is sent according to the decimal point supported by the currency of each country. Note: Bahrain, Kuwait, Jordan, Omar,Tunisia, the local currency only supports two decimal places; In Indonesia, Taiwan (China), South Korea, Vietnam, Chile,Pakistan, Colombia, Japan, Iceland, Paraguay, the local currency does not support decimal amounts.See【Supported Country/Region and Currency】 | ||
data.mitType | string | No | maxLength: 64 | mit type | |
data.currency | string | Yes | maxLength: 3 | Currency code, capital letter see【Supported Country/Region and Currency】 | |
data.country | string | Yes | maxLength: 2 | Country code, capital letters,If the passed country code does not match the currency, the cashier will be displayed in the region corresponding to the currency code. If a payment method is specified, the country must be sent, see【Supported Country/Region and Currency】 | |
data.userId | string | Yes | maxLength: 64 | The user ID of the merchant, needs to ensure the uniqueness of each user ID. After the payment method is bound, the payment method will be recommended according to the userId. | |
data.referralCode | string | No | maxLength: 32 | Used for more accurate payment method recommendations, such as device ID, device fingerprint, etc. | |
data.tokenForFutureUse | boolean | No | A value of true indicates support for token payments, false indicates no support. Defaults to false. | ||
data.componentList | array[string] | No | List of payment method types requested for support. |
Example
json
{
"version": "1.1",
"keyVersion": "1",
"requestTime": "2022-01-17T09:05:52.194+00:00",
"appId": "3b242b56a8b64274bcc37dac281120e3",
"merchantNo": "020213827212251",
"data": {
"currency": "IDR",
"country": "ID",
"userId": "U10001",
"tokenForFutureUse": false,
"componentList": [
"CARD",
"APPLEPAY"
]
}
}Responses
200
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
code | string | Yes | Return code, ‘APPLY_SUCCESS’ means success.It only represents the success of the interface request, not the order status. | ||
msg | string | Yes | Return message, ‘Success.’.It only represents the success of the interface request, not the order status. | ||
data | object | No | Return data body. | ||
data.sessionKey | string | Yes | maxLength: 64 | Drop-in sessionKey | |
data.clientKey | string | Yes | maxLength: 64 | clientKey | |
data.notSupportedComponent | array[string] | Yes | Unsupported payment method types. |
Response Example
json
{
"code": "APPLY_SUCCESS",
"msg": "Success.",
"data": {
"clientKey": "37114858239eur2384237r810482390",
"sessionKey": "bdsf8982348974hhf82934bf8239424",
"notSupportedComponent": []
}
}