diff --git a/upload/admin/controller/payment/payfort_fort.php b/upload/admin/controller/payment/payfort_fort.php index 632e095..7e27536 100644 --- a/upload/admin/controller/payment/payfort_fort.php +++ b/upload/admin/controller/payment/payfort_fort.php @@ -85,8 +85,10 @@ public function index() { $data['entry_naps'] = $this->language->get('entry_naps'); $data['entry_credit_card'] = $this->language->get('entry_credit_card'); $data['entry_cc_integration_type'] = $this->language->get('entry_cc_integration_type'); + $data['entry_cc_mada_branding'] = $this->language->get('entry_cc_mada_branding'); $data['entry_installments_integration_type'] = $this->language->get('entry_installments_integration_type'); $data['help_cc_integration_type'] = $this->language->get('help_cc_integration_type'); + $data['help_cc_mada_branding'] = $this->language->get('help_cc_mada_branding'); $data['help_installments_integration_type'] = $this->language->get('help_installments_integration_type'); $data['text_merchant_page'] = $this->language->get('text_merchant_page'); $data['text_merchant_page2'] = $this->language->get('text_merchant_page2'); @@ -100,6 +102,8 @@ public function index() { $data['text_front_currency'] = $this->language->get('text_front_currency'); $data['help_gateway_currency'] = $this->language->get('help_gateway_currency'); $data['text_store_language'] = $this->language->get('text_store_language'); + $data['text_cc_with_mada'] = $this->language->get('text_cc_with_mada'); + $data['button_save'] = $this->language->get('button_save'); $data['button_cancel'] = $this->language->get('button_cancel'); @@ -281,6 +285,12 @@ public function index() { $data['payfort_fort_cc_integration_type'] = $this->config->get('payfort_fort_cc_integration_type'); } + if (isset($this->request->post['payfort_fort_cc_mada_branding'])) { + $data['payfort_fort_cc_mada_branding'] = $this->request->post['payfort_fort_cc_mada_branding']; + } else { + $data['payfort_fort_cc_mada_branding'] = $this->config->get('payfort_fort_cc_mada_branding'); + } + if (isset($this->request->post['payfort_fort_status'])) { $data['payfort_fort_status'] = $this->request->post['payfort_fort_status']; } else { diff --git a/upload/admin/language/arabic/payment/payfort_fort.php b/upload/admin/language/arabic/payment/payfort_fort.php index 14759a1..71bd6af 100644 --- a/upload/admin/language/arabic/payment/payfort_fort.php +++ b/upload/admin/language/arabic/payment/payfort_fort.php @@ -20,6 +20,7 @@ $_['text_merchant_page2'] = 'Merchant Page 2.0'; $_['text_store_language'] = 'Store Language'; + $_['entry_merchant_identifier'] = 'معرف التاجر'; $_['entry_purchase'] = 'شراء'; $_['entry_authorization'] = 'تخويل'; @@ -38,12 +39,14 @@ $_['entry_request_sha_phrase'] = 'عبارة طلب تشفير (SHA)'; $_['entry_response_sha_phrase'] = 'عبارة رد تشفير (SHA)'; $_['entry_cc_integration_type'] = 'Integration Type'; +$_['entry_cc_mada_branding'] = 'mada option'; $_['entry_installments_integration_type'] = 'Integration Type'; $_['entry_debug'] = 'Debug mode:'; $_['entry_gateway_currency'] = 'Gateway Currency'; $_['text_base_currency'] = 'Base Currency'; $_['text_front_currency'] = 'Front Currency'; $_['help_gateway_currency'] = 'The Currency should be sent to payment gateway.'; +$_['help_cc_mada_branding'] = 'تفعيل بطاقة مدى البنكية في المتجر'; $_['entry_order_placement'] = 'Order Placement'; $_['text_on_success'] = 'On Success'; diff --git a/upload/admin/language/english/payment/payfort_fort.php b/upload/admin/language/english/payment/payfort_fort.php index 1acc29a..b450aea 100644 --- a/upload/admin/language/english/payment/payfort_fort.php +++ b/upload/admin/language/english/payment/payfort_fort.php @@ -38,12 +38,15 @@ $_['entry_request_sha_phrase'] = 'Request SHA Phrase'; $_['entry_response_sha_phrase'] = 'Response SHA Phrase'; $_['entry_cc_integration_type'] = 'Integration Type'; +$_['entry_cc_mada_branding'] = 'Mada option'; $_['entry_installments_integration_type'] = 'Integration Type'; $_['entry_debug'] = 'Debug mode:'; $_['entry_gateway_currency'] = 'Gateway Currency'; $_['text_base_currency'] = 'Base Currency'; $_['text_front_currency'] = 'Front Currency'; $_['help_gateway_currency'] = 'The Currency should be sent to payment gateway.'; +$_['help_cc_mada_branding'] = 'Enables mada bank card in store view'; + $_['entry_order_placement'] = 'Order Placement'; $_['text_on_success'] = 'On Success'; diff --git a/upload/admin/view/template/payment/payfort_fort.tpl b/upload/admin/view/template/payment/payfort_fort.tpl index da050db..6d66213 100644 --- a/upload/admin/view/template/payment/payfort_fort.tpl +++ b/upload/admin/view/template/payment/payfort_fort.tpl @@ -205,6 +205,17 @@ + +
+ +
+ +
+
+
diff --git a/upload/catalog/controller/payment/payfort_fort.php b/upload/catalog/controller/payment/payfort_fort.php index 55e1806..b965f72 100644 --- a/upload/catalog/controller/payment/payfort_fort.php +++ b/upload/catalog/controller/payment/payfort_fort.php @@ -10,6 +10,7 @@ class ControllerPaymentPayfortFort extends Controller { public $pfPayment; public $pfHelper; public $pfOrder; + public $madaBranding; public function __construct($registry) { @@ -19,6 +20,7 @@ public function __construct($registry) $this->pfHelper = Payfort_Fort_Helper::getInstance($registry); $this->pfOrder = new Payfort_Fort_Order($registry); $this->integrationType = $this->pfConfig->getCcIntegrationType(); + $this->madaBranding = $this->pfConfig->getCcMadaBranding(); $this->paymentMethod = PAYFORT_FORT_PAYMENT_METHOD_CC; } @@ -33,7 +35,17 @@ public function index() { //$this->load->model('setting/setting'); $data['payfort_fort_cc_integration_type'] = $this->integrationType; - + $frontCurrency = $this->pfHelper->getFrontCurrency(); + $baseCurrency = $this->pfHelper->getBaseCurrency(); + $currency = $this->pfHelper->getFortCurrency($baseCurrency, $frontCurrency); + if ($currency == 'SAR') { + $data['payfort_fort_cc_mada_branding'] = $this->madaBranding; + } + else + { + $data['payfort_fort_cc_mada_branding'] = 'Disabled'; + } + $this->load->model('payment/payfort_fort'); $data['payment_request_params'] = ''; $template = 'payfort_fort.tpl'; @@ -47,6 +59,7 @@ public function index() { $data['payment_request_params'] = $this->pfPayment->getPaymentRequestParams($this->paymentMethod, $this->integrationType); $data['text_credit_card'] = $this->language->get('text_credit_card'); + $data['text_cc_with_mada'] = $this->language->get('text_cc_with_mada'); $data['text_card_holder_name'] = $this->language->get('text_card_holder_name'); $data['text_card_number'] = $this->language->get('text_card_number'); $data['text_expiry_date'] = $this->language->get('text_expiry_date'); diff --git a/upload/catalog/language/arabic/payment/payfort_fort.php b/upload/catalog/language/arabic/payment/payfort_fort.php index 5d77d9d..6f4770a 100644 --- a/upload/catalog/language/arabic/payment/payfort_fort.php +++ b/upload/catalog/language/arabic/payment/payfort_fort.php @@ -4,6 +4,7 @@ $_['text_title'] = 'بطاقة ائتمان'; $_['text_wait'] = 'يرجى الانتظار'; $_['text_credit_card'] = 'تفاصيل بطاقة الائتمان'; +$_['text_cc_with_mada'] = 'بطاقة الائتمان / بطاقة مدى البنكية'; $_['text_loading'] = 'جاري التحميل'; $_['heading_failed_title'] = 'فشلت عملية الدفع!'; $_['heading_success_title'] = 'تمت عملية الدفع بنجاح'; diff --git a/upload/catalog/language/english/payment/payfort_fort.php b/upload/catalog/language/english/payment/payfort_fort.php index 9607eef..6663549 100644 --- a/upload/catalog/language/english/payment/payfort_fort.php +++ b/upload/catalog/language/english/payment/payfort_fort.php @@ -4,6 +4,7 @@ $_['text_title'] = 'Credit / Debit Card'; $_['text_wait'] = 'Please wait!'; $_['text_credit_card'] = 'Credit Card Details'; +$_['text_cc_with_mada'] = 'Credit Card / mada Bank Card Details'; $_['text_loading'] = 'Loading'; $_['heading_failed_title'] = 'Payment Failed!'; $_['heading_success_title'] = 'Your Order Has Been Processed!'; diff --git a/upload/catalog/view/theme/default/image/payfort_mada.jpeg b/upload/catalog/view/theme/default/image/payfort_mada.jpeg new file mode 100644 index 0000000..7e563c9 Binary files /dev/null and b/upload/catalog/view/theme/default/image/payfort_mada.jpeg differ diff --git a/upload/catalog/view/theme/default/image/payfort_mastercard.jpeg b/upload/catalog/view/theme/default/image/payfort_mastercard.jpeg new file mode 100644 index 0000000..b354dad Binary files /dev/null and b/upload/catalog/view/theme/default/image/payfort_mastercard.jpeg differ diff --git a/upload/catalog/view/theme/default/image/payfort_visa.png b/upload/catalog/view/theme/default/image/payfort_visa.png new file mode 100644 index 0000000..217497f Binary files /dev/null and b/upload/catalog/view/theme/default/image/payfort_visa.png differ diff --git a/upload/catalog/view/theme/default/template/payment/payfort_fort_merchant_page2.tpl b/upload/catalog/view/theme/default/template/payment/payfort_fort_merchant_page2.tpl index d6122b3..d406894 100644 --- a/upload/catalog/view/theme/default/template/payment/payfort_fort_merchant_page2.tpl +++ b/upload/catalog/view/theme/default/template/payment/payfort_fort_merchant_page2.tpl @@ -4,7 +4,23 @@ $v): ?> - + + + + +
+ +
+ + mada + + visa + mc +
+
+ + +
diff --git a/upload/system/library/payfortFort/classes/Config.php b/upload/system/library/payfortFort/classes/Config.php index f0573b9..5488155 100644 --- a/upload/system/library/payfortFort/classes/Config.php +++ b/upload/system/library/payfortFort/classes/Config.php @@ -33,6 +33,7 @@ class Payfort_Fort_Config private $status; private $ccStatus; private $ccIntegrationType; + private $ccMadaBranding; private $sadadStatus; private $napsStatus; private $gatewayProdHost; @@ -62,9 +63,10 @@ public function __construct($registry) $this->debugMode = $this->_getShoppingCartConfig('debug'); $this->successOrderStatusId = $this->_getShoppingCartConfig('order_status_id'); $this->orderPlacement = $this->_getShoppingCartConfig('order_placement'); - $this->status = $this->_getShoppingCartConfig('status'); + $this->status = $this->_getShoppingCartConfig('status'); $this->ccStatus = $this->_getShoppingCartConfig('credit_card'); $this->ccIntegrationType = $this->_getShoppingCartConfig('cc_integration_type'); + $this->ccMadaBranding = $this->_getShoppingCartConfig('cc_mada_branding'); $this->sadadStatus = $this->_getShoppingCartConfig('sadad'); $this->napsStatus = $this->_getShoppingCartConfig('naps'); // installments @@ -224,6 +226,11 @@ public function getCcIntegrationType() return $this->ccIntegrationType; } + public function getCcMadaBranding() + { + return $this->ccMadaBranding; + } + public function isCcMerchantPage() { if ($this->ccIntegrationType == PAYFORT_FORT_INTEGRATION_TYPE_MERCAHNT_PAGE) {