Sale 命令通知集成方在选定产品后的刷卡结果,以便与 Cortina 支付提供商发起授权流程。
此命令对于进行交易确认或拒绝处理至关重要。
请求
Nayax 的服务器会向您配置的Sale 端点发送 POST 请求,格式如下:
(customer's URL)/Cortina/PrePaid/Sale
有效载荷包含读卡操作的完整结果:
{
"BasicInfo": {
"TransactionId": 2.3658433596983443e+35,
"NayaxTransactionId": 0,
"Amount": 0.1,
"CurrencyCode": "USD",
"CurrencyNumeric": 376,
"SiteId": 12,
"MachineAuTime": "string",
"TimeoutMS": 15000,
"IsProductSelected": true
},
"DeviceInfo": {
"HwSerial": "string",
"FWVersion": "string",
"Type": "ONYX"
},
"MachineInfo": {
"Id": 869761713,
"Name": "TestPayStaticQR V2",
"TerminalId": 987654321,
"DecimalPlace": 2,
"Offset": 2,
"GroupId": "Beverages",
"OperatorId": 12345,
"Region": "string",
"City": "string",
"ZipCode": 10001,
"Type": "Food",
"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
},
"Products": [
{
"Code": 11,
"Name": "Stella",
"Price": 0.1,
"UnitOfMeasurement": "USD",
"Measurement": false
},
{
"Code": 12,
"Name": "expensiveSprite",
"Price": 6,
"UnitOfMeasurement": "USD",
"Measurement": false
}
]
}
请求参数
下表描述了请求正文中包含的参数:参考字段
参考字段
| 字段 | 类型 | 描述 |
|---|---|---|
| 交易状态与核心标识 | ||
Verdict | String | 请求的最终状态。必须是以下常量字符串值之一:
|
Code | Int(32) | 拒绝代码(Decline Code)。条件字段——仅当 Verdict 为 “Declined” 时才会出现。有效的拒绝代码包括:
|
StatusMessage | String(255) | 自由文本字段,包含交易状态消息或有关结果的其他不同数据。 |
TransactionId | String(36) | 此交易的唯一标识符。
|
NayaxTransactionId | Int(64) | Nayax 内部交易的唯一 ID,在后续请求中会回显。 |
SrvTranId | String | 集成方的内部交易 ID。
|
RRN | String | 检索参考号。供第三方使用的外部交易 ID。强烈建议对消费者/持卡人可见。 |
Token | String(256) | 唯一的交易令牌。仅供 Nayax 内部使用。 |
TraceNumber | String | 跟踪编号。仅供 Nayax 内部使用。 |
AuthSource | String(5) | 仅供 Nayax 内部使用。 |
InitiateTranReference | Int(64) | 条件字段:反映预付会员卡重新尝试时的原始 Nayax 交易 ID。 |
| 财务详情、卡片信息与时间戳 | ||
Amount | Double | 支付金额(十进制,小数(美分)部分最多 3 位)。
|
AuthAmount | Double | 在 /SaleRequest 中请求的原始金额。取决于 /Sale 响应。 |
SettAmount | Double | 在 /SaleRequest 中请求的原始金额。取决于 /Sale 响应。 |
AuthCode | String(40) | 外部授权码(通常来自发卡行)。 |
CurrencyCode | String(3) | ISO 4217 Alpha-3 格式的货币代码。 |
CurrencyNumeric | String(3) | ISO 4217 Numeric-3 格式的货币代码。 |
AuthDateTime | String | /Sale 发生的日期和时间。格式:ddMMyyHHmmss。取决于 /Sale 响应。 |
SettDateTime | Double | 结算日期/时间。取决于 /Sale 响应。 |
CardNumber | String | 根据交易类型提供的卡片信息:
|
EntryMode | String(4) | 卡片信息的读取方式。常见值:
|
ExpYear | String | 卡片到期年份(YY 格式)。条件字段(仅当 Interface 为 1 或 10 时)。 |
ExpMonth | String | 卡片到期月份(MM 格式)。条件字段(仅当 Interface 为 1 或 10 时)。 |
EMVData | String | TLV(标签-长度-值)格式的 EMV 标签数据。 |
CVV2 | String | 卡片验证值 2(CVV2)。 |
IDNumber | String | 持卡人 ID 号码。 |
RandomNumber | String | 暂无更多信息。 |
PrimaryId | String | 主品牌 ID。 |
PrimaryDescription | String | 主品牌描述。 |
SecondaryId | String | 次品牌 ID。 |
SecondaryDescription | String | 次品牌描述。 |
CardHolderName | String | 持卡人姓名。 |
IsDebitCard | Bool | 表示该卡为借记卡还是预付卡。 |
IsGatewayTimeout | Bool | 指示是否发生网关超时(在响应中有效)。 |
ProviderExternalData | String | 来自提供商的外部数据,格式为 JSON 字符串。 |
IsRevalueCard | Bool | 指示该卡是否允许充值。 |
| 产品/商品详情 | ||
Code | Int(16) | 在 Nayax 后台或自动售货机中定义的所选商品代码。 |
CatalogProductId | String(100) | 所选商品的外部唯一标识符(产品目录编号)。 |
Name | String(255) | 在 Nayax 后台中定义的产品名称。 |
Price | Double | 以机器所用货币表示的原始产品价格。注意:交易金额是经调整后的计费价格。 |
UnitOfMeasurement | String(64) | 产品的计量单位(例如 “unit” 或 “Liter”)。 |
Measurement | Double | 以计量单位表示的产品数量。 |
Group | String(255) | 产品在产品映射表(product map)中存在的组名称。 |
ProductGroupId | String(255) | 产品在产品映射表(product map)中存在的组代码。 |
PulseLineNumber | Int(32) | 用于通过脉冲(pulse)支持多台机器实现远程出货功能。必须为正整数 (≥0)。 |
| 机器与 Actor 信息 | ||
SiteId | Int(16) | Nayax 服务器所在区域。 |
MachineAuTime | String | 机器授权时间戳。 |
TimeoutMS | Int(32) | Nayax 服务器超时配置(单位:毫秒)。 |
IsProductSelected | Bool | 指示产品是否已被预先选定。 |
PaymentMethodID | Int(32) | 支付提供商的 Nayax 标识符。 |
BillingProviderId | Int(32) | 计费提供商的 Nayax 标识符。 |
AuditNumber | Int(64) | 仅供 Nayax 内部使用。 |
IsDeferredAuthorization | Bool | 暂无更多信息。 |
AgeLimitation | Int(16) | 允许交易所需的最低年龄。 |
IsSoftDeclineCompletion | Bool | 暂无更多信息。 |
TransitTransactionType | Int(32) | 交通交易类型(枚举值):
|
DenyListIndication | Int(32) | 指示对消费者拒绝名单(Deny List)状态的影响(枚举值):
|
HwSerial | String | Nayax 设备硬件序列号。 |
FWVersion | String | 设备固件版本。 |
Type | String | Nayax 设备类型。 |
Id | Int(64) | 机器实体唯一 ID。 |
Name | String(255) | 机器名称。 |
ExternalId | String(200) | 机器外部 ID(机器编号 - 运营商)。 |
Type | String(50) | 机器类型。 |
TerminalId | String(255) | 终端标识符。请联系 Nayax TPOC 进行定义。 |
DecimalPlace | Int(64) | 金额的小数点位置。
|
Offset | String(255) | UTC 时区偏移量。 |
GroupId | String | 仅供 Nayax 内部使用。 |
OperatorId | String(255) | 商户 ID(字符串格式)。 |
Region | String(255) | 机器所在地区。 |
City | String(255) | 机器所在城市。 |
ZipCode | String(255) | 机器邮政编码。 |
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 代码。 |
Intra | String | 区域内(Intra Region)(跨国地理多样化)。 |
State | String | Actor 地理位置的州/省代码。 |
City | String(255) | Actor 地理位置的城市。 |
CountryCode | String | Actor 地理位置的国家代码(ISO3)。 |
ZipCode | String(255) | Actor 地理位置的邮政编码。 |
Address | String(255) | Actor 地理位置的地址。 |
Latitude | String | 机器位置纬度。 |
Longitude | String | 机器位置经度。 |
Id | Int(64) | Actor ID。 |
Name | String(255) | 直接商户名称。 |
OperatorId | Int(64) | 商户运营商 ID(整数格式)。 |
OperatorName | String | 商户运营商名称。 |
MerchantId | Int(64) | 商户 ID。请联系 Nayax TPOC 进行定义。 |
DynamicURL | String | Actor 级别的 URL 配置。 |
MCC | Int(32) | 商户类别代码(MCC),用于对业务类型进行分类。 |
SubMerchantId | String(255) | 子商户标识符。请联系 Nayax TPOC 进行定义。 |
DirectActor | String | 直接 Actor 的自定义数据(JSON 格式字符串)。 |
Operator | String | 运营商的自定义数据(JSON 格式字符串)。 |
Distributor | String | 分销商的自定义数据(JSON 格式字符串)。 |
Actor | String | Actor 的自定义数据(JSON 格式字符串)。 |
Machine | String | 机器的自定义数据(JSON 格式字符串)。 |
SoftDecline | String | 软拒绝(Soft Decline)的自定义数据(JSON 格式字符串)。 |
响应
这是客户的支付方式发送给 Nayax 服务器的 Sale 响应。其有效载荷应如下所示:
{
"Status": {
"Verdict": "Approved",
"Code": 0,
"StatusMessage": "string"
},
"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
},
"Balance": {
"RegularCreditType": 0,
"RegularCredit": 0,
"RevalueCredit": 0
}
}
响应参数
下表描述了 API 响应中返回的字段:参考字段
参考字段
| 字段 | 类型 | 描述 |
|---|---|---|
Verdict | String | 请求的最终状态。必须是以下常量字符串值之一: |
Code | Int(32) | 拒绝代码(Decline Code)。条件字段——仅当 Verdict 为 “Declined” 时才存在。常见代码包括: |
StatusMessage | String(255) | 自由文本字段,包含交易状态消息或有关结果的其他不同数据。 |
CustomDeclineCode | String | 用于指定自定义拒绝代码(例如与 Soft Decline 或 Switch Interface 相关的代码)。可能反映收单机构(acquirer)的响应代码。 |
SrvTranId | String | 集成方的内部交易 ID。 |
AuthCode | String(40) | 外部授权码(通常来自发卡行)。 |
AuthAmount | Double | 在 /Sale Request 中请求的原始金额。 |
SettAmount | Double | 在 /Sale Request 中请求的原始金额。 |
RRN | String | 检索参考号。供第三方使用的外部交易 ID。强烈建议对消费者/持卡人可见。 |
Token | String(256) | 交易的唯一令牌。仅供 Nayax 内部使用。 |
AuthDateTime | String | /Authorization 发生的日期和时间。格式:ddMMyyHHmmss。 |
SettDateTime | Double | 结算日期/时间。与授权命令无关。 |
TraceNumber | String | 跟踪编号。仅供 Nayax 内部使用。 |
AuthSource | String(5) | 仅供 Nayax 内部使用。 |
AdditionalData | String | 以 JSON 格式表示的附加数据字符串。请联系 Nayax TPOC 进行定义。 |
IsGatewayTimeout | Bool | 指示是否发生网关超时(在响应中有效)。 |
ProviderExternalData | String | 来自提供商的外部数据,格式为 JSON 字符串。 |
InitiateTranReference | Int(64) | 条件字段:反映预付会员卡重新尝试时的原始 Nayax 交易 ID。 |
IsRevalueCard | Bool | 指示该卡是否允许充值。 |