增加二维码信息返回接口

This commit is contained in:
egan
2019-08-04 17:16:41 +08:00
parent 7dae9dcca2
commit 66055980f6
9 changed files with 34 additions and 15 deletions

View File

@@ -386,7 +386,7 @@ public class UnionPayService extends BasePayService<UnionPayConfigStorage> {
* @return 返回图片信息,支付时需要的
*/
@Override
public BufferedImage genQrPay(PayOrder order) {
public String getQrPay(PayOrder order) {
Map<String, Object> params = orderInfo(order);
String responseStr = getHttpRequestTemplate().postForObject(this.getBackTransUrl(), params, String.class);
Map<String, Object> response = UriVariables.getParametersToMap(responseStr);
@@ -396,7 +396,7 @@ public class UnionPayService extends BasePayService<UnionPayConfigStorage> {
if (this.verify(response)) {
if (SDKConstants.OK_RESP_CODE.equals(response.get(SDKConstants.param_respCode))) {
//成功
return MatrixToImageWriter.writeInfoToJpgBuff((String) response.get(SDKConstants.param_qrCode));
return (String) response.get(SDKConstants.param_qrCode);
}
throw new PayErrorException(new PayException((String) response.get(SDKConstants.param_respCode), (String) response.get(SDKConstants.param_respMsg), responseStr));
}