Merge remote-tracking branch 'origin/master'

This commit is contained in:
egan
2019-03-22 10:37:53 +08:00
14 changed files with 40 additions and 17 deletions

View File

@@ -264,7 +264,7 @@ public class PayPalPayService extends BasePayService<PayPalConfigStorage>{
public Map<String, Object> refund(RefundOrder refundOrder) {
JSONObject request = new JSONObject();
if (null != refundOrder.getRefundAmount() && BigDecimal.ZERO.compareTo( refundOrder.getRefundAmount()) > 0){
if (null != refundOrder.getRefundAmount() && BigDecimal.ZERO.compareTo( refundOrder.getRefundAmount()) == -1){
Amount amount = new Amount();
amount.setCurrency(refundOrder.getCurType().name());
amount.setTotal(Util.conversionAmount(refundOrder.getRefundAmount()).toString());
@@ -272,7 +272,7 @@ public class PayPalPayService extends BasePayService<PayPalConfigStorage>{
request.put("description", refundOrder.getDescription());
}
HttpStringEntity httpEntity = new HttpStringEntity(request, ContentType.APPLICATION_JSON);
HttpStringEntity httpEntity = new HttpStringEntity(request.toJSONString(), ContentType.APPLICATION_JSON);
httpEntity.setHeaders(authHeader());
JSONObject resp = getHttpRequestTemplate().postForObject(getReqUrl(PayPalTransactionType.REFUND), httpEntity, JSONObject.class, refundOrder.getTradeNo());
return resp;
@@ -310,4 +310,6 @@ public class PayPalPayService extends BasePayService<PayPalConfigStorage>{
public Map<String, Object> secondaryInterface(Object tradeNoOrBillDate, String outTradeNoBillType, TransactionType transactionType) {
return Collections.emptyMap();
}
}