|
主要流程
1.從前台獲得物流資訊以及金流串接key
2.將現有資訊轉成字串傳送給綠界獲得檢查碼
3.將檢查碼匯入現有的字串傳送過去給綠界建立訂單
參數請至 綠界科技物流串接文件 查看
檢查碼範例 - public static function getCheckMacValue($postData){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,"https://logistics-stage.ecpay.com.tw/helper/getMacValue");
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
- $checkString=curl_exec($ch);
- curl_close($ch);
- return $checkString;
- }
複製代碼
建立訂單範例 - $postData = "HashKey=XBERn1YOvpM9nfZc&GoodsAmount=1000&IsCollection=N&LogisticsSubType=F
- AMIC2C&LogisticsType=CVS&MerchantID=2000933&MerchantTradeDate=2013/03/12
- 15:30:23&MerchantTradeNo=A20130312153023&ReceiverName=收件者姓名
- &ReceiverStoreID=001779&SenderName=寄件者姓名
- &ServerReplyURL=https://www.ecpay.com.tw/ServerReplyURL&HashIV=h1ONHk4P4yqbl5LK"
複製代碼
|
|