Skip to content

Integrate I Cash QRCode Pay

Description

I Cash Pay 條碼支付。
I Cash Pay 金流參數:平台編號、特店業者編號、商店編號
情境:

  • 依廠商金流參數設定進行付款:金流參數為必填、門市代碼不需要填
  • 依全通路金流參數設定進行付款:門市代碼為必填、金流參數不需要填

Resource

POST /v1/payment/integrate/pay

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 是否為測試環境
  • 在全通路正式環境預設為false
  • 在全通路測試環境預設為true
(optional)

Request Body Parameters - Request

Name Type Description
PlatformID string 平台編號
(optional)
MerchantID string 特店業者編號
(optional)
MerchantTradeNo string 訂單編號
StoreID string 商店編號
(optional)
StoreName string 商店名稱
MerchantTradeDate string 交易日期
yyyy/MM/dd HH:mm:ss
TotalAmount integer 訂單總金額
等於ItemAmt、UtilityAmt、CommAmt的加總。
ItemAmt integer 一般交易金額
UtilityAmt integer 代收交易金額
CommAmt integer 代售交易金額
ItemNonRedeemAmt integer 一般交易不可折金額
UtilityNonRedeemAmt integer 代收交易不可折金額
CommNonRedeemAmt integer 代售交易不可折金額
NonPointAmt integer 不可贈點金額
Barcode string 支付條碼

Request

{
  "type": "I_CASH_QRCODE_PAY",
  "request": {
      "PlatformID": "10523647",
      "MerchantID": "10523650",
      "MerchantTradeNo": "202305160934510005",
      "StoreID": "002",
      "StoreName": "002",
      "MerchantTradeDate": "2023/05/16 10:09:00",
      "TotalAmount": 100,
      "ItemAmt": 100,
      "UtilityAmt": 0,
      "CommAmt": 0,
      "ItemNonRedeemAmt": 100,
      "UtilityNonRedeemAmt": 100,
      "CommNonRedeemAmt": 0,
      "NonPointAmt": 0,
      "Barcode": "IC191TBP35LJ1SD8WA"
  },
  "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 特店業者編號
MerchantTradeNo string 訂單編號
TransactionID string 愛金卡交易序號
ICPAccount string 愛金卡帳戶
TotalAmount integer 訂單總金額
ICPAmount integer 實際付款金額
BonusAmt integer 折抵金額
PaymentDate string 付款時間
PaymentType string 扣款金流類型
MMemberID string 特約機構會員 ID
MobileInvoiceCarry string 電子發票手機載具
Timestamp string 時間戳記
格式:2019/01/01 00:00:00 UTC+8
MaskedPan string 卡號前六後四碼

Response

{
  "RtnCode": 1,
  "RtnMsg": "訊息代碼:0001,成功",
  "EncData": {
    "MerchantID": "10523650",
    "PlatformID": "10523647",
    "TransactionID": "20230516101049195830",
    "ICPAccount": "1682011000002983",
    "TotalAmount": "100",
    "ICPAmount": "100",
    "BonusAmt": "0",
    "PaymentDate": "2023/05/16 10:10:50",
    "PaymentType": "1",
    "MMemberID": "",
    "MobileInvoiceCarry": "",
    "MerchantTradeNo": "202305160934510005",
    "MaskedPan": null,
    "Timestamp": "2023/05/16 10:10:50"
  }
}

Integrate Pay Workflow

%%{init: {'securityLevel': 'loose', 'theme':'base'}}%% sequenceDiagram; autonumber Client ->> OmniPlatform: Request [POST] /v1/payment/integrate/pay OmniPlatform->>OmniPlatform: Check Request Params alt params['type'] not in correct_payment_type OmniPlatform -->> Client: Response 400, "無此付款方式 { params['type'] }" end OmniPlatform ->> OmniPlatform: payment_params = [db].[stores].[金流參數] alt payment_params is None OmniPlatform ->> OmniPlatform: payment_params = [db].[siteinfo].[金流參數] alt payment_params is None OmniPlatform -->> Client: Response 400, "公司/門市缺少 { params['type'] } 金流相關設定" end end OmniPlatform->>Pay Server: Request [POST] pay_server_url Pay Server-->>OmniPlatform: Response result OmniPlatform -->> Client: Response result