Authored by tanling

跨境支付

... ... @@ -524,10 +524,26 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
throw new ServiceException(ServiceError.ORDER_NULL);
}
return buildOrderInfo(buyerOrder);
// orderCode --> skup, goods_num
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(uid, orderCode);
if (buyerOrderGoods == null){
logger.warn("getOrderInfo order goods not exist, orderCode is {}, uid is {}", orderCode, uid);
throw new ServiceException(ServiceError.ORDER_NULL);
}
// skup --> product_name
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
OrderInfo orderInfo = buildOrderInfo(buyerOrder);
if (sellerOrderGoods == null){
return orderInfo;
}
orderInfo.setGoodsName(sellerOrderGoods.getProductName());
return orderInfo;
}
private OrderInfo buildOrderInfo(BuyerOrder buyerOrder) {
private OrderInfo buildOrderInfo(BuyerOrder buyerOrder ) {
OrderInfo orderInfo = OrderInfo.builder()
.id(buyerOrder.getId())
.uid(buyerOrder.getUid())
... ... @@ -563,7 +579,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
throw new ServiceException(ServiceError.ORDER_NULL);
}
return buildOrderInfo(buyerOrder);
return buildOrderInfo(buyerOrder );
}
... ...
... ... @@ -200,9 +200,10 @@ public class AlipayCrossBorderService extends AlipayServiceAbstract {
* @param tradeNo
* @param amount
* @param payExpireTime
* @param productName
* @return
*/
private Map<String, String> buildOpenApiPayParams(String tradeNo, BigDecimal amount, int payExpireTime) {
private Map<String, String> buildOpenApiPayParams(String tradeNo, BigDecimal amount, int payExpireTime, String productName) {
Map<String, String> params = new HashMap<String, String>();
params.put("service", "mobile.securitypay.pay");
... ... @@ -220,18 +221,16 @@ public class AlipayCrossBorderService extends AlipayServiceAbstract {
params.put("currency", "HKD"); // Hong Kong Dollar
params.put("forex_biz", "FP");
params.put("it_b_pay", payExpireTime+"m");
params.put("body", "商品名称测试test");
params.put("refer_url", getNotifyURL()); // 下载商家应用的信息
params.put("refer_url", "http://www.yohobuy.com"); // 下载商家应用的信息
params.put("product_code", "NEW_WAP_OVERSEAS_SELLER");
JSONObject trade_information = new JSONObject();
params.put("trade_information", trade_information.toJSONString());
trade_information.put("business_type", 4);
trade_information.put("goods_info", "xxdd^1");
trade_information.put("goods_info", productName + "^1");
trade_information.put("total_quantity",1);
String preSignStr = getOpenApiSignString(params, true);
String sign = RSAUtils.sign(preSignStr, getRsaPrivateKey(), AlipayConfig.input_charset);
params.put("sign", URLEncoder.encode(sign));
... ...