diff --git a/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/NAPWechatApi.java b/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/NAPWechatApi.java new file mode 100644 index 000000000..61151721f --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/support/wechatclients/NAPWechatApi.java @@ -0,0 +1,45 @@ +package au.com.royalpay.payment.manage.support.wechatclients; + +import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; +import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack; +import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractMpWechatClientApi; +import au.com.royalpay.payment.tools.exceptions.ServerErrorException; +import com.alibaba.fastjson.JSONObject; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; + +/** + * Created by yishuqian on 11/01/2017. + */ +@Service +public class NAPWechatApi extends AbstractMpWechatClientApi implements MpWechatApi { + @PostConstruct + public void initTemplates() { + } + + @Override + public String targetMpAccount() { + return "globalpay"; + } + + @Override + public String getOpenIdKey() { + return "globalpay_openid"; + } + + @Override + public JSONObject sendRedpack(WechatRedpack redpackInfo) { + throw new ServerErrorException("Cannot send redpack with this merchant"); + } + + @Override + public JSONObject redpackStatus(String redpackId) { + throw new ServerErrorException("Cannot send redpack with this merchant"); + } + + @Override + public boolean matchOpenId(String openId) { + return openId.startsWith("olHWD"); + } +} diff --git a/src/main/resources/application-wechat.properties b/src/main/resources/application-wechat.properties index db572596a..308010bef 100644 --- a/src/main/resources/application-wechat.properties +++ b/src/main/resources/application-wechat.properties @@ -10,4 +10,11 @@ app.wechatpay.merchants.1431999902.app-id=wx703febcbd34dae38 app.wechatpay.merchants.1431999902.merchant-id=1431999902 app.wechatpay.merchants.1431999902.mch-key=p3tgzrAJbe6eQrunbv8jb8gz5yXxvJdE app.wechatpay.merchants.1431999902.key-file=classpath:apiclient_new_cert.p12 -app.wechatpay.merchants.1431999902.example-sub-merchant-id=42991963 \ No newline at end of file +app.wechatpay.merchants.1431999902.example-sub-merchant-id=42991963 + +app.wechatpay.merchants.1487387142.app-id=wx3e14d1144d898197 +app.wechatpay.merchants.1487387142.mp-id=globalpay +app.wechatpay.merchants.1487387142.merchant-id=1487387142 +app.wechatpay.merchants.1487387142.mch-key=OuvLIL93STqFhTngNaBGT8751ZJn4FKL +app.wechatpay.merchants.1487387142.key-file=classpath:napclient_cert.p12 +app.wechatpay.merchants.1487387142.example-sub-merchant-id=117551742 \ No newline at end of file diff --git a/src/main/resources/napclient_cert.p12 b/src/main/resources/napclient_cert.p12 new file mode 100644 index 000000000..2c9e2f5cc Binary files /dev/null and b/src/main/resources/napclient_cert.p12 differ