|
|
@@ -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);
|