add ID to WcGateway

This commit is contained in:
David Remer 2020-07-02 14:36:48 +03:00
parent 68708607f4
commit 45348788a3

View file

@ -21,9 +21,10 @@ use Psr\Container\ContainerInterface;
//phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps //phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
//phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType //phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType
class WcGateway extends WcGatewayBase class WcGateway extends \WC_Payment_Gateway
{ {
public const ID = 'ppcp-gateway';
public const CAPTURED_META_KEY = '_ppcp_paypal_captured'; public const CAPTURED_META_KEY = '_ppcp_paypal_captured';
public const INTENT_META_KEY = '_ppcp_paypal_intent'; public const INTENT_META_KEY = '_ppcp_paypal_intent';
public const ORDER_ID_META_KEY = '_ppcp_paypal_order_id'; public const ORDER_ID_META_KEY = '_ppcp_paypal_order_id';
@ -42,6 +43,7 @@ class WcGateway extends WcGatewayBase
ContainerInterface $config ContainerInterface $config
) { ) {
$this->id = self::ID;
$this->orderProcessor = $orderProcessor; $this->orderProcessor = $orderProcessor;
$this->authorizedPayments = $authorizedPayments; $this->authorizedPayments = $authorizedPayments;
$this->notice = $notice; $this->notice = $notice;
@ -53,9 +55,6 @@ class WcGateway extends WcGatewayBase
'Provide your customers with the PayPal payment system', 'Provide your customers with the PayPal payment system',
'woocommerce-paypal-gateway' 'woocommerce-paypal-gateway'
); );
parent::__construct();
$this->title = $this->config->has('title') ? $this->config->get('title') : $this->method_title; $this->title = $this->config->has('title') ? $this->config->get('title') : $this->method_title;
$this->description = $this->config->has('description') ? $this->config->get('description') : $this->method_description; $this->description = $this->config->has('description') ? $this->config->get('description') : $this->method_description;