zwhui преди 1 година
родител
ревизия
3e353c215b
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 4 3
      netflix-service/src/main/java/com/cyksj/service/paypal/PaypalV2Service.java

+ 4 - 3
netflix-service/src/main/java/com/cyksj/service/paypal/PaypalV2Service.java

@@ -205,8 +205,9 @@ public class PaypalV2Service {
         PayPalClient payPalClient = new PayPalClient();
         try {
             response = payPalClient.client(paypalPayConfig.getMode(), paypalPayConfig.getClientId(), paypalPayConfig.getClientSecret()).execute(ordersCaptureRequest);
-
-            for (PurchaseUnit purchaseUnit : response.result().purchaseUnits()) {
+            Order result = response.result();
+            log.info("captureOrder response: {}", result);
+            for (PurchaseUnit purchaseUnit : result.purchaseUnits()) {
                 for (Capture capture : purchaseUnit.payments().captures()) {
                     if ("COMPLETED".equals(capture.status())) {
                         //支付成功
@@ -214,7 +215,7 @@ public class PaypalV2Service {
                         String saleId = capture.id();
                         String fee = capture.sellerReceivableBreakdown().paypalFee().value();
                         String orderId = purchaseUnit.referenceId();
-                        String json = Jsons.toJson(response.result());
+                        String json = Jsons.toJson(result);
                         log.info("captureOrder response body: {}", json);
                         //更新订单支付状态
                         OrderDon orderDon = orderDonService.getById(orderId);