Integrate LINE QRCode Pay Search
Description
LINE Pay 條碼支付查詢。
LINE Pay 金流參數:通路編號、通路密鑰
情境:
- 依廠商金流參數設定進行付款:金流參數為必填、門市代碼不需要填
- 依全通路金流參數設定進行付款:門市代碼為必填、金流參數不需要填
Resource
GET /v1/payment/integrate/search
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Query Parameters
| Name | Type | Description |
|---|---|---|
| type | string | 付款方式,請輸入 LINE_QRCODE_PAY |
| request | Request | 請求參數(json格式) |
| store_id | string | 門市代碼 (optional) |
| is_test | string | 是否為測試環境
|
Query Parameters - Request
| Name | Type | Description |
|---|---|---|
| channel_id | string | 通路編號 (optional) |
| channel_secret | string | 通路密鑰 (optional) |
| orderId | string | 訂單編號 (optional) |
| transactionId | integer | 交易編號 (optional) |
Request
GET /v1/payment/integrate/search?type=LINE_QRCODE_PAY&request={"channel_id":"1606993764","channel_secret":"101c18448bf38e160757d53417287bd9","orderId":"20140101123456789"}&store_id=0&is_test=FALSE
Response Body Parameters
| Name | Type | Description |
|---|---|---|
| returnCode | string | 結果代碼,0000為成功 |
| returnMessage | string | 結果訊息或失敗理由 |
| info | Info | 相關資訊 |
Response Body Parameters - Info
| Name | Type | Description |
|---|---|---|
| transactionId | integer | 交易編號(19 位數) |
| transactionDate | string | 交易日期與時間 |
| transactionType | string | 交易類型 ALLOWED VALUES:
|
| payInfo | Pay Info | 付款資訊 |
| productName | string | 產品名稱 |
| currency | string | 貨幣 ALLOWED VALUES:
|
| orderId | string | 訂單編號 |
| refundList | Refund Info[] | 退款清單紀錄 |
Response Body Parameters - Pay Info
| Name | Type | Description |
|---|---|---|
| method | string | 使用的付款方式 |
| amount | integer | 付款金額 |
| maskedCreditCardNumber | string | 信用卡卡號 |
Response Body Parameters - Refund Info
| Name | Type | Description |
|---|---|---|
| refundTransactionId | integer | 退款的交易編號(19 位數) |
| transactionType | string | 交易類型 ALLOWED VALUES:
|
| refundAmount | integer | 退款金額 |
| refundTransactionDate | string | 退款的交易日期與時間 |
Response
{
"returnCode": "0000",
"returnMessage": "success",
"info": [
{
"transactionId": 2019049910005496810,
"transactionDate": "2019-04-08T06:31:19Z",
"transactionType": "PAYMENT",
"productName": "test product",
"currency": "THB",
"payInfo": [
{
"method": "BALANCE",
"amount": 100
}
],
"refundList": [
{
"refundTransactionId": 2019049910005497012,
"transactionType": "PARTIAL_REFUND",
"refundAmount": -1,
"refundTransactionDate": "2019-04-08T06:33:17Z"
}
],
"orderId": "20190408001"
}
]
}
IntegrateSearch API Workflow
%%{init: {'securityLevel': 'loose', 'theme':'base'}}%%
sequenceDiagram
autonumber
participant C as Client
participant OP as OmniPlatform
participant PS as PayServer
C->>OP: Call IntegrateSearchAPI
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: 透過 payment_type 向門市或站台取得金流參數
alt 門市及站台金流參數未設定
OP->>C: Return Response(400, f"公司/⾨市缺少 {payment_type} ⾦流相關設定")
end
OP->>OP: Call self.pay_search(params, pay_config)
Note over OP: 根據 payment_type 處理 request、headers 資料,然後向 PayServer 發出請求
OP->>PS: Call Request [GET] search_server_url
activate PS
PS->>OP: Return Response
deactivate PS
OP->>C: Return Response
deactivate OP