diff --git a/modules/ppcp-applepay/services.php b/modules/ppcp-applepay/services.php index 76de2150d..0b9c15372 100644 --- a/modules/ppcp-applepay/services.php +++ b/modules/ppcp-applepay/services.php @@ -299,7 +299,7 @@ return array( esc_html( $button_text ) ); }, - 'applepay.wc-gateway' => static function ( ContainerInterface $container ): ApplePayGateway { + 'applepay.wc-gateway' => static function ( ContainerInterface $container ): ApplePayGateway { return new ApplePayGateway( $container->get( 'wcgateway.order-processor' ), $container->get( 'api.factory.paypal-checkout-url' ), diff --git a/modules/ppcp-axo/src/AxoModule.php b/modules/ppcp-axo/src/AxoModule.php index 9b5a6985d..e0398e506 100644 --- a/modules/ppcp-axo/src/AxoModule.php +++ b/modules/ppcp-axo/src/AxoModule.php @@ -78,7 +78,7 @@ class AxoModule implements ModuleInterface { assert( $settings instanceof Settings ); $is_paypal_enabled = $settings->has( 'enabled' ) && $settings->get( 'enabled' ) ?? false; - $is_dcc_enabled = $settings->has( 'dcc_enabled' ) && $settings->get( 'dcc_enabled' ) ?? false; + $is_dcc_enabled = $settings->has( 'dcc_enabled' ) && $settings->get( 'dcc_enabled' ) ?? false; if ( ! $is_paypal_enabled || ! $is_dcc_enabled ) { return $methods; diff --git a/modules/ppcp-local-alternative-payment-methods/src/BancontactGateway.php b/modules/ppcp-local-alternative-payment-methods/src/BancontactGateway.php index 8b89ba8fd..54204d12d 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/BancontactGateway.php +++ b/modules/ppcp-local-alternative-payment-methods/src/BancontactGateway.php @@ -73,7 +73,7 @@ class BancontactGateway extends WC_Payment_Gateway { 'products', ); - $this->method_title = __( 'Bancontact', 'woocommerce-paypal-payments' ); + $this->method_title = __( 'Bancontact (via PayPal)', 'woocommerce-paypal-payments' ); $this->method_description = __( 'A popular and trusted electronic payment method in Belgium, used by Belgian customers with Bancontact cards issued by local banks. Transactions are processed in EUR.', 'woocommerce-paypal-payments' ); $this->title = $this->get_option( 'title', __( 'Bancontact', 'woocommerce-paypal-payments' ) ); diff --git a/modules/ppcp-local-alternative-payment-methods/src/BancontactPaymentMethod.php b/modules/ppcp-local-alternative-payment-methods/src/BancontactPaymentMethod.php index d26285df7..94b6cba48 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/BancontactPaymentMethod.php +++ b/modules/ppcp-local-alternative-payment-methods/src/BancontactPaymentMethod.php @@ -91,7 +91,7 @@ class BancontactPaymentMethod extends AbstractPaymentMethodType { 'id' => $this->name, 'title' => $this->gateway->title, 'description' => $this->gateway->description, - 'icon' => esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_bancontact_color.svg' ), + 'icon' => 'bancontact', ); } } diff --git a/modules/ppcp-local-alternative-payment-methods/src/BlikGateway.php b/modules/ppcp-local-alternative-payment-methods/src/BlikGateway.php index c8cba7ca5..1538f3f83 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/BlikGateway.php +++ b/modules/ppcp-local-alternative-payment-methods/src/BlikGateway.php @@ -73,7 +73,7 @@ class BlikGateway extends WC_Payment_Gateway { 'products', ); - $this->method_title = __( 'Blik', 'woocommerce-paypal-payments' ); + $this->method_title = __( 'Blik (via PayPal)', 'woocommerce-paypal-payments' ); $this->method_description = __( 'A widely used mobile payment method in Poland, allowing Polish customers to pay directly via their banking apps. Transactions are processed in PLN.', 'woocommerce-paypal-payments' ); $this->title = $this->get_option( 'title', __( 'Blik', 'woocommerce-paypal-payments' ) ); diff --git a/modules/ppcp-local-alternative-payment-methods/src/BlikPaymentMethod.php b/modules/ppcp-local-alternative-payment-methods/src/BlikPaymentMethod.php index 073df2de0..de68baa85 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/BlikPaymentMethod.php +++ b/modules/ppcp-local-alternative-payment-methods/src/BlikPaymentMethod.php @@ -91,7 +91,7 @@ class BlikPaymentMethod extends AbstractPaymentMethodType { 'id' => $this->name, 'title' => $this->gateway->title, 'description' => $this->gateway->description, - 'icon' => esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_blik_color.svg' ), + 'icon' => 'blik', ); } } diff --git a/modules/ppcp-local-alternative-payment-methods/src/EPSGateway.php b/modules/ppcp-local-alternative-payment-methods/src/EPSGateway.php index 220e3bef7..a52674130 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/EPSGateway.php +++ b/modules/ppcp-local-alternative-payment-methods/src/EPSGateway.php @@ -73,7 +73,7 @@ class EPSGateway extends WC_Payment_Gateway { 'products', ); - $this->method_title = __( 'EPS', 'woocommerce-paypal-payments' ); + $this->method_title = __( 'EPS (via PayPal)', 'woocommerce-paypal-payments' ); $this->method_description = __( 'An online payment method in Austria, enabling Austrian buyers to make secure payments directly through their bank accounts. Transactions are processed in EUR.', 'woocommerce-paypal-payments' ); $this->title = $this->get_option( 'title', __( 'EPS', 'woocommerce-paypal-payments' ) ); diff --git a/modules/ppcp-local-alternative-payment-methods/src/EPSPaymentMethod.php b/modules/ppcp-local-alternative-payment-methods/src/EPSPaymentMethod.php index c00abdb7d..4848acf03 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/EPSPaymentMethod.php +++ b/modules/ppcp-local-alternative-payment-methods/src/EPSPaymentMethod.php @@ -91,7 +91,7 @@ class EPSPaymentMethod extends AbstractPaymentMethodType { 'id' => $this->name, 'title' => $this->gateway->title, 'description' => $this->gateway->description, - 'icon' => esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_eps_color.svg' ), + 'icon' => 'eps', ); } } diff --git a/modules/ppcp-local-alternative-payment-methods/src/IDealGateway.php b/modules/ppcp-local-alternative-payment-methods/src/IDealGateway.php index 5660a64a8..b799527a5 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/IDealGateway.php +++ b/modules/ppcp-local-alternative-payment-methods/src/IDealGateway.php @@ -73,7 +73,7 @@ class IDealGateway extends WC_Payment_Gateway { 'products', ); - $this->method_title = __( 'iDeal', 'woocommerce-paypal-payments' ); + $this->method_title = __( 'iDeal (via PayPal)', 'woocommerce-paypal-payments' ); $this->method_description = __( 'The most common payment method in the Netherlands, allowing Dutch buyers to pay directly through their preferred bank. Transactions are processed in EUR.', 'woocommerce-paypal-payments' ); $this->title = $this->get_option( 'title', __( 'iDeal', 'woocommerce-paypal-payments' ) ); diff --git a/modules/ppcp-local-alternative-payment-methods/src/IDealPaymentMethod.php b/modules/ppcp-local-alternative-payment-methods/src/IDealPaymentMethod.php index 7f40e90f9..03a9c02f4 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/IDealPaymentMethod.php +++ b/modules/ppcp-local-alternative-payment-methods/src/IDealPaymentMethod.php @@ -91,7 +91,7 @@ class IDealPaymentMethod extends AbstractPaymentMethodType { 'id' => $this->name, 'title' => $this->gateway->title, 'description' => $this->gateway->description, - 'icon' => esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_ideal_color.svg' ), + 'icon' => 'ideal', ); } } diff --git a/modules/ppcp-local-alternative-payment-methods/src/MultibancoGateway.php b/modules/ppcp-local-alternative-payment-methods/src/MultibancoGateway.php index a1c11dfe2..264e208a4 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/MultibancoGateway.php +++ b/modules/ppcp-local-alternative-payment-methods/src/MultibancoGateway.php @@ -18,7 +18,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Gateway\TransactionUrlProvider; use WooCommerce\PayPalCommerce\WcGateway\Processor\RefundProcessor; /** - * Class BancontactGateway + * Class MultibancoGateway */ class MultibancoGateway extends WC_Payment_Gateway { @@ -73,13 +73,13 @@ class MultibancoGateway extends WC_Payment_Gateway { 'products', ); - $this->method_title = __( 'Multibanco', 'woocommerce-paypal-payments' ); - $this->method_description = __( 'A popular and trusted electronic payment method in Belgium, used by Belgian customers with Multibanco cards issued by local banks. Transactions are processed in EUR.', 'woocommerce-paypal-payments' ); + $this->method_title = __( 'Multibanco (via PayPal)', 'woocommerce-paypal-payments' ); + $this->method_description = __( 'An online payment method in Portugal, enabling Portuguese buyers to make secure payments directly through their bank accounts. Transactions are processed in EUR.', 'woocommerce-paypal-payments' ); $this->title = $this->get_option( 'title', __( 'Multibanco', 'woocommerce-paypal-payments' ) ); $this->description = $this->get_option( 'description', '' ); - $this->icon = esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_bancontact_color.svg' ); + $this->icon = esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_multibanco_color.svg' ); $this->init_form_fields(); $this->init_settings(); diff --git a/modules/ppcp-local-alternative-payment-methods/src/MultibancoPaymentMethod.php b/modules/ppcp-local-alternative-payment-methods/src/MultibancoPaymentMethod.php index 8e8df71d2..556badc3f 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/MultibancoPaymentMethod.php +++ b/modules/ppcp-local-alternative-payment-methods/src/MultibancoPaymentMethod.php @@ -12,7 +12,7 @@ namespace WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods; use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType; /** - * Class BancontactPaymentMethod + * Class MultibancoPaymentMethod */ class MultibancoPaymentMethod extends AbstractPaymentMethodType { @@ -33,7 +33,7 @@ class MultibancoPaymentMethod extends AbstractPaymentMethodType { /** * Multibanco WC gateway. * - * @var BancontactGateway + * @var MultibancoGateway */ private $gateway; @@ -91,7 +91,7 @@ class MultibancoPaymentMethod extends AbstractPaymentMethodType { 'id' => $this->name, 'title' => $this->gateway->title, 'description' => $this->gateway->description, - 'icon' => esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_bancontact_color.svg' ), + 'icon' => 'multibanco', ); } } diff --git a/modules/ppcp-local-alternative-payment-methods/src/MyBankGateway.php b/modules/ppcp-local-alternative-payment-methods/src/MyBankGateway.php index d7296e5ce..710e4d5b8 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/MyBankGateway.php +++ b/modules/ppcp-local-alternative-payment-methods/src/MyBankGateway.php @@ -73,7 +73,7 @@ class MyBankGateway extends WC_Payment_Gateway { 'products', ); - $this->method_title = __( 'MyBank', 'woocommerce-paypal-payments' ); + $this->method_title = __( 'MyBank (via PayPal)', 'woocommerce-paypal-payments' ); $this->method_description = __( 'A European online banking payment solution primarily used in Italy, enabling customers to make secure bank transfers during checkout. Transactions are processed in EUR.', 'woocommerce-paypal-payments' ); $this->title = $this->get_option( 'title', __( 'MyBank', 'woocommerce-paypal-payments' ) ); diff --git a/modules/ppcp-local-alternative-payment-methods/src/MyBankPaymentMethod.php b/modules/ppcp-local-alternative-payment-methods/src/MyBankPaymentMethod.php index 132f918ac..b3bb2d515 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/MyBankPaymentMethod.php +++ b/modules/ppcp-local-alternative-payment-methods/src/MyBankPaymentMethod.php @@ -91,7 +91,7 @@ class MyBankPaymentMethod extends AbstractPaymentMethodType { 'id' => $this->name, 'title' => $this->gateway->title, 'description' => $this->gateway->description, - 'icon' => esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_mybank_color.svg' ), + 'icon' => 'mybank', ); } } diff --git a/modules/ppcp-local-alternative-payment-methods/src/P24Gateway.php b/modules/ppcp-local-alternative-payment-methods/src/P24Gateway.php index 0d79dd862..65151c31f 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/P24Gateway.php +++ b/modules/ppcp-local-alternative-payment-methods/src/P24Gateway.php @@ -73,7 +73,7 @@ class P24Gateway extends WC_Payment_Gateway { 'products', ); - $this->method_title = __( 'Przelewy24', 'woocommerce-paypal-payments' ); + $this->method_title = __( 'Przelewy24 (via PayPal)', 'woocommerce-paypal-payments' ); $this->method_description = __( 'A popular online payment gateway in Poland, offering various payment options for Polish customers. Transactions can be processed in PLN or EUR.', 'woocommerce-paypal-payments' ); $this->title = $this->get_option( 'title', __( 'Przelewy24', 'woocommerce-paypal-payments' ) ); diff --git a/modules/ppcp-local-alternative-payment-methods/src/P24PaymentMethod.php b/modules/ppcp-local-alternative-payment-methods/src/P24PaymentMethod.php index d9fe2b3b8..4cb89b393 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/P24PaymentMethod.php +++ b/modules/ppcp-local-alternative-payment-methods/src/P24PaymentMethod.php @@ -91,7 +91,7 @@ class P24PaymentMethod extends AbstractPaymentMethodType { 'id' => $this->name, 'title' => $this->gateway->title, 'description' => $this->gateway->description, - 'icon' => esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_przelewy24_color.svg' ), + 'icon' => 'p24', ); } } diff --git a/modules/ppcp-local-alternative-payment-methods/src/TrustlyGateway.php b/modules/ppcp-local-alternative-payment-methods/src/TrustlyGateway.php index 96a018166..0bc4e7e19 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/TrustlyGateway.php +++ b/modules/ppcp-local-alternative-payment-methods/src/TrustlyGateway.php @@ -73,7 +73,7 @@ class TrustlyGateway extends WC_Payment_Gateway { 'products', ); - $this->method_title = __( 'Trustly', 'woocommerce-paypal-payments' ); + $this->method_title = __( 'Trustly (via PayPal)', 'woocommerce-paypal-payments' ); $this->method_description = __( 'A European payment method that allows buyers to make payments directly from their bank accounts, suitable for customers across multiple European countries. Supported currencies include EUR, DKK, SEK, GBP, and NOK.', 'woocommerce-paypal-payments' ); $this->title = $this->get_option( 'title', __( 'Trustly', 'woocommerce-paypal-payments' ) ); diff --git a/modules/ppcp-local-alternative-payment-methods/src/TrustlyPaymentMethod.php b/modules/ppcp-local-alternative-payment-methods/src/TrustlyPaymentMethod.php index 87ba625a2..c7a501cf0 100644 --- a/modules/ppcp-local-alternative-payment-methods/src/TrustlyPaymentMethod.php +++ b/modules/ppcp-local-alternative-payment-methods/src/TrustlyPaymentMethod.php @@ -91,7 +91,7 @@ class TrustlyPaymentMethod extends AbstractPaymentMethodType { 'id' => $this->name, 'title' => $this->gateway->title, 'description' => $this->gateway->description, - 'icon' => esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_trustly_color.svg' ), + 'icon' => 'trustly', ); } } diff --git a/modules/ppcp-wc-gateway/src/Processor/PaymentsStatusHandlingTrait.php b/modules/ppcp-wc-gateway/src/Processor/PaymentsStatusHandlingTrait.php index a9a363386..22ad3c5df 100644 --- a/modules/ppcp-wc-gateway/src/Processor/PaymentsStatusHandlingTrait.php +++ b/modules/ppcp-wc-gateway/src/Processor/PaymentsStatusHandlingTrait.php @@ -34,26 +34,26 @@ trait PaymentsStatusHandlingTrait { Order $order, WC_Order $wc_order ): void { - if ($order->intent() === 'CAPTURE') { - $purchase_units = $order->purchase_units(); - - if (!empty($purchase_units) && isset($purchase_units[0])) { - $payments = $purchase_units[0]->payments(); - - if ($payments && !empty($payments->captures())) { - $this->handle_capture_status($payments->captures()[0], $wc_order); - } - } - } elseif ($order->intent() === 'AUTHORIZE') { - $purchase_units = $order->purchase_units(); - - if (!empty($purchase_units) && isset($purchase_units[0])) { - $payments = $purchase_units[0]->payments(); - - if ($payments && !empty($payments->authorizations())) { - $this->handle_authorization_status($payments->authorizations()[0], $wc_order); - } - } + if ( $order->intent() === 'CAPTURE' ) { + $purchase_units = $order->purchase_units(); + + if ( ! empty( $purchase_units ) && isset( $purchase_units[0] ) ) { + $payments = $purchase_units[0]->payments(); + + if ( $payments && ! empty( $payments->captures() ) ) { + $this->handle_capture_status( $payments->captures()[0], $wc_order ); + } + } + } elseif ( $order->intent() === 'AUTHORIZE' ) { + $purchase_units = $order->purchase_units(); + + if ( ! empty( $purchase_units ) && isset( $purchase_units[0] ) ) { + $payments = $purchase_units[0]->payments(); + + if ( $payments && ! empty( $payments->authorizations() ) ) { + $this->handle_authorization_status( $payments->authorizations()[0], $wc_order ); + } + } } }