|
|
@@ -242,7 +242,11 @@ public class OrderRefundServiceImpl implements OrderRefundService {
|
|
|
|
|
|
|
|
|
public Boolean paypalRefund(OrderRefundReq refundReq, OrderDon orderDon) throws PayPalRESTException {
|
|
|
- BigDecimal net = refundReq.getRefundMoney().divide(new BigDecimal(7),2,RoundingMode.HALF_DOWN).subtract(orderDon.getAbroadTransactionFee());;
|
|
|
+ BigDecimal net = refundReq.getRefundMoney().divide(new BigDecimal(7), 2, RoundingMode.HALF_DOWN);
|
|
|
+ //非补差价 需要扣除手续费
|
|
|
+ if (!refundReq.getIsDiffer()) {
|
|
|
+ net = net.subtract(orderDon.getAbroadTransactionFee());
|
|
|
+ }
|
|
|
log.info("paypal return order:{},money:{}",orderDon.getId(),net);
|
|
|
PaypalPayConfig paypalPayConfig = paypalPayConfigMapper.selectById(1);
|
|
|
APIContext apiContext = getAPIContext(paypalPayConfig.getClientId(), paypalPayConfig.getClientSecret(),paypalPayConfig.getMode());
|
|
|
@@ -260,7 +264,10 @@ public class OrderRefundServiceImpl implements OrderRefundService {
|
|
|
}
|
|
|
|
|
|
public Boolean stripeRefund(OrderRefundReq refundReq, OrderDon orderDon) throws StripeException {
|
|
|
- BigDecimal net = refundReq.getRefundMoney().divide(new BigDecimal(7),2, RoundingMode.HALF_DOWN).subtract(orderDon.getAbroadTransactionFee());
|
|
|
+ BigDecimal net = refundReq.getRefundMoney().divide(new BigDecimal(7), 2, RoundingMode.HALF_DOWN);
|
|
|
+ if (!refundReq.getIsDiffer()) {
|
|
|
+ net = net.subtract(orderDon.getAbroadTransactionFee());
|
|
|
+ }
|
|
|
log.info("stripe return order:{},money:{}",orderDon.getId(),net);
|
|
|
StripePayConfig stripePayConfig = stripePayConfigMapper.selectById(1);
|
|
|
Stripe.apiKey = stripePayConfig.getApiKey();
|