mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
phpcs
This commit is contained in:
parent
e5494bfc8b
commit
c98e10d2a1
16 changed files with 89 additions and 50 deletions
2
.github/workflows/php.yml
vendored
2
.github/workflows/php.yml
vendored
|
@ -29,4 +29,4 @@ jobs:
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
run: ./vendor/bin/phpunit
|
run: ./vendor/bin/phpunit
|
||||||
- name: Run cs
|
- name: Run cs
|
||||||
run: ./vendor/bin/phpcs src modules.local/ppcp-wc-gateway/src/ modules.local/ppcp-webhooks/src/ modules.local/ppcp-button/src/ modules.local/ppcp-onboarding/src/ --standard=Inpsyde
|
run: ./vendor/bin/phpcs src modules.local/ppcp-wc-gateway/src/ modules.local/ppcp-webhooks/src/ modules.local/ppcp-button/src/ modules.local/ppcp-onboarding/src/ modules.local/ppcp-subscription/src --standard=Inpsyde
|
||||||
|
|
|
@ -17,7 +17,9 @@ class DisabledSmartButton implements SmartButtonInterface
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canSaveVaultToken(): bool {
|
public function canSaveVaultToken(): bool
|
||||||
|
{
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,5 +11,4 @@ interface SmartButtonInterface
|
||||||
public function enqueue(): bool;
|
public function enqueue(): bool;
|
||||||
|
|
||||||
public function canSaveVaultToken(): bool;
|
public function canSaveVaultToken(): bool;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,12 +31,17 @@ class OnboardingAssets
|
||||||
$url = $this->moduleUrl . '/assets/css/onboarding.css';
|
$url = $this->moduleUrl . '/assets/css/onboarding.css';
|
||||||
wp_register_style(
|
wp_register_style(
|
||||||
'ppcp-onboarding',
|
'ppcp-onboarding',
|
||||||
$url
|
$url,
|
||||||
|
[],
|
||||||
|
1
|
||||||
);
|
);
|
||||||
$url = $this->moduleUrl . '/assets/js/settings.js';
|
$url = $this->moduleUrl . '/assets/js/settings.js';
|
||||||
wp_register_script(
|
wp_register_script(
|
||||||
'ppcp-settings',
|
'ppcp-settings',
|
||||||
$url
|
$url,
|
||||||
|
[],
|
||||||
|
1,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
if (!$this->shouldRenderOnboardingScript()) {
|
if (!$this->shouldRenderOnboardingScript()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -63,7 +68,6 @@ class OnboardingAssets
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -9,10 +9,10 @@ use Inpsyde\PayPalCommerce\Subscription\Repository\PaymentTokenRepository;
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'subscription.helper' => function(ContainerInterface $container) : SubscriptionHelper {
|
'subscription.helper' => static function (ContainerInterface $container): SubscriptionHelper {
|
||||||
return new SubscriptionHelper();
|
return new SubscriptionHelper();
|
||||||
},
|
},
|
||||||
'subscription.renewal-handler' => function(ContainerInterface $container) : RenewalHandler {
|
'subscription.renewal-handler' => static function (ContainerInterface $container): RenewalHandler {
|
||||||
$logger = $container->get('woocommerce.logger.woocommerce');
|
$logger = $container->get('woocommerce.logger.woocommerce');
|
||||||
$repository = $container->get('subscription.repository.payment-token');
|
$repository = $container->get('subscription.repository.payment-token');
|
||||||
$endpoint = $container->get('api.endpoint.order');
|
$endpoint = $container->get('api.endpoint.order');
|
||||||
|
@ -26,9 +26,9 @@ return [
|
||||||
$payerFactory
|
$payerFactory
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
'subscription.repository.payment-token' => function(ContainerInterface $container) : PaymentTokenRepository {
|
'subscription.repository.payment-token' => static function (ContainerInterface $container): PaymentTokenRepository {
|
||||||
$factory = $container->get('api.factory.payment-token');
|
$factory = $container->get('api.factory.payment-token');
|
||||||
$endpoint = $container->get('api.endpoint.payment-token');
|
$endpoint = $container->get('api.endpoint.payment-token');
|
||||||
return new PaymentTokenRepository($factory, $endpoint);
|
return new PaymentTokenRepository($factory, $endpoint);
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Inpsyde\PayPalCommerce\Subscription\Helper;
|
namespace Inpsyde\PayPalCommerce\Subscription\Helper;
|
||||||
|
@ -6,7 +7,7 @@ namespace Inpsyde\PayPalCommerce\Subscription\Helper;
|
||||||
class SubscriptionHelper
|
class SubscriptionHelper
|
||||||
{
|
{
|
||||||
|
|
||||||
public function currentProductIsSubscription() : bool
|
public function currentProductIsSubscription(): bool
|
||||||
{
|
{
|
||||||
if (! $this->pluginIsActive()) {
|
if (! $this->pluginIsActive()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -15,7 +16,7 @@ class SubscriptionHelper
|
||||||
return is_a($product, \WC_Product::class) && $product->is_type('subscription');
|
return is_a($product, \WC_Product::class) && $product->is_type('subscription');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cartContainsSubscription() : bool
|
public function cartContainsSubscription(): bool
|
||||||
{
|
{
|
||||||
if (! $this->pluginIsActive()) {
|
if (! $this->pluginIsActive()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -37,15 +38,24 @@ class SubscriptionHelper
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function acceptOnlyAutomaticPaymentGateways() : bool {
|
public function acceptOnlyAutomaticPaymentGateways(): bool
|
||||||
|
{
|
||||||
|
|
||||||
if (! $this->pluginIsActive()) {
|
if (! $this->pluginIsActive()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$accept_manual_renewals = ( 'no' !== get_option( \WC_Subscriptions_Admin::$option_prefix . '_accept_manual_renewals', 'no' ) ) ? true : false;
|
$acceptManualRenewals = ( 'no' !== get_option(
|
||||||
return ! $accept_manual_renewals;
|
//phpcs:disable Inpsyde.CodeQuality.VariablesName.SnakeCaseVar
|
||||||
|
\WC_Subscriptions_Admin::$option_prefix . '_accept_manual_renewals',
|
||||||
|
//phpcs:enable Inpsyde.CodeQuality.VariablesName.SnakeCaseVar
|
||||||
|
'no'
|
||||||
|
) ) ? true : false;
|
||||||
|
return ! $acceptManualRenewals;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function pluginIsActive() {
|
public function pluginIsActive(): bool
|
||||||
|
{
|
||||||
|
|
||||||
return class_exists(\WC_Subscriptions::class);
|
return class_exists(\WC_Subscriptions::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Inpsyde\PayPalCommerce\Subscription;
|
namespace Inpsyde\PayPalCommerce\Subscription;
|
||||||
|
@ -36,7 +37,9 @@ class RenewalHandler
|
||||||
$this->payerFactory = $payerFactory;
|
$this->payerFactory = $payerFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renew(\WC_Order $wcOrder) {
|
public function renew(\WC_Order $wcOrder)
|
||||||
|
{
|
||||||
|
|
||||||
$this->logger->log(
|
$this->logger->log(
|
||||||
'info',
|
'info',
|
||||||
sprintf(
|
sprintf(
|
||||||
|
@ -50,16 +53,7 @@ class RenewalHandler
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$userId = (int)$wcOrder->get_customer_id();
|
$this->processOrder($wcOrder);
|
||||||
$customer = new \WC_Customer($userId);
|
|
||||||
$token = $this->getTokenForCustomer($customer, $wcOrder);
|
|
||||||
if (! $token) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$purchaseUnits = $this->purchaseUnitFactory->fromWcOrder($wcOrder);
|
|
||||||
$payer = $this->payerFactory->fromCustomer($customer);
|
|
||||||
$order = $this->orderEndpoint->createForPurchaseUnits([$purchaseUnits], $payer, $token, (string) $wcOrder->get_id());
|
|
||||||
$this->captureOrder($order, $wcOrder);
|
|
||||||
} catch (\Exception $error) {
|
} catch (\Exception $error) {
|
||||||
$this->logger->log(
|
$this->logger->log(
|
||||||
'error',
|
'error',
|
||||||
|
@ -92,7 +86,28 @@ class RenewalHandler
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getTokenForCustomer(\WC_Customer $customer, \WC_Order $wcOrder) : ?PaymentToken {
|
private function processOrder(\WC_Order $wcOrder)
|
||||||
|
{
|
||||||
|
|
||||||
|
$userId = (int)$wcOrder->get_customer_id();
|
||||||
|
$customer = new \WC_Customer($userId);
|
||||||
|
$token = $this->getTokenForCustomer($customer, $wcOrder);
|
||||||
|
if (! $token) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$purchaseUnits = $this->purchaseUnitFactory->fromWcOrder($wcOrder);
|
||||||
|
$payer = $this->payerFactory->fromCustomer($customer);
|
||||||
|
$order = $this->orderEndpoint->createForPurchaseUnits(
|
||||||
|
[$purchaseUnits],
|
||||||
|
$payer,
|
||||||
|
$token,
|
||||||
|
(string) $wcOrder->get_id()
|
||||||
|
);
|
||||||
|
$this->captureOrder($order, $wcOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getTokenForCustomer(\WC_Customer $customer, \WC_Order $wcOrder): ?PaymentToken
|
||||||
|
{
|
||||||
|
|
||||||
$token = $this->repository->forUserId((int) $customer->get_id());
|
$token = $this->repository->forUserId((int) $customer->get_id());
|
||||||
if (!$token) {
|
if (!$token) {
|
||||||
|
@ -113,7 +128,8 @@ class RenewalHandler
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function captureOrder(Order $order, \WC_Order $wcOrder) {
|
private function captureOrder(Order $order, \WC_Order $wcOrder)
|
||||||
|
{
|
||||||
|
|
||||||
if ($order->intent() === 'CAPTURE') {
|
if ($order->intent() === 'CAPTURE') {
|
||||||
$order = $this->orderEndpoint->capture($order);
|
$order = $this->orderEndpoint->capture($order);
|
||||||
|
@ -122,14 +138,14 @@ class RenewalHandler
|
||||||
'processing',
|
'processing',
|
||||||
__('Payment received.', 'woocommerce-paypal-commerce-gateway')
|
__('Payment received.', 'woocommerce-paypal-commerce-gateway')
|
||||||
);
|
);
|
||||||
\WC_Subscriptions_Manager::process_subscription_payments_on_order( $wcOrder );
|
\WC_Subscriptions_Manager::process_subscription_payments_on_order($wcOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($order->intent() === 'AUTHORIZE') {
|
if ($order->intent() === 'AUTHORIZE') {
|
||||||
$this->orderEndpoint->authorize($order);
|
$this->orderEndpoint->authorize($order);
|
||||||
$wcOrder->update_meta_data(WcGateway::CAPTURED_META_KEY, 'false');
|
$wcOrder->update_meta_data(WcGateway::CAPTURED_META_KEY, 'false');
|
||||||
\WC_Subscriptions_Manager::process_subscription_payments_on_order( $wcOrder );
|
\WC_Subscriptions_Manager::process_subscription_payments_on_order($wcOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Inpsyde\PayPalCommerce\Subscription\Repository;
|
namespace Inpsyde\PayPalCommerce\Subscription\Repository;
|
||||||
|
|
||||||
|
|
||||||
use Inpsyde\PayPalCommerce\ApiClient\Endpoint\PaymentTokenEndpoint;
|
use Inpsyde\PayPalCommerce\ApiClient\Endpoint\PaymentTokenEndpoint;
|
||||||
use Inpsyde\PayPalCommerce\ApiClient\Entity\PaymentToken;
|
use Inpsyde\PayPalCommerce\ApiClient\Entity\PaymentToken;
|
||||||
use Inpsyde\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
use Inpsyde\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||||
|
@ -18,13 +18,13 @@ class PaymentTokenRepository
|
||||||
public function __construct(
|
public function __construct(
|
||||||
PaymentTokenFactory $factory,
|
PaymentTokenFactory $factory,
|
||||||
PaymentTokenEndpoint $endpoint
|
PaymentTokenEndpoint $endpoint
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$this->factory = $factory;
|
$this->factory = $factory;
|
||||||
$this->endpoint = $endpoint;
|
$this->endpoint = $endpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forUserId(int $id) : ?PaymentToken
|
public function forUserId(int $id): ?PaymentToken
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$token = (array) get_user_meta($id, self::USER_META, true);
|
$token = (array) get_user_meta($id, self::USER_META, true);
|
||||||
|
@ -39,13 +39,14 @@ class PaymentTokenRepository
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteToken(int $userId, PaymentToken $token) : bool
|
public function deleteToken(int $userId, PaymentToken $token): bool
|
||||||
{
|
{
|
||||||
delete_user_meta($userId, self::USER_META);
|
delete_user_meta($userId, self::USER_META);
|
||||||
return $this->endpoint->deleteToken($token);
|
return $this->endpoint->deleteToken($token);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function fetchForUserId(int $id) : PaymentToken {
|
private function fetchForUserId(int $id): PaymentToken
|
||||||
|
{
|
||||||
|
|
||||||
$tokens = $this->endpoint->forUser($id);
|
$tokens = $this->endpoint->forUser($id);
|
||||||
$token = current($tokens);
|
$token = current($tokens);
|
||||||
|
@ -53,4 +54,4 @@ class PaymentTokenRepository
|
||||||
update_user_meta($id, self::USER_META, $tokenArray);
|
update_user_meta($id, self::USER_META, $tokenArray);
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,5 @@ class SubscriptionModule implements ModuleInterface
|
||||||
10,
|
10,
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,7 @@ class SettingsListener
|
||||||
}
|
}
|
||||||
|
|
||||||
//phpcs:disable Inpsyde.CodeQuality.NestingLevel.MaxExceeded
|
//phpcs:disable Inpsyde.CodeQuality.NestingLevel.MaxExceeded
|
||||||
|
//phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||||
private function retrieveSettingsFromRawData(array $rawData): array
|
private function retrieveSettingsFromRawData(array $rawData): array
|
||||||
{
|
{
|
||||||
$settings = [];
|
$settings = [];
|
||||||
|
@ -117,6 +118,7 @@ class SettingsListener
|
||||||
return $settings;
|
return $settings;
|
||||||
}
|
}
|
||||||
//phpcs:enable Inpsyde.CodeQuality.NestingLevel.MaxExceeded
|
//phpcs:enable Inpsyde.CodeQuality.NestingLevel.MaxExceeded
|
||||||
|
//phpcs:enable Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||||
|
|
||||||
private function isValidUpdateRequest(): bool
|
private function isValidUpdateRequest(): bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,8 +8,8 @@ use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class CheckoutOrderCompleted implements RequestHandler
|
class CheckoutOrderCompleted implements RequestHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
use PrefixTrait;
|
use PrefixTrait;
|
||||||
|
|
||||||
private $logger;
|
private $logger;
|
||||||
public function __construct(LoggerInterface $logger, string $prefix)
|
public function __construct(LoggerInterface $logger, string $prefix)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,8 +9,8 @@ use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class PaymentCaptureCompleted implements RequestHandler
|
class PaymentCaptureCompleted implements RequestHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
use PrefixTrait;
|
use PrefixTrait;
|
||||||
|
|
||||||
private $logger;
|
private $logger;
|
||||||
public function __construct(LoggerInterface $logger, string $prefix)
|
public function __construct(LoggerInterface $logger, string $prefix)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,8 @@ class PaymentCaptureCompleted implements RequestHandler
|
||||||
public function handleRequest(\WP_REST_Request $request): \WP_REST_Response
|
public function handleRequest(\WP_REST_Request $request): \WP_REST_Response
|
||||||
{
|
{
|
||||||
$response = ['success' => false];
|
$response = ['success' => false];
|
||||||
$orderId = isset($request['resource']['custom_id']) ? $this->sanitizeCustomId($request['resource']['custom_id']) : 0;
|
$orderId = isset($request['resource']['custom_id']) ?
|
||||||
|
$this->sanitizeCustomId($request['resource']['custom_id']) : 0;
|
||||||
if (! $orderId) {
|
if (! $orderId) {
|
||||||
$message = sprintf(
|
$message = sprintf(
|
||||||
// translators: %s is the PayPal webhook Id.
|
// translators: %s is the PayPal webhook Id.
|
||||||
|
|
|
@ -8,8 +8,8 @@ use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class PaymentCaptureRefunded implements RequestHandler
|
class PaymentCaptureRefunded implements RequestHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
use PrefixTrait;
|
use PrefixTrait;
|
||||||
|
|
||||||
private $logger;
|
private $logger;
|
||||||
public function __construct(LoggerInterface $logger, string $prefix)
|
public function __construct(LoggerInterface $logger, string $prefix)
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,8 @@ class PaymentCaptureRefunded implements RequestHandler
|
||||||
public function handleRequest(\WP_REST_Request $request): \WP_REST_Response
|
public function handleRequest(\WP_REST_Request $request): \WP_REST_Response
|
||||||
{
|
{
|
||||||
$response = ['success' => false];
|
$response = ['success' => false];
|
||||||
$orderId = isset($request['resource']['custom_id']) ? $this->sanitizeCustomId($request['resource']['custom_id']) : 0;
|
$orderId = isset($request['resource']['custom_id']) ?
|
||||||
|
$this->sanitizeCustomId($request['resource']['custom_id']) : 0;
|
||||||
if (! $orderId) {
|
if (! $orderId) {
|
||||||
$message = sprintf(
|
$message = sprintf(
|
||||||
// translators: %s is the PayPal webhook Id.
|
// translators: %s is the PayPal webhook Id.
|
||||||
|
|
|
@ -8,8 +8,8 @@ use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class PaymentCaptureReversed implements RequestHandler
|
class PaymentCaptureReversed implements RequestHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
use PrefixTrait;
|
use PrefixTrait;
|
||||||
|
|
||||||
private $logger;
|
private $logger;
|
||||||
public function __construct(LoggerInterface $logger, string $prefix)
|
public function __construct(LoggerInterface $logger, string $prefix)
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,8 @@ class PaymentCaptureReversed implements RequestHandler
|
||||||
public function handleRequest(\WP_REST_Request $request): \WP_REST_Response
|
public function handleRequest(\WP_REST_Request $request): \WP_REST_Response
|
||||||
{
|
{
|
||||||
$response = ['success' => false];
|
$response = ['success' => false];
|
||||||
$orderId = isset($request['resource']['custom_id']) ? $this->sanitizeCustomId($request['resource']['custom_id']) : 0;
|
$orderId = isset($request['resource']['custom_id']) ?
|
||||||
|
$this->sanitizeCustomId($request['resource']['custom_id']) : 0;
|
||||||
if (! $orderId) {
|
if (! $orderId) {
|
||||||
$message = sprintf(
|
$message = sprintf(
|
||||||
// translators: %s is the PayPal webhook Id.
|
// translators: %s is the PayPal webhook Id.
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Inpsyde\PayPalCommerce\Webhooks\Handler;
|
namespace Inpsyde\PayPalCommerce\Webhooks\Handler;
|
||||||
|
|
||||||
|
|
||||||
trait PrefixTrait
|
trait PrefixTrait
|
||||||
{
|
{
|
||||||
|
|
||||||
private $prefix = '';
|
private $prefix = '';
|
||||||
|
|
||||||
private function sanitizeCustomId(string $customId) : int {
|
private function sanitizeCustomId(string $customId): int
|
||||||
|
{
|
||||||
|
|
||||||
$orderId = str_replace($this->prefix, '', $customId);
|
$orderId = str_replace($this->prefix, '', $customId);
|
||||||
return (int) $orderId;
|
return (int) $orderId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue