From 3d14fefb73b0d21d1db2fedb92590be633c4627f Mon Sep 17 00:00:00 2001 From: Nirmal Date: Mon, 18 Nov 2024 07:54:31 +0530 Subject: [PATCH 1/2] Payment method Specifies Credit Card or PayPal --- paypal-for-woocommerce.php | 3 ++- ppcp-gateway/class-angelleye-paypal-ppcp-payment.php | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/paypal-for-woocommerce.php b/paypal-for-woocommerce.php index 03480e8df..2e17efe88 100644 --- a/paypal-for-woocommerce.php +++ b/paypal-for-woocommerce.php @@ -85,7 +85,8 @@ private function define_constants() { 'PAYPAL_FOR_WOOCOMMERCE_PPCP_AWS_WEB_SERVICE' => 'https://zpyql2kd39.execute-api.us-east-2.amazonaws.com/production/PayPalMerchantIntegration/', 'PAYPAL_FOR_WOOCOMMERCE_PPCP_ANGELLEYE_WEB_SERVICE' => 'https://ppcp.angelleye.com/production/PayPalMerchantIntegration/', 'AE_FEE' => 'ae_p_f', - 'AE_PPCP_NAME' => 'PayPal Complete Payments' + 'AE_PPCP_NAME' => 'PayPal Complete Payments', + 'AE_PPCP_CC' => 'Credit or Debit Card', ]; foreach ($constants as $key => $value) { diff --git a/ppcp-gateway/class-angelleye-paypal-ppcp-payment.php b/ppcp-gateway/class-angelleye-paypal-ppcp-payment.php index 988e0d1fd..eb675e3a1 100644 --- a/ppcp-gateway/class-angelleye-paypal-ppcp-payment.php +++ b/ppcp-gateway/class-angelleye-paypal-ppcp-payment.php @@ -89,6 +89,7 @@ public function __construct() { $this->partner_client_id = PAYPAL_PPCP_PARTNER_CLIENT_ID; } $this->title = $this->setting_obj->get('title', sprintf('%s - Built by Angelleye', AE_PPCP_NAME)); + $this->titles = $this->setting_obj->get('titles', AE_PPCP_CC); $this->brand_name = $this->setting_obj->get('brand_name', get_bloginfo('name')); $this->paymentaction = $this->setting_obj->get('paymentaction', 'capture'); $this->paymentstatus = $this->setting_obj->get('paymentstatus', 'wc-default'); @@ -1143,7 +1144,11 @@ public function get_set_payment_method_title_from_session($woo_order_id = null) $order->set_payment_method_title($angelleye_ppcp_payment_method_title); $order->save(); } else { - $angelleye_ppcp_payment_method_title = $this->title; + if (is_null($angelleye_ppcp_payment_method_title) && $payment_method_id == 'angelleye_ppcp_cc'){ + $angelleye_ppcp_payment_method_title = $this->titles; + } else { + $angelleye_ppcp_payment_method_title = $this->title; + } } return $angelleye_ppcp_payment_method_title; } From f597d651b83744979113a568ae48c88f589a8c51 Mon Sep 17 00:00:00 2001 From: Nirmal Date: Wed, 20 Nov 2024 16:36:54 +0530 Subject: [PATCH 2/2] Handled titles is deprecated warning --- ppcp-gateway/class-angelleye-paypal-ppcp-payment.php | 1 + 1 file changed, 1 insertion(+) diff --git a/ppcp-gateway/class-angelleye-paypal-ppcp-payment.php b/ppcp-gateway/class-angelleye-paypal-ppcp-payment.php index eb675e3a1..c7ae0cb9f 100644 --- a/ppcp-gateway/class-angelleye-paypal-ppcp-payment.php +++ b/ppcp-gateway/class-angelleye-paypal-ppcp-payment.php @@ -32,6 +32,7 @@ class AngellEYE_PayPal_PPCP_Payment { public $merchant_id; public $partner_client_id; public $title; + public $titles; public $brand_name; public $paymentaction; public $paymentstatus;