Cancel 命令通知集成方,以便在以下任一情况发生时,与 Cortina 支付提供商发起取消流程:
- 收到失败的
Authorization响应(由于超时或Authorization响应中包含错误代码)。 - 产品选择过程中出现的问题 - 消费者无操作/按下取消按钮/消费者选择了无效的产品。
- 机器出货失败(产品分发/服务提供方面出现问题)
注意:此命令仅适用于预授权(PreAuthorization)。其在预选(PreSelection)流程中的等效命令是
Void 命令。请求
Nayax 的服务器会向您配置的Cancel 端点发送 POST 请求,格式如下:
(customer's URL)/Cortina/PrePaid/Cancel
有效载荷包含读卡操作的完整结果:
{
"ReasonCode": 999,
"ReasonText": "General exception",
"BasicInfo": {
"TransactionId": 2.3658433596983443e+35,
"NayaxTransactionId": 0,
"Amount": 0.1,
"CurrencyCode": "USD",
"CurrencyNumeric": 376,
"SiteId": 12,
"MachineAuTime": "071221132914",
"TimeoutMS": 15000,
"IsProductSelected": true
},
"DeviceInfo": {
"HwSerial": "0434324119376526",
"FWVersion": "4.0.0.22-RC01 - Aug 25 2021",
"Type": "Onyx"
},
"MachineInfo": {
"Id": 869761713,
"Name": "TestPayStaticQR V2",
"TerminalId": 987654321,
"DecimalPlace": 2,
"Offset": 2,
"GroupId": "Beverages",
"OperatorId": 12345,
"Region": "string",
"City": "string",
"ZipCode": 10001,
"Country": {
"Name": "United States of America",
"NumericCode": 840,
"Alpha2Code": "US",
"Alpha3Code": "USA"
},
"GeoLocation": {
"State": "string",
"City": "string",
"CountryCode": "string",
"ZipCode": "string",
"Address": "string",
"Longitude": 34.998819,
"Latitude": 32.8198988
}
},
"ActorInfo": {
"Id": 2001102296,
"Name": "Far East Dev Zone",
"OperatorId": 2000305191,
"OperatorName": "TanyaT_OP",
"MerchantId": 10011,
"Country": {
"Name": "string",
"NumericCode": "string",
"Alpha2Code": "string",
"Alpha3Code": "string"
},
"GeoLocation": {
"State": "string",
"City": "string",
"CountryCode": "string",
"ZipCode": "string",
"Address": "string",
"Longitude": 34.998819,
"Latitude": 32.8198988
}
},
"CustomData": {
"DirectActor": 12312312,
"Operator": 123121434134,
"Distributor": "superDistributor",
"Actor": 12312312,
"Machine": 131231348
},
"CardData": {
"CardNumber": "string",
"EntryMode": "string",
"ExpYear": "string",
"ExpMonth": "string",
"EMVData": "string",
"IDNumber": "string",
"RandomNumber": "string",
"BrandInfo": {
"PrimaryId": "string",
"PrimaryDescription": "string",
"SecondaryId": "string",
"SecondaryDescription": "string"
},
"CardHolderName": "Test Card Holder"
},
"PaymentInfo": {
"SrvTranId": 2.3658433596983443e+35,
"AuthCode": 333333,
"AuthAmount": 0.1,
"SettAmount": 0.1,
"RRN": 111111,
"Token": "string",
"AuthDateTime": 230221101008,
"SettDateTime": 230221101009,
"TraceNumber": 4444,
"AuthSource": 555555,
"AdditionalData": "string",
"IsGatewayTimeout": true
}
}
请求参数
下表描述了请求正文中包含的参数:参考字段
参考字段
| 字段 | 类型 | 描述 |
|---|---|---|
ReasonCode | Int(16) | 有效的取消或拒绝代码: |
ReasonText | String | 与 ReasonCode 对应的文字说明。 |
TransactionId | String(36) | 此交易的唯一标识符。 |
NayaxTransactionId | Int(64) | Nayax 内部交易的唯一 ID,在后续请求中会重复出现。 |
Amount | Double | 支付金额(十进制,小数(美分)部分最多 3 位)。 |
CurrencyCode | String(3) | 以 ISO 4217 Alpha-3 格式表示的货币代码。 |
CurrencyNumeric | String(3) | 以 ISO 4217 Numeric-3 格式表示的货币代码。 |
SiteId | Int(16) | Nayax 服务器区域标识符。 |
MachineAuTime | String | 机器授权时间戳。 |
TimeoutMS | Int(32) | Nayax 服务器超时配置,单位为毫秒。 |
IsProductSelected | Bool | 表示产品在支付流程开始之前是否已被预先选定。 |
HwSerial | String | Nayax 设备硬件序列号。 |
FWVersion | String | 设备固件版本。 |
Type | String | Nayax 设备类型。 |
Id | Int(64) | 在 Nayax 后台分配的机器实体唯一 ID。 |
Name | String(255) | 在 Nayax 后台中定义的机器名称。 |
TerminalId | String(255) | 终端标识符。请联系 Nayax TPOC 进行定义。 |
DecimalPlace | Int(64) | 此机器所用金额的小数点位置。 |
Offset | String(255) | UTC 时区偏移量。 |
GroupId | String | 仅供 Nayax 内部使用。 |
OperatorId | String(255) | 在 Nayax 后台中定义的商户 ID(字符串格式)。 |
Region | String(255) | 在 Nayax 后台中定义的地区。 |
City | String(255) | 在 Nayax 后台中定义的机器所在城市。 |
ZipCode | String(255) | 在 Nayax 后台中定义的机器邮政编码。 |
Name | String | 国家全称。 |
NumericCode | String(3) | ISO-3166-1 Numeric-3 代码。 |
Alpha2Code | String(2) | ISO-3166-1 Alpha-2 代码。 |
Alpha3Code | String(3) | ISO-3166-1 Alpha-3 代码。 |
State | String | Actor 地理位置的州/省代码。 |
City | String(255) | Actor 地理位置的城市。 |
CountryCode | String | Actor 地理位置的国家代码(ISO3)。 |
ZipCode | String(255) | Actor 地理位置的邮政编码。 |
Address | String(255) | Actor 地理位置的地址。 |
Longitude | String | 机器位置经度。 |
Latitude | String | 机器位置纬度。 |
Id | Int(64) | Actor ID(直接商户/运营商)。 |
Name | String(255) | 直接商户名称。 |
OperatorId | Int(64) | 商户运营商 ID(整数格式)。 |
OperatorName | String | 商户运营商名称。 |
MerchantId | Int(64) | 商户 ID。请联系 Nayax TPOC 进行定义。 |
Name | String | 国家全称。 |
NumericCode | String(3) | ISO-3166-1 Numeric-3 代码。 |
Alpha2Code | String(2) | ISO-3166-1 Alpha-2 代码。 |
Alpha3Code | String(3) | ISO-3166-1 Alpha-3 代码。 |
State | String | Actor 地理位置的州/省代码。 |
City | String(255) | Actor 地理位置的城市。 |
CountryCode | String | Actor 地理位置的国家代码(ISO3)。 |
ZipCode | String(255) | Actor 地理位置的邮政编码。 |
Address | String(255) | Actor 地理位置的地址。 |
Latitude | String | 机器位置纬度。 |
Longitude | String | 机器位置经度。 |
DirectActor | String | 直接 Actor 的自定义数据(JSON 格式字符串)。 |
Operator | String | 运营商的自定义数据(JSON 格式字符串)。 |
Distributor | String | 分销商的自定义数据(JSON 格式字符串)。 |
Actor | String | Actor 的自定义数据(JSON 格式字符串)。 |
Machine | String | 机器的自定义数据(JSON 格式字符串)。 |
CardNumber | String | 根据交易类型提供的卡片信息: 注意: 卡片详细信息使用设备读取卡片时的相同格式。对于 Mifare 卡,Track 2 数据为十六进制。对于磁条卡,Track 2 数据为 ASCII。 |
EntryMode | String(4) | 卡片信息的读取方式: |
ExpYear | String | 卡片到期年份(YY 格式)。条件字段(仅当 Interface 为 1 或 10 时)。 |
ExpMonth | String | 卡片到期月份(MM 格式)。条件字段(仅当 Interface 为 1 或 10 时)。 |
EMVData | String | EMV 标签数据采用 TLV(标签-长度-值)格式。 |
IDNumber | String | 持卡人 ID 号码。 |
RandomNumber | String | 暂无更多信息。 |
PrimaryId | String | 主品牌 ID。 |
PrimaryDescription | String | 主品牌描述。 |
SecondaryId | String | 次品牌 ID。 |
SecondaryDescription | String | 次品牌描述。 |
CardHolderName | String | 持卡人姓名。 |
SrvTranId | String | 集成方的内部交易 ID。 |
AuthCode | String(40) | 外部授权码(通常来自发卡行)。 |
AuthAmount | Double | 在 /Authorization 请求中请求的原始金额。 |
SettAmount | Double | 在 /Settlement 或 /Sale 流程中请求的原始金额。与 Authorization 无关。 |
RRN | String | 检索参考号。强烈建议对最终消费者/持卡人可见。 |
Token | String(256) | 该交易的唯一令牌。仅供 Nayax 内部使用。 |
AuthDateTime | String | /Authorization 发生的日期和时间字符串。格式:ddMMyyHHmmss。 |
SettDateTime | Double | 结算日期/时间。与授权无关。 |
TraceNumber | String | 跟踪编号。仅供 Nayax 内部使用。 |
AuthSource | String(5) | 仅供 Nayax 内部使用。 |
AdditionalData | String | 以 JSON 格式表示的附加数据字符串。请联系 Nayax TPOC 进行定义。 |
IsGatewayTimeout | Bool | 指示是否发生了网关超时(在响应中有效)。 |
响应
这是客户的支付方式发送给 Nayax 服务器的 Cancel 响应。其有效载荷应如下所示:
{
"Status": {
"Verdict": "Approved",
"Code": 0,
"StatusMessage": "string"
},
"Balance": {
"RegularCreditType": 0,
"RegularCredit": 0,
"RevalueCredit": 0
}
}
响应参数
下表描述了 API 响应中返回的字段:参考字段
参考字段
| 字段 | 类型 | 描述 |
|---|---|---|
Verdict | String | 请求的最终状态。必须是以下常量字符串值之一: |
Code | Int(32) | 拒绝代码(Decline Code)。条件字段——仅当 Verdict 为 “Declined” 时才会出现。有效的拒绝代码包括: |
StatusMessage | String(255) | 自由文本字段,包含交易状态消息或有关结果的其他不同数据。 |
RegularCreditType | Int(32) | 定义 RegularCredit 的计量单位(枚举值): |
RegularCredit | Double | 根据 RegularCreditType 计算的常规信用金额或交易笔数。小数位为 2。 |
RevalueCredit | Int(32) | 充值信用金额。 |