applyPaymentToken
- Endpoint:
POST /aggregate-pay/api/gateway/applyPaymentToken - Tags: Collection Service/Payment Tokenization
Parameters
| Field | In | Type | Required | Constraints | Description |
|---|---|---|---|---|---|
sign | header | string | Yes | ||
Content-Type | header | string | Yes |
Parameter Examples
sign:"FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="Content-Type:"application/json"
Request Body
Content-Type: application/json
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
data | object | Yes | |||
data.requestId | string | Yes | maxLength: 64 | Merchant request id, which uniquely identifies a transaction of the merchant, cannot be repeated | |
data.country | string | Yes | maxLength: 2 | Country code, in uppercase letters. If the payment method is specified, the country code must be provided, see【Supported Country/Region and Currency】The cashier's area selection strategy is: sending the country code region > user's historical use of country code region > user's IP location country code region. | |
data.paymentMethodType | string | Yes | maxLength: 64 | Payment method, when it is empty, pull all available payment methods, value is CARD,BANKTRANSFER | |
data.targetOrg | string | No | maxLength: 32 | The target organization, when paymentMethodType is BANKTRANSFER, targetOrg is YUAHSNBANK | |
data.userId | string | Yes | maxLength: 64 | The user ID by the merchant, needs to ensure the uniqueness of each user.After the payment method is saved, the payment method will be recommended according to the userId. | |
data.frontCallbackUrl | string | Yes | maxLength: 1024 | The user will be redirected to this address after completing the payment, starting with HTTP/HTTPS or the scheme address of the merchant’s application. | |
data.tokenScope | string | Yes | constant value:tokenAcq | ||
data.mitType | string | No | when mitType is not null,represent paymentTokenID support mit, otherwise the paymentTokenID support cit | SCHEDULE, UNSCHEDULE | |
data.cardInfo | object | No | Card information. when paymentMethodType is CARD, cardInfo is required | ||
data.cardInfo.cardOrg | string | No | Card organization, when the paymentMethodType is CARD, if it is empty, all supported card groups will be displayed by default | ||
data.cardInfo.cardIdentifierNo | string | No | card ID, card number. | ||
data.cardInfo.cardHolderFullName | string | No | Cardholder’s Name. | ||
data.cardInfo.cardExpirationMonth | string | No | Card Expiration Date - month, two digits. | ||
data.cardInfo.cardExpirationYear | string | No | Card Expiration Date - year, only the last two years are taken. | ||
data.cardInfo.cvv | string | Yes | Card cvv, three digits for Visa and Master, four digits for AMEX. | ||
data.envInfo | object | Yes | Device information | ||
data.envInfo.userAgent | string | Yes | user brower information | ||
data.envInfo.clientIp | string | Yes | user ip | ||
data.envInfo.terminalType | string | Yes | terminal type, value is WEB,WAP,APP | ||
data.envInfo.osType | string | Yes | Operating System Type, value is ANDROID,IOS | ||
data.envInfo.osVersion | string | No | Operating System Version | ||
data.envInfo.browserType | string | No | brower type | ||
data.envInfo.timeZone | string | No | time zone | ||
data.envInfo.deviceId | string | No | device unique id | ||
data.envInfo.deviceLanguage | string | Yes | device language | ||
data.envInfo.screenHeight | string | Yes | screen height | ||
data.envInfo.screenWidth | string | Yes | screen width | ||
data.riskParams | object | No | Risk control business data. see https://docs-v2.payermax.com/en/doc-center/receipt/risk-control/information.html | ||
version | string | Yes | API version. Current value: 1.4 | ||
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 |
Example
json
{
"data": {
"requestId": "{{orderNumber}}",
"country": "RU",
"paymentMethodType": "CARD",
"targetOrg": null,
"userId": "SONG052718",
"frontCallbackUrl": "http://baidu.com",
"tokenScope": "tokenAcq",
"mitType": "UNSCHEDULE",
"cardInfo": {
"cardOrg": "VISA",
"cardIdentifierNo": "4024023875811263",
"cardHolderFullName": "ZHANGSAN",
"cardExpirationMonth": "12",
"cardExpirationYear": "33",
"cvv": "123"
},
"envInfo": {
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36",
"clientIp": "124.233.22.213",
"terminalType": "app",
"osType": "ios",
"osVersion": "15.5",
"browserType": "",
"timeZone": "",
"deviceId": "eYOIkvFpZzztg00Yu6USdprBQZCWxDhiUAHCiK&K/cH9mT6wMaMOzAKe",
"deviceLanguage": "zh_CN",
"screenHeight": "768",
"screenWidth": "1024"
},
"riskParams": {
"accountNo": "xsxxx",
"bindEmail": "xx@mail.com",
"regTime": "2024-03-14 12:08:34"
}
}
}Responses
200
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
data | object | Yes | |||
data.redirectUrl | string | No | Token authentication url, when status is PENDING, the value is required | ||
data.requestId | string | Yes | Merchant request id, which uniquely identifies a transaction of the merchant, cannot be repeated | ||
data.status | string | Yes | apply request status | PENDING, SUCCESS, FAILED | |
data.paymentTokenID | string | No | PMMax token, when status is SUCCESS, the value is required | ||
code | string | Yes | Return code, ‘APPLY_SUCCESS’ means success | ||
msg | string | Yes | Return message, ‘Success.’ |
Response Example
json
{
"msg": "",
"code": "APPLY_SUCCESS",
"data": {
"redirectUrl": "https://cashier-n-test-new.payermax.com/index.html#/paySDKH5/newAuthResultSimulator?pmaxUrlMock=1¬ifyType=CONTROL&referenceNo=TUC858400171807425915435000029&frontCallbackURL=http://baidu.com",
"requestId": "DirectApi1718074257802",
"status": "PENDING"
}
}Enum Reference
data.mitType
SCHEDULEUNSCHEDULE
data.status
PENDINGSUCCESSFAILED
