Changeset 3320644
- Timestamp:
- 07/01/2025 01:00:42 PM (8 months ago)
- Location:
- cardgate
- Files:
-
- 6 edited
- 1 copied
-
tags/3.2.6 (copied) (copied from cardgate/trunk)
-
tags/3.2.6/cardgate.php (modified) (1 diff)
-
tags/3.2.6/classes/CGP_Common_Gateway.php (modified) (3 diffs)
-
tags/3.2.6/readme.txt (modified) (2 diffs)
-
trunk/cardgate.php (modified) (1 diff)
-
trunk/classes/CGP_Common_Gateway.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cardgate/tags/3.2.6/cardgate.php
r3305647 r3320644 7 7 * Author: CardGate 8 8 * Author URI: https://www.cardgate.com 9 * Version: 3.2. 59 * Version: 3.2.6 10 10 * Text Domain: cardgate 11 11 * Domain Path: /i18n/languages 12 12 * Requires at least: 4.4 13 13 * WC requires at least: 3.0.0 14 * WC tested up to: 9. 8.414 * WC tested up to: 9.9.5 15 15 * License: GPLv3 or later 16 16 */ -
cardgate/tags/3.2.6/classes/CGP_Common_Gateway.php
r3305647 r3320644 21 21 var $bSeperateSalesTax; 22 22 var $instructions; 23 protected $only_euro_payments = ['cardgateideal',24 'cardgateidealqr',25 'cardgatebancontact',26 'cardgatebanktransfer',27 'cardgatebillink',28 'cardgatesofortbanking',29 'cardgatedirectdebit',30 'cardgateonlineueberweisen',31 'cardgatespraypay',32 ];33 23 34 24 // //////////////////////////////////////////////// … … 47 37 48 38 /** 39 * Check if the currency is allowed for this payment method. 40 * 41 * @param $currency 42 * @param $payment_method 43 * 44 * @return bool 45 */ 46 public function check_payment_currency($currency,$payment_method) { 47 $strictly_euro = in_array($payment_method,['cardgateideal', 48 'cardgateidealqr', 49 'cardgatebancontact', 50 'cardgatebanktransfer', 51 'cardgatebillink', 52 'cardgatesofortbanking', 53 'cardgatedirectdebit', 54 'cardgateonlineueberweisen', 55 'cardgatespraypay']); 56 if ($strictly_euro && $currency != 'EUR') return false; 57 58 $strictly_pln = in_array($payment_method,['cardgateprzelewy24']); 59 if ($strictly_pln && $currency != 'PLN') return false; 60 61 return true; 62 } 63 64 /** 49 65 * Check if the gateway is available for use. 50 66 * … … 54 70 $is_available = ( 'yes' === $this->enabled ); 55 71 $site_currency = get_woocommerce_currency() ; 56 if ( WC()->cart && $site_currency !== 'EUR' && in_array($this->id, $this->only_euro_payments)) {72 if ( WC()->cart && !$this->check_payment_currency( $site_currency, $this->id ) ) { 57 73 $is_available = false; 58 74 } -
cardgate/tags/3.2.6/readme.txt
r3305647 r3320644 5 5 Requires at least: 4.4 6 6 Tested up to: 6.8 7 Stable tag: 3.2. 57 Stable tag: 3.2.6 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 75 75 == Changelog == 76 76 77 = 3.2.6 = 78 * Added: Currency check 79 77 80 = 3.2.5 = 78 81 * Restrict payment methods by currency -
cardgate/trunk/cardgate.php
r3305647 r3320644 7 7 * Author: CardGate 8 8 * Author URI: https://www.cardgate.com 9 * Version: 3.2. 59 * Version: 3.2.6 10 10 * Text Domain: cardgate 11 11 * Domain Path: /i18n/languages 12 12 * Requires at least: 4.4 13 13 * WC requires at least: 3.0.0 14 * WC tested up to: 9. 8.414 * WC tested up to: 9.9.5 15 15 * License: GPLv3 or later 16 16 */ -
cardgate/trunk/classes/CGP_Common_Gateway.php
r3305647 r3320644 21 21 var $bSeperateSalesTax; 22 22 var $instructions; 23 protected $only_euro_payments = ['cardgateideal',24 'cardgateidealqr',25 'cardgatebancontact',26 'cardgatebanktransfer',27 'cardgatebillink',28 'cardgatesofortbanking',29 'cardgatedirectdebit',30 'cardgateonlineueberweisen',31 'cardgatespraypay',32 ];33 23 34 24 // //////////////////////////////////////////////// … … 47 37 48 38 /** 39 * Check if the currency is allowed for this payment method. 40 * 41 * @param $currency 42 * @param $payment_method 43 * 44 * @return bool 45 */ 46 public function check_payment_currency($currency,$payment_method) { 47 $strictly_euro = in_array($payment_method,['cardgateideal', 48 'cardgateidealqr', 49 'cardgatebancontact', 50 'cardgatebanktransfer', 51 'cardgatebillink', 52 'cardgatesofortbanking', 53 'cardgatedirectdebit', 54 'cardgateonlineueberweisen', 55 'cardgatespraypay']); 56 if ($strictly_euro && $currency != 'EUR') return false; 57 58 $strictly_pln = in_array($payment_method,['cardgateprzelewy24']); 59 if ($strictly_pln && $currency != 'PLN') return false; 60 61 return true; 62 } 63 64 /** 49 65 * Check if the gateway is available for use. 50 66 * … … 54 70 $is_available = ( 'yes' === $this->enabled ); 55 71 $site_currency = get_woocommerce_currency() ; 56 if ( WC()->cart && $site_currency !== 'EUR' && in_array($this->id, $this->only_euro_payments)) {72 if ( WC()->cart && !$this->check_payment_currency( $site_currency, $this->id ) ) { 57 73 $is_available = false; 58 74 } -
cardgate/trunk/readme.txt
r3305647 r3320644 5 5 Requires at least: 4.4 6 6 Tested up to: 6.8 7 Stable tag: 3.2. 57 Stable tag: 3.2.6 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 75 75 == Changelog == 76 76 77 = 3.2.6 = 78 * Added: Currency check 79 77 80 = 3.2.5 = 78 81 * Restrict payment methods by currency
Note: See TracChangeset
for help on using the changeset viewer.