diff --git a/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQuery.php b/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQuery.php index 02b7f95bf..8536765e4 100644 --- a/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQuery.php +++ b/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQuery.php @@ -21,12 +21,11 @@ namespace PrestaShop\Module\PrestashopCheckout\PaymentMethodToken\Query; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; -use PrestaShop\Module\PrestashopCheckout\PayPal\Customer\ValueObject\PayPalCustomerId; class GetCustomerPaymentMethodTokensQuery { /** - * @var PayPalCustomerId + * @var CustomerId */ private $customerId; diff --git a/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQueryHandler.php b/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQueryHandler.php index c0cc983ea..8c735cd5a 100644 --- a/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQueryHandler.php +++ b/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQueryHandler.php @@ -55,7 +55,7 @@ public function __construct(PayPalCustomerRepository $customerRepository, Paymen */ public function handle(GetCustomerPaymentMethodTokensQuery $query) { - $customerIdPayPal = $query->getCustomerId() ? $this->customerRepository->findPayPalCustomerIdByCustomerId($query->getCustomerId()) : null; + $customerIdPayPal = $query->getCustomerId()->getValue() ? $this->customerRepository->findPayPalCustomerIdByCustomerId($query->getCustomerId()) : null; $paymentTokens = $this->paymentMethodTokenRepository->findByCustomerId($customerIdPayPal, $query->getPageSize(), $query->getPageNumber()); if ($query->isTotalCountRequired()) { diff --git a/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQueryResult.php b/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQueryResult.php index 6a6b7b7d3..eb7f871c4 100644 --- a/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQueryResult.php +++ b/src/PaymentMethodToken/Query/GetCustomerPaymentMethodTokensQueryResult.php @@ -48,7 +48,7 @@ class GetCustomerPaymentMethodTokensQueryResult * @param array $paymentTokens * @param CustomerId $customerId * @param int $totalItems - * @param int $totalPages + * @param int|null $totalPages */ public function __construct(array $paymentTokens, CustomerId $customerId, $totalItems, $totalPages) { diff --git a/src/PaymentMethodToken/ValueObject/PaymentMethodTokenId.php b/src/PaymentMethodToken/ValueObject/PaymentMethodTokenId.php index 63a6ac6f2..d08c35dae 100644 --- a/src/PaymentMethodToken/ValueObject/PaymentMethodTokenId.php +++ b/src/PaymentMethodToken/ValueObject/PaymentMethodTokenId.php @@ -67,7 +67,7 @@ private function assertIsValid($id) throw new InvalidArgumentException('PayPal Vault ID must be between 1 and 36 characters long.'); } - if (preg_match('^[0-9a-zA-Z_-]+$', $id) !== 1) { + if (preg_match('/^[0-9a-zA-Z_-]+$/', $id) !== 1) { throw new InvalidArgumentException('PayPal Vault ID must be alphanumeric.'); } }