🎨 微信支付分支付回调接口优化以及补充测试代码

This commit is contained in:
spvycf
2020-05-21 21:18:59 +08:00
committed by GitHub
parent 4929e4e03e
commit 50e50c13c4
3 changed files with 81 additions and 4 deletions

View File

@@ -125,6 +125,19 @@ public interface PayScoreService {
* @return the wx pay score result
* @throws WxPayException the wx pay exception
*/
WxPayScoreResult parseNotifyData(PayScoreNotifyData data) throws WxPayException;
PayScoreNotifyData parseNotifyData(String data);
/**
* <pre>
* 支付分回调NotifyData解密resource
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter5_2.shtml
* </pre>
*
* @param data the data
* @return the wx pay score result
* @throws WxPayException the wx pay exception
*/
WxPayScoreResult decryptNotifyDataResource(PayScoreNotifyData data) throws WxPayException;
}

View File

@@ -139,7 +139,13 @@ public class PayScoreServiceImpl implements PayScoreService {
}
@Override
public WxPayScoreResult parseNotifyData(PayScoreNotifyData data) throws WxPayException {
public PayScoreNotifyData parseNotifyData(String data){
return GSON.fromJson(data, PayScoreNotifyData.class);
}
@Override
public WxPayScoreResult decryptNotifyDataResource(PayScoreNotifyData data) throws WxPayException {
PayScoreNotifyData.Resource resource = data.getResource();
String cipherText = resource.getCipherText();
String associatedData = resource.getAssociatedData();