Integrate I Cash QRCode Pay Cancel
Description
I Cash Pay 條碼取消。
I Cash Pay 金流參數:平台編號、特店業者編號
情境:
- 依廠商金流參數設定進行付款:金流參數為必填、門市代碼不需要填
- 依全通路金流參數設定進行付款:門市代碼為必填、金流參數不需要填
Resource
POST /v1/payment/integrate/cancel
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Request Body Parameters
| Name | Type | Description |
|---|---|---|
| type | string | 付款方式,請輸入 I_CASH_QRCODE_PAY |
| request | Request | 請求參數 |
| store_id | string | 門市代碼 (optional) |
| is_test | boolean | 是否為測試環境
|
Request Body Parameters - Request
| Name | Type | Description |
|---|---|---|
| PlatformID | string | 平台編號 (optional) |
| MerchantID | string | 特店業者編號 (optional) |
| MerchantTradeNo | string | 訂單編號 |
| MerchantTradeDate | string | 交易取消日期 yyyy/MM/dd HH:mm:ss |
Request
{
"type": "I_CASH_QRCODE_PAY",
"request": {
"MerchantID": "10523650",
"PlatformID": "10523647",
"MerchantTradeNo": "202305160934510006",
"MerchantTradeDate": "2023/07/10 23:10:10"
},
"store_id": "0",
"is_test": false
}
Response Body Parameters
| Name | Type | Description |
|---|---|---|
| RtnCode | integer | 回傳代碼,0001為成功 |
| RtnMsg | string | 回傳訊息或失敗訊息 |
| EncData | EncData | 相關資訊 |
Response Body Parameters - EncData
| Name | Type | Description |
|---|---|---|
| PlatformID | string | 平台編號 |
| MerchantID | string | 特店業者編號 |
| MMemberID | string | 特約機構會員 ID |
| MobileInvoiceCarry | string | 電子發票手機載具 |
Response
{
"RtnCode": 1,
"RtnMsg": "訊息代碼:0001,成功",
"EncData": {
"MerchantID": "10523650",
"PlatformID": "10523647",
"MMemberID": "",
"MobileInvoiceCarry": ""
}
}
IntegrateCancel API Workflow
%%{init: {'securityLevel': 'loose', 'theme':'base'}}%%
sequenceDiagram
autonumber
participant C as Client
participant OP as OmniPlatform
participant PS as PayServer
C->>OP: Call IntegrateCancelAPI
activate OP
OP->>OP: Call self.check_params_process(params)
alt 請求參數缺少必填欄位
OP->>C: raise ValueError(f"{column} 不可為空")
end
alt 付款方式非有效值
OP->>C: raise ValueError(f"無此付款⽅式 {payment_type}")
end
OP->>OP: Call self.get_pay_config(payment_type, company_id, shop_id, logger_params)
Note over OP: 金流參數從請求參數取得,因此 get_pay_config 回傳空值
OP->>OP: Call self.pay_cancel(params, pay_config)
Note over OP: 根據 payment_type 處理 request、headers 資料,然後向 PayServer 發出請求
OP->>PS: Call Request [POST] cancel_server_url
activate PS
PS->>OP: Return Response
deactivate PS
OP->>C: Return Response
deactivate OP