---
# System prepended metadata

title: Ecpay 金流問題描述(Golang)

---

# Ecpay 金流問題描述(Golang)

### 問題: "Timestamp Parameters Error"
[圖文版](https://hackmd.io/faD-ViJXTL-fvv1A_X1Yog)
### 發送時間
* 2020-04-21 16:51:29.1396928 +0800 CST m=+0.007986701
* 發送之Timestamp: 1587459089
* 綠界API 回應之Timestamp: 1587459089

**但收到Timestamp Parameters Error**

### 發送之JSON內容
```
{"MerchantID":"2000132","RqHeader":{"Timestamp":1587459089,"RqID":"1322628B15874590894A19451B81ARR","Revision":"3.0.0"},"Data":{"MerchantID":"2000132","RelateNumber":"20201587459089123456","CustomerID":"","CustomerIdentifier":"","CustomerName":"綠界科技股份有限公司","CustomerAddr":"106 台北市南港區發
票一街1號1樓","CustomerPhone":"","CustomerEmail":"test@ecpay.com.tw","ClearanceMark":"1","Print":"1","Donation":"0","LoveCode":"","CarrierType":"","CarrierNum":"","TaxType":"1","SalesAmount":50,"InvoiceRemark":"發票備註","InvType":"07","Items":[{"ItemSeq":1,"ItemName":"item01","ItemCount":1,"ItemWord":"件","ItemPrice":50,"ItemTaxType":"1","ItemAmount":50,"ItemRemark":"item01_desc"},{"ItemSeq":2,"ItemName":"item02","ItemCount":1,"ItemWord":"個","ItemPrice":20,"ItemTaxType":"1","ItemAmount":20,"ItemRemark":"item02_desc"},{"ItemSeq":3,"ItemName":"item03","ItemCount":3,"ItemWord":"粒","ItemPrice":10,"ItemTaxType":"1","ItemAmount":30,"ItemRemark":"item03_desc"}]}}
```
![](https://i.imgur.com/HIdlXBG.png)

### URLencode
```
[Encode後原文：] ： %7B%22MerchantID%22%3A%222000132%22%2C%22RqHeader%22%3A%7B%22Timestamp%22%3A1587459089%2C%22RqID%22%3A%221322628B15874590894A19451B81ARR%22%2C%22Revision%22%3A%223.0.0%22%7D%2C%22Data%22%3A%7B%22MerchantID%22%3A%222000132%22%2C%22RelateNumber%22%3A%2220201587459089123456%22%2C%22CustomerID%22%3A%22%22%2C%22CustomerIdentifier%22%3A%22%22%2C%22CustomerName%22%3A%22%E7%B6%A0%E7%95%8C%E7%A7%91%E6%8A%80%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8%22%2C%22CustomerAddr%22%3A%22106+%E5%8F%B0%E5%8C%97%E5%B8%82%E5%8D%97%E6%B8%AF%E5%8D%80%E7%99%BC%E7%A5%A8%E4%B8%80%E8%A1%971%E8%99%9F1%E6%A8%93%22%2C%22CustomerPhone%22%3A%22%22%2C%22CustomerEmail%22%3A%22test%40ecpay.com.tw%22%2C%22ClearanceMark%22%3A%221%22%2C%22Print%22%3A%221%22%2C%22Donation%22%3A%220%22%2C%22LoveCode%22%3A%22%22%2C%22CarrierType%22%3A%22%22%2C%22CarrierNum%22%3A%22%22%2C%22TaxType%22%3A%221%22%2C%22SalesAmount%22%3A50%2C%22InvoiceRemark%22%3A%22%E7%99%BC%E7%A5%A8%E5%82%99%E8%A8%BB%22%2C%22InvType%22%3A%2207%22%2C%22Items%22%3A%5B%7B%22ItemSeq%22%3A1%2C%22ItemName%22%3A%22item01%22%2C%22ItemCount%22%3A1%2C%22ItemWord%22%3A%22%E4%BB%B6%22%2C%22ItemPrice%22%3A50%2C%22ItemTaxType%22%3A%221%22%2C%22ItemAmount%22%3A50%2C%22ItemRemark%22%3A%22item01_desc%22%7D%2C%7B%22ItemSeq%22%3A2%2C%22ItemName%22%3A%22item02%22%2C%22ItemCount%22%3A1%2C%22ItemWord%22%3A%22%E5%80%8B%22%2C%22ItemPrice%22%3A20%2C%22ItemTaxType%22%3A%221%22%2C%22ItemAmount%22%3A20%2C%22ItemRemark%22%3A%22item02_desc%22%7D%2C%7B%22ItemSeq%22%3A3%2C%22ItemName%22%3A%22item03%22%2C%22ItemCount%22%3A3%2C%22ItemWord%22%3A%22%E7%B2%92%22%2C%22ItemPrice%22%3A10%2C%22ItemTaxType%22%3A%221%22%2C%22ItemAmount%22%3A30%2C%22ItemRemark%22%3A%22item03_desc%22%7D%5D%7D%7D
```

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jTxvny9AILN3D+NzlsA1DmwX8SKDWUO/vA/yy1l2DCY+laRzjLT5KJJnoLig+d0bLGim+3RCtZNAB+anmiZtBDg1zctNClnBhHF1Cbgm5vPadXcLRKbzlKpf8Yr/hAuO/lj9oae4J812dawYbojX3FNLanKzwW29ddGr5a
```
![](https://i.imgur.com/Xwmh8Tl.png)


### 綠界API 回應
```
response Status: 200 OK
response Headers: map[Cache-Control:[private] Content-Length:[200] Content-Security-Policy:[] Content-Type:[application/json; charset=utf-8] Date:[Tue, 21 Apr 2020 08:51:29 GMT] Referrer-Policy:[no-referrer-when-downgrade] Server:[Apache/2.4.12 (Unix) OpenSSL/1.0.2a PHP/5.6.0] X-Content-Type-Options:[nosniff] X-Frame-Options:[SAMEORIGIN] X-Xss-Protection:[1; mode=block]]
response Body: {"PlatformID":0,"MerchantID":2000132,"RpHeader":{"Timestamp":1587459089,"RqID":"1322628BD63B43279FB094A19451B81A","Revision":"3.0.0"},"TransCode":0,"TransMsg":"Timestamp Parameters Error","Data":null}
```
![](https://i.imgur.com/IlG2hAw.png)
