Explorar o código

修改日志名称

llp hai 3 días
pai
achega
8e9c844d29

+ 3 - 3
packages/Longyi/Pay/Afterpay/src/Payment/Afterpay.php

@@ -183,7 +183,7 @@ class Afterpay extends Payment
         }
     }
 
-    public function capture($token)
+    public function capture($token, $methodType = 'Afterpay')
     {
         $client = new Client();
         $response = $client->request('POST', $this->capturePaymentUlr, [
@@ -197,7 +197,7 @@ class Afterpay extends Payment
             'verify' => false
         ]);
         $responseBody = $response->getBody()->getContents();
-        Log::channel('payment')->info('Afterpay capture response', [
+        Log::channel('payment')->info("{$methodType} capture response", [
             'token'     => $token,
             'status'    => $response->getStatusCode(),
             'body'      => $responseBody,
@@ -207,7 +207,7 @@ class Afterpay extends Payment
         if ($resultObject->status == 'APPROVED') {
             return ['transaction_id' => $resultObject->token, 'amount' => $resultObject->events[0]->amount->amount];
         } else {
-            throw new \Exception('afterpay capture is error');
+            throw new \Exception("{$methodType} capture is error");
         }
     }
 

+ 1 - 1
packages/Longyi/Pay/Afterpay/src/Payment/Clearpay.php

@@ -127,7 +127,7 @@ class Clearpay extends Afterpay
         if ($transactionId != $token) {
             return new \Exception('order token is error');
         }
-        return $this->capture($token);
+        return $this->capture($token, 'Clearpay');
     }
     public function getCountryOptions(): array
     {