|
|
@@ -327,6 +327,15 @@ class Afterpay extends Payment
|
|
|
}
|
|
|
} catch (\Exception $e) {
|
|
|
Log::channel('payment')->error("{$order->payment->method} fetchOrderStatus error: " . $e->getMessage());
|
|
|
+ try {
|
|
|
+ // 如果获取失败,尝试进行一次确认
|
|
|
+ $captureArr = $this->capture($gatewayOrderId);
|
|
|
+ $paymentStatus['captures'] = $captureArr['transaction_id'] ? true : null;
|
|
|
+ $paymentStatus['status'] = $captureArr['transaction_id'] ? 'COMPLETED' : null;
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ $paymentStatus['captures'] = null;
|
|
|
+ $paymentStatus['status'] = null;
|
|
|
+ }
|
|
|
}
|
|
|
return $paymentStatus;
|
|
|
}
|