|
|
@@ -3,19 +3,19 @@ declare(strict_types=1);
|
|
|
namespace SixShop\Lakala\Service;
|
|
|
|
|
|
use SixShop\Lakala\Config;
|
|
|
+use SixShop\Lakala\Log;
|
|
|
use SixShop\Lakala\OpenAPISDK\V3\Api\LakalaNotifyApi;
|
|
|
use SixShop\Lakala\OpenAPISDK\V3\Model\ModelTradeNotify;
|
|
|
use SixShop\Lakala\PaymentProvider;
|
|
|
use SixShop\Payment\Enum\PaymentStatusEnum;
|
|
|
use SixShop\Payment\Model\ExtensionPaymentModel;
|
|
|
-use think\facade\Log;
|
|
|
use function SixShop\Core\error_response;
|
|
|
use function SixShop\Core\throw_logic_exception;
|
|
|
|
|
|
class NotifyService
|
|
|
{
|
|
|
private LakalaNotifyApi $notifyApi;
|
|
|
- public function __construct(private Config $config, private PaymentProvider $paymentProvider)
|
|
|
+ public function __construct(private Config $config, private PaymentProvider $paymentProvider, private Log $log)
|
|
|
{
|
|
|
$this->notifyApi = new LakalaNotifyApi($this->config->getV3Config());
|
|
|
}
|
|
|
@@ -24,7 +24,7 @@ class NotifyService
|
|
|
{
|
|
|
$headers = getallheaders();
|
|
|
$body = file_get_contents('php://input');
|
|
|
- Log::debug('lakala notify headers:{headers} body:{body}', [
|
|
|
+ $this->log->debug('lakala notify headers:{headers} body:{body}', [
|
|
|
'headers' => json_encode($headers),
|
|
|
'body' => $body
|
|
|
]);
|
|
|
@@ -42,6 +42,6 @@ class NotifyService
|
|
|
throw_logic_exception('lakala notify transaction_id status error');
|
|
|
}
|
|
|
$this->paymentProvider->query($payment->id);
|
|
|
- Log::debug('lakala notified success {transaction_id}', ['transaction_id' => $payment->transaction_id]);
|
|
|
+ $this->log->debug('lakala notified success {transaction_id}', ['transaction_id' => $payment->transaction_id]);
|
|
|
}
|
|
|
}
|