From 13e04b009c814649ab051c5598850d5a225ad1f2 Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 27 Apr 2022 23:50:23 +0300 Subject: [PATCH] Fix const name --- .../ppcp-api-client/src/Factory/AmountFactory.php | 2 +- modules/ppcp-vaulting/src/PaymentTokenChecker.php | 2 +- .../ppcp-wc-gateway/src/Gateway/PayPalGateway.php | 12 ++++++------ .../ppcp-wc-gateway/src/Processor/OrderMetaTrait.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/ppcp-api-client/src/Factory/AmountFactory.php b/modules/ppcp-api-client/src/Factory/AmountFactory.php index bf9637c32..d0079f1a9 100644 --- a/modules/ppcp-api-client/src/Factory/AmountFactory.php +++ b/modules/ppcp-api-client/src/Factory/AmountFactory.php @@ -127,7 +127,7 @@ class AmountFactory { $total_value = (float) $order->get_total(); if ( ( CreditCardGateway::ID === $order->get_payment_method() - || ( PayPalGateway::ID === $order->get_payment_method() && 'card' === $order->get_meta( PayPalGateway::ORDER_PAYMENT_SOURCE ) ) + || ( PayPalGateway::ID === $order->get_payment_method() && 'card' === $order->get_meta( PayPalGateway::ORDER_PAYMENT_SOURCE_META_KEY ) ) ) && $this->is_free_trial_order( $order ) ) { diff --git a/modules/ppcp-vaulting/src/PaymentTokenChecker.php b/modules/ppcp-vaulting/src/PaymentTokenChecker.php index 45cdae20c..604c7cc37 100644 --- a/modules/ppcp-vaulting/src/PaymentTokenChecker.php +++ b/modules/ppcp-vaulting/src/PaymentTokenChecker.php @@ -119,7 +119,7 @@ class PaymentTokenChecker { try { if ( $this->is_free_trial_order( $wc_order ) ) { if ( CreditCardGateway::ID === $wc_order->get_payment_method() - || ( PayPalGateway::ID === $wc_order->get_payment_method() && 'card' === $wc_order->get_meta( PayPalGateway::ORDER_PAYMENT_SOURCE ) ) + || ( PayPalGateway::ID === $wc_order->get_payment_method() && 'card' === $wc_order->get_meta( PayPalGateway::ORDER_PAYMENT_SOURCE_META_KEY ) ) ) { $order = $this->order_repository->for_wc_order( $wc_order ); $this->authorized_payments_processor->void_authorizations( $order ); diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php index 5c959d388..d3ddf21f8 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php @@ -33,12 +33,12 @@ class PayPalGateway extends \WC_Payment_Gateway { use ProcessPaymentTrait; - const ID = 'ppcp-gateway'; - const INTENT_META_KEY = '_ppcp_paypal_intent'; - const ORDER_ID_META_KEY = '_ppcp_paypal_order_id'; - const ORDER_PAYMENT_MODE_META_KEY = '_ppcp_paypal_payment_mode'; - const ORDER_PAYMENT_SOURCE = '_ppcp_paypal_payment_source'; - const FEES_META_KEY = '_ppcp_paypal_fees'; + const ID = 'ppcp-gateway'; + const INTENT_META_KEY = '_ppcp_paypal_intent'; + const ORDER_ID_META_KEY = '_ppcp_paypal_order_id'; + const ORDER_PAYMENT_MODE_META_KEY = '_ppcp_paypal_payment_mode'; + const ORDER_PAYMENT_SOURCE_META_KEY = '_ppcp_paypal_payment_source'; + const FEES_META_KEY = '_ppcp_paypal_fees'; /** * The Settings Renderer. diff --git a/modules/ppcp-wc-gateway/src/Processor/OrderMetaTrait.php b/modules/ppcp-wc-gateway/src/Processor/OrderMetaTrait.php index 4aad635a4..3a9049bbd 100644 --- a/modules/ppcp-wc-gateway/src/Processor/OrderMetaTrait.php +++ b/modules/ppcp-wc-gateway/src/Processor/OrderMetaTrait.php @@ -39,7 +39,7 @@ trait OrderMetaTrait { ); $payment_source = $this->get_payment_source( $order ); if ( $payment_source ) { - $wc_order->update_meta_data( PayPalGateway::ORDER_PAYMENT_SOURCE, $payment_source ); + $wc_order->update_meta_data( PayPalGateway::ORDER_PAYMENT_SOURCE_META_KEY, $payment_source ); } }