| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.acct.payment.adapt.bbgpay.EncryptDecryptFactory; |
| | | import com.java110.acct.payment.adapt.bbgpay.lib.AesEncrypt; |
| | | import com.java110.acct.payment.adapt.bbgpay.lib.CAUtil; |
| | | import com.java110.acct.payment.adapt.bbgpay.lib.HttpRequestUtil; |
| | | import com.java110.acct.payment.adapt.bbgpay.lib.JsonUtil; |
| | | import com.java110.acct.smo.IQrCodePaymentSMO; |
| | | import com.java110.core.client.RestTemplate; |
| | | import com.java110.core.factory.CommunitySettingFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.dto.smallWeChat.SmallWeChatDto; |
| | | import com.java110.intf.store.ISmallWeChatInnerServiceSMO; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | |
| | | |
| | | private static String SIGN_TYPE = "RSA2";// 加密算法:SM4、RSA2 |
| | | |
| | | private static String gzhPayUrl = "https://epaytest.bankofbbg.com/www/corepaycer/ScanCodePay"; |
| | | private static String gzhPayUrl = "https://mbank.bankofbbg.com/www/corepaycer/ScanCodePay"; |
| | | |
| | | private static String queryUrl = "https://epaytest.bankofbbg.com/www/corepaycer/QueryTxnInfo";// 交易查询地址 |
| | | private static String queryUrl = "https://mbank.bankofbbg.com/www/corepaycer/QueryTxnInfo";// 交易查询地址 |
| | | |
| | | @Autowired |
| | | private ISmallWeChatInnerServiceSMO smallWeChatInnerServiceSMOImpl; |
| | |
| | | if ("SUCCESS".equals(paramOut.getString("deal_status"))) { |
| | | return new ResultVo(ResultVo.CODE_OK, "成功"); |
| | | } else { |
| | | return new ResultVo(ResultVo.CODE_ERROR, resMap.get("等待用户支付中")); |
| | | return new ResultVo(ResultVo.CODE_ERROR, "等待用户支付中"); |
| | | } |
| | | } |
| | | |
| | |
| | | String decryParams = EncryptDecryptFactory.execute(communityId, queryUrl, params); |
| | | |
| | | JSONObject paramOut = JSONObject.parseObject(decryParams); |
| | | |
| | | if (!"SUCCESS".equals(paramOut.getString("status")) |
| | | || !"SUCCESS".equals(paramOut.getString("deal_status"))) { |
| | | throw new IllegalArgumentException("支付失败" + paramOut.getString("return_message")); |
| | | } |
| | | |
| | | if (!"0000".equals(paramOut.getString("return_code")) |
| | | || !"SUCCESS".equals(paramOut.getString("status")) |
| | | && !"0001".equals(paramOut.getString("return_code")) |
| | | ) { |
| | | return new ResultVo(ResultVo.CODE_ERROR, "支付失败" + paramOut.getString("return_message")); |
| | | |
| | | throw new IllegalArgumentException("支付失败" + paramOut.getString("return_message")); |
| | | } |
| | | |
| | | if ("FAIL".equals(paramOut.getString("deal_status"))) { |
| | | return new ResultVo(ResultVo.CODE_ERROR, "业务失败"); |
| | | } |
| | | |
| | | if ("SUCCESS".equals(paramOut.getString("deal_status"))) { |
| | | if ("0000".equals(paramOut.getString("return_code"))) { |
| | | return new ResultVo(ResultVo.CODE_OK, "成功"); |
| | | } else { |
| | | return new ResultVo(ResultVo.CODE_WAIT_PAY, "等待支付完成"); |