ecpay / ecpayaio_python Goto Github PK
View Code? Open in Web Editor NEW提供綠界金流Python SDK 供廠商下載串接使用
提供綠界金流Python SDK 供廠商下載串接使用
我想把這個 repo fork 出去, 並改成我想要的版本
但是因為沒有 License 所以我不敢這樣做
如果方便的話可以加上 License 檔嗎
不方便的話也煩請告知
感謝
建立訂單的程式碼如下:
sdk = self.get_sdk()
order_params = {
'MerchantTradeNo': trade.number,
# 'StoreID': '',
'MerchantTradeDate': datetime.utcnow().strftime('%Y/%m/%d %H:%M:%S'),
# 'PaymentType': 'aio',
'TotalAmount': int(amount),
'TradeDesc': description,
'ItemName': item_name,
'ReturnURL': f'{HOST}/payment/ecpay/callback',
'ChoosePayment': 'Credit',
# 'ClientBackURL': PAYMENT_REDIRECT_URL,
# 'ItemURL': 'https://www.ecpay.com.tw/item_url.php',
# 'Remark': '交易備註',
# 'ChooseSubPayment': '',
# 'OrderResultURL': PAYMENT_REDIRECT_URL,
'OrderResultURL': f'{HOST}/payment/ecpay/order-result/callback',
'NeedExtraPaidInfo': 'Y',
# 'DeviceSource': '',
# 'IgnorePayment': '',
# 'PlatformID': '',
# 'InvoiceMark': 'N',
# 'EncryptType': 1,
}
order = sdk.create_order(order_params)
ReturnURL
與 OrderResultURL
使用同一個 HOST
Local 開發使用 ngrok,兩個 callback 都可以被觸發,一切正常
Production 環境使用自己的 Domain,只有 OrderResultURL
有被觸發,ReturnURL
完全沒收到 Request
更奇怪的是,ECPay 理論上要拿到 ReturnURL
的 response 才能知道 user 付款成功或失敗,但是 ECPay 連 Request 都沒打出來,user 卻還能付款成功?
目前已知 local 和 production 的差別在於
local 用 ngrok 開出來的 host name 不含 port number,例如 http://myapp.ngrok.io
production 使用的自訂 host name 含有 port number,例如 https://myapp.example.com:8888
為啥本來可以收款的交易連結,現在通通顯示
本次交易未提供任何付款方式,請與商店聯繫確認。
不論是我串接你們家的 api,還是收款連結,通通失效
你們不是說 8/1 才會開始修改方案嗎?
7/1~7/31 都可以補件,現在是?????
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.