Commit 308373c4 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_wechat_secure_payment: Allow custom base_url and make tests easier

  This is required for multiple sites support and allow us write unit tests and not create a 100 lines mock.
parent 4ebd9097
...@@ -122,6 +122,8 @@ class WechatService(XMLObject): ...@@ -122,6 +122,8 @@ class WechatService(XMLObject):
wechat_url = self.getLinkUrlString() wechat_url = self.getLinkUrlString()
if self.getWechatMode() == "SANDBOX": if self.getWechatMode() == "SANDBOX":
key = self.getSandboxKey() key = self.getSandboxKey()
elif self.getWechatMode() == "UNITTEST":
return {"result_code": 'SUCCESS', "code_url": 'weixin://wxpay/bizpayurl?pr=AAAAA'}
else: else:
key = self.getServiceApiKey() key = self.getServiceApiKey()
nonce_str = self.generateRandomStr() nonce_str = self.generateRandomStr()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment