Authorization 命令通知刷卡结果,以启动与 Cortina 支付提供商的授权流程。
此命令对于进行交易确认或拒绝处理至关重要。
请求
Nayax 的服务器会向您配置的Authorization 端点发送 POST 请求,格式如下:
(customer's URL)/Cortina/PrePaid/Authorization
有效载荷包含读卡操作的完整结果:
{
"BasicInfo": {
"TransactionId": "N99O4XURDQYJZIK4OTCAWF1RHHA40TZWVCRB",
"NayaxTransactionId": 3584697384,
"Amount": 5,
"CurrencyCode": "ILS",
"CurrencyNumeric": "376",
"SiteId": 1,
"MachineAuTime": "071221132914",
"TimeoutMS": 15000,
"IsProductSelected": true,
"PaymentMethodID": 1,
"BillingProviderId": 1,
"AuditNumber": 342,
"NayaxRRN": "111111",
"IsDeferredAuthorization": true,
"AgeLimitation": 18,
"IsSoftDeclineCompletion": true,
"TransitElement": {
"TransitTransactionType": 1,
"DenyListIndication": 0
}
},
"DeviceInfo": {
"HwSerial": "0434324119376526",
"FWVersion": "4.0.0.22-RC01 - Aug 25 2021",
"Type": "Onyx"
},
"MachineInfo": {
"Id": 106791869,
"Name": "Itai_TestPayCC V2",
"ExternalId": "OperatorExternalID",
"Type": "machine type",
"TerminalId": "8888888844",
"DecimalPlace": 2,
"Offset": "3.00",
"GroupId": "String",
"OperatorId": 2001537302,
"Region": "EU",
"City": "Abbeville",
"ZipCode": "22448Z",
"Country": {
"Name": "UNITED STATES",
"NumericCode": "840",
"Alpha2Code": "US",
"Alpha3Code": "USA",
"Intra": "Europe"
},
"GeoLocation": {
"State": "Alabama",
"City": "Zambezi",
"CountryCode": "ZM",
"ZipCode": "234234",
"Address": "River",
"Latitude": 51.0003431,
"Longitude": 23.745245
}
},
"ActorInfo": {
"Id": 2001537302,
"Name": "TestPayCC V2 OP",
"OperatorId": 2001537302,
"OperatorName": "TestPayCC V2 OP _ Sub Merchant",
"MerchantId": 999999888885,
"DynamicURL": "https://www.nayax.com/alternativeURL",
"Country": {
"Name": "UNITED STATES",
"NumericCode": "840",
"Alpha2Code": "US",
"Alpha3Code": "USA",
"Intra": "Europe"
},
"GeoLocation": {
"State": "Alabama",
"City": "Zambezi",
"CountryCode": "ZM",
"ZipCode": "234234",
"Address": "River",
"Latitude": 51.0003431,
"Longitude": 23.745245
},
"MCC": 455,
"SubMerchantId": 999999888886
},
"CustomData": {
"DirectActor": "String",
"Operator": "String",
"Distributor": "String",
"Actor": "String",
"Machine": "String",
"SoftDecline": "String"
},
"CardData": {
"CardNumber": "****",
"EntryMode": "MCR",
"ExpYear": "23",
"ExpMonth": "01",
"EMVData": "string",
"CVV2": "****",
"IDNumber": "****",
"RandomNumber": "string",
"BrandInfo": {
"PrimaryId": "6",
"PrimaryDescription": "VISA",
"SecondaryId": "0",
"SecondaryDescription": "string"
},
"CardHolderName": "Test Card Holder",
"IsDebitCard": true
},
"PaymentInfo": {
"SrvTranId": "3584697388",
"AuthCode": "333333",
"AuthAmount": 5.5,
"SettAmount": 5.5,
"RRN": "111111",
"Token": "string",
"AuthDateTime": "071221133300",
"SettDateTime": "071221133330",
"TraceNumber": "4444",
"AuthSource": "string",
"AdditionalData": "string",
"IsGatewayTimeout": false,
"ProviderExternalData": "string",
"InitiateTranReference": 11223344,
"IsRevalueCard": false
}
}
请求参数
下表描述了请求正文中包含的参数:参考字段
参考字段
| 字段 | 类型 | 描述 |
|---|---|---|
TransactionId | String(36) | 此交易的唯一标识符。 |
NayaxTransactionId | Int(64) | 该交易的 Nayax 内部唯一标识符。此 ID 将在后续相关请求中回显。 |
Amount | Double | 支付金额(十进制,小数(美分)部分最多 3 位)。 |
CurrencyCode | String(3) | 以 ISO 4217 三位字母代码表示的货币(例如 USD、EUR)。 |
CurrencyNumeric | String(3) | 以 ISO 4217 三位数字代码表示的货币(例如 USD 对应 840)。 |
SiteId | Int(16) | 承载该交易的 Nayax 服务器区域标识符。 |
MachineAuTime | String | 机器授权时间戳。 |
TimeoutMS | Int(32) | Nayax 服务器超时配置,以毫秒为单位指定。 |
IsProductSelected | Bool | 表示产品在支付流程开始之前是否已被预先选定。 |
PaymentMethodID | Int(32) | 所使用的特定支付提供商的 Nayax 标识符。 |
BillingProviderId | Int(32) | 关联计费提供商的 Nayax 标识符。 |
AuditNumber | Int(64) | 保留字段,仅供 Nayax 内部使用。 |
NayaxRRN | String | 参考编号,供外部方用作外部交易标识。 |
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) | 在 Nayax 后台系统中分配的唯一机器实体 ID。 |
Name | String(255) | 在 Nayax 后台配置的机器名称。 |
ExternalId | String(200) | 由运营商在 Nayax 后台系统中提供的机器外部 ID(机器编号 - 运营商)。 |
Type | String(50) | 在 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 三位数字代码(例如 840)。 |
Alpha2Code | String(2) | 国家的 ISO-3166-1 两位字母代码(例如 US)。 |
Alpha3Code | String(3) | 国家的 ISO-3166-1 三位字母代码(例如 USA)。 |
Intra | String | 用于地理多元化的区域内(Intra Region)。 |
State | String | 参与方的地理州/省代码。 |
City | String(255) | 与参与方关联的城市。 |
CountryCode | String | 国家代码(ISO3)。 |
ZipCode | String(255) | 与参与方关联的邮政编码。 |
Address | String(255) | 与参与方关联的地址。 |
Latitude | String | 机器所在位置的纬度。 |
Longitude | String | 机器所在位置的经度。 |
Id | Int(64) | Actor ID。 |
Name | String(255) | 直接商户名称(Direct Merchant Name)。 |
OperatorId | Int(64) | 商户运营商 ID(Merchant Operator ID)。 |
OperatorName | String | 商户运营商名称(Merchant Operator Name)。 |
MerchantId | Int(64) | 商户 ID。请联系 Nayax TPOC 以进行定义。 |
DynamicURL | String | Actor 级别的 URL 配置。 |
Name | String | 国家全称。 |
NumericCode | String(3) | ISO-3166-1 三位数字代码。 |
Alpha2Code | String(2) | ISO-3166-1 两位字母代码。 |
Alpha3Code | String(3) | ISO-3166-1 三位字母代码。 |
Intra | String | 用于地理多元化的区域内(Intra Region)。 |
State | String | 参与方的地理州/省代码。 |
City | String(255) | 与参与方关联的城市。 |
CountryCode | String | 国家代码(ISO3)。 |
ZipCode | String(255) | 与参与方关联的邮政编码。 |
Address | String(255) | 与参与方关联的地址。 |
Latitude | String | 机器所在位置的纬度。 |
Longitude | String | 机器所在位置的经度。 |
MCC | Int(32) | 商户类别代码(Merchant Category Code)。用于按所提供商品或服务的类型对商户进行分类。 |
SubMerchantId | String(255) | 子商户标识符。请联系 Nayax TPOC 以进行定义。 |
DirectActor | String | 以 JSON 格式表示的直接 Actor 自定义数据。 |
Operator | String | 以 JSON 格式表示的运营商自定义数据。 |
Distributor | String | 以 JSON 格式表示的分销商自定义数据。 |
Actor | String | 以 JSON 格式表示的 Actor 自定义数据。 |
Machine | String | 以 JSON 格式表示的机器自定义数据。 |
SoftDecline | String | 以 JSON 格式表示的与 软拒绝(Soft Decline) 相关的自定义数据。 |
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 | 以 TLV(标签-长度-值)格式包含 EMV 标签的字符串。 |
CVV2 | String | 卡片验证值 2(CVV2)。 |
IDNumber | String | 与持卡人或交易关联的 ID 号码。 |
RandomNumber | String | 暂无更多信息。 |
PrimaryId | String | 主品牌 ID(Primary Brand Id)。 |
PrimaryDescription | String | 主品牌描述(Primary Brand Description)。 |
SecondaryId | String | 次品牌 ID(如适用)。 |
SecondaryDescription | String | 次品牌描述(如适用)。 |
CardHolderName | String | 持卡人姓名(Card Holder Name)。 |
IsDebitCard | Bool | 表示该卡为借记卡还是预付卡。 |
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 格式字符串发送的附加数据。 |
IsGatewayTimeout | Bool | 表示是否发生了网关超时。 |
ProviderExternalData | String | 来自提供商的外部数据,格式为 JSON 字符串。 |
InitiateTranReference | Int(64) | 条件字段。反映预付会员卡重试时的原始 Nayax 交易 ID。 |
IsRevalueCard | Bool | 表示是否允许对该卡进行充值(revalue)。 |
响应
这是客户的支付方式发送给 Nayax 服务器的授权响应。有效载荷应如下所示:{
"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) | 条件字段: 仅当 Verdict 为 Declined 时返回。必填的拒绝代码: |
StatusMessage | String(255) | 交易状态消息,以自由文本字段形式提供,或用于其他各类数据。 |
CustomDeclineCode | 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 | 表示是否发生了网关超时(在响应中有效)。 |
ProviderExternalData | String | 来自提供商的外部数据,格式为 JSON 字符串。 |
InitiateTranReference | Int(64) | 条件字段:反映预付会员卡重试时的原始 Nayax 交易 ID。 |
IsRevalueCard | Bool | 表示是否允许对该卡进行充值(增加资金)。 |
RegularCreditType | Int(32) | 定义 RegularCredit 字段所代表的内容(枚举值): |
RegularCredit | Double | 根据 RegularCreditType 计算的常规信用金额或交易笔数。小数位为 2。 |
RevalueCredit | Int(32) | 充值信用金额(Revalue Credit)。仅当该卡配置为可充值时可用。小数位为 2。 |