POST api/ValueCard/Busi/Trade/RefundOrCancel

(跨平台方法)使用储值卡进行支付操作(result.errcode=0且result.tag.TradeStatus="S"表示退款/撤消成功)。 (1)当前操作是退款/撤消的起手动作,一般情况下,会直接返回成功或失败; (2)当未返回成功或失败时,请使用查询API查询交易的情况。

Request Information

URI Parameters

None.

Body Parameters

退款参数。

ValueCardRefundParm
NameDescriptionTypeAdditional information
TradeType

交易类型 R退款(可以部分),C撤消(全部撤消)

string

Required

Max length: 1

Min length: 1

TradeFrom

交易来源,不能为空,1-前台或自助机,2互联网

string

Required

Max length: 1

Min length: 1

TradeFromDetail

交易来源说明,可以为空,如“微信小程序”,“web”,“餐饮客户端”等字样。 最长10个字符(或5个汉字)。

string

Max length: 10

OrgBusiTradeType

同系统业务类型1-票务(含景区和演出);2-自营零售业务;3-包车业务;4-即上即下环保车业务;5-装备租赁业务,6-联营零售业务,7-餐饮业务,8-其他业务。 当不提供OrgBusiTradeType和OrgBusiBillId,但提供OrgBillId时,系统将通过查询原支付记录,确定这两个值。

string

Max length: 1

Min length: 1

OrgBusiBillId

来自于业务系统的单据号。这个与“业务类型”加起来必须是唯一的。 业务系统是指发起本次调用的系统,如餐饮系统等。

string

Max length: 32

OrgBillId

原交易单号, 原票务系统收款交易的ID。 必须提供OrgBillId或OrgBusiTradeType和OrgBusiBillId,用于确定被退款的交易。

string

Max length: 32

BusiRefundBillId

退款交易的业务系统交易号,此号在起调方的系统中,与OrgBusiTradeType参数组合必须是唯一的。

string

Required

Max length: 32

RefundOrCancelAmount

当TradeType='C'时,此值没有含义;当TradeType='R'时,此值表示退款的金额。 必须大于零,小于对应的支付交易的可退款/撤消金额。

decimal number

None.

Attach

附加数据,将原封不动保存和返回。 varchar(100)

string

Max length: 100

Request Formats

application/json, text/json

Sample:
{
  "TradeType": "sample string 1",
  "TradeFrom": "sample string 2",
  "TradeFromDetail": "sample string 3",
  "OrgBusiTradeType": "sample string 4",
  "OrgBusiBillId": "sample string 5",
  "OrgBillId": "sample string 6",
  "BusiRefundBillId": "sample string 7",
  "RefundOrCancelAmount": 8.0,
  "Attach": "sample string 9"
}

application/xml, text/xml

Sample:
<ValueCardRefundParm xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer.Tour.V5.Parm.ValueCard">
  <Attach>sample string 9</Attach>
  <BusiRefundBillId>sample string 7</BusiRefundBillId>
  <OrgBillId>sample string 6</OrgBillId>
  <OrgBusiBillId>sample string 5</OrgBusiBillId>
  <OrgBusiTradeType>sample string 4</OrgBusiTradeType>
  <RefundOrCancelAmount>8</RefundOrCancelAmount>
  <TradeFrom>sample string 2</TradeFrom>
  <TradeFromDetail>sample string 3</TradeFromDetail>
  <TradeType>sample string 1</TradeType>
</ValueCardRefundParm>

application/x-www-form-urlencoded

Sample:

Sample not available.

application/bson

Sample:
Binary JSON content. See http://bsonspec.org for details.

Response Information

Resource Description

(跨平台方法)使用储值卡进行支付操作(result.errcode=0且result.tag.TradeStatus="S"表示退款/撤消成功)。 (1)当前操作是退款/撤消的起手动作,一般情况下,会直接返回成功或失败; (2)当未返回成功或失败时,请使用查询API查询交易的情况。

CommonOperationResultWithTagOfValueCardRefundResult
NameDescriptionTypeAdditional information
errcode

integer

None.

errmsg

string

None.

tag

ValueCardRefundResult

None.

Response Formats

application/json, text/json

Sample:
{
  "errcode": 1,
  "errmsg": "sample string 2",
  "tag": {
    "BillId": "sample string 1",
    "TradeType": "sample string 2",
    "TradeFrom": "sample string 3",
    "TradeFromDetail": "sample string 4",
    "OrgBillId": "sample string 5",
    "OrgBusiTradeType": "sample string 6",
    "OrgBusiBillId": "sample string 7",
    "RefundOrCancelAmount": 8.0,
    "CardNo": "sample string 9",
    "TradeStatus": "sample string 10",
    "TradeMessage": "sample string 11",
    "BusiRefundBillId": "sample string 12",
    "Attach": "sample string 13",
    "MerchantId": 14,
    "ShopId": "sample string 15",
    "TradeTime": "sample string 16",
    "UserLoginName": "sample string 17"
  }
}

application/xml, text/xml

Sample:
<CommonOperationResultWithTagOfValueCardRefundResultjuXQ_SQCk xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer">
  <errcode>1</errcode>
  <errmsg>sample string 2</errmsg>
  <tag xmlns:d2p1="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer.Tour.V5.Result.ValueCard">
    <d2p1:Attach>sample string 13</d2p1:Attach>
    <d2p1:BillId>sample string 1</d2p1:BillId>
    <d2p1:BusiRefundBillId>sample string 12</d2p1:BusiRefundBillId>
    <d2p1:CardNo>sample string 9</d2p1:CardNo>
    <d2p1:MerchantId>14</d2p1:MerchantId>
    <d2p1:OrgBillId>sample string 5</d2p1:OrgBillId>
    <d2p1:OrgBusiBillId>sample string 7</d2p1:OrgBusiBillId>
    <d2p1:OrgBusiTradeType>sample string 6</d2p1:OrgBusiTradeType>
    <d2p1:RefundOrCancelAmount>8</d2p1:RefundOrCancelAmount>
    <d2p1:ShopId>sample string 15</d2p1:ShopId>
    <d2p1:TradeFrom>sample string 3</d2p1:TradeFrom>
    <d2p1:TradeFromDetail>sample string 4</d2p1:TradeFromDetail>
    <d2p1:TradeMessage>sample string 11</d2p1:TradeMessage>
    <d2p1:TradeStatus>sample string 10</d2p1:TradeStatus>
    <d2p1:TradeTime>sample string 16</d2p1:TradeTime>
    <d2p1:TradeType>sample string 2</d2p1:TradeType>
    <d2p1:UserLoginName>sample string 17</d2p1:UserLoginName>
  </tag>
</CommonOperationResultWithTagOfValueCardRefundResultjuXQ_SQCk>

application/bson

Sample:
Binary JSON content. See http://bsonspec.org for details.