diff --git a/CHANGES.md b/CHANGES.md index 38148b0..c17babe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,25 +2,6 @@ Changelog ========= - -1.10.2 ------ -* Subscriptions: "required_offer_or_amount_and_currency_and_interval" error fixed - -1.10.1 ------ -* WooCommerce: Error Management Fix -* Common: Checkout Form fix - - -1.10.0 ------ -* WooCommerce: Error Management on Checkout fixed -* WooCommerce: Subscription Handling reviewed and optimized -* Common: Support for PCI DSS 3.0 (iframe-based credit card form) -* WooCommerce: Several improvements and bugfixes - - 1.9.0 ----- * Common: Update to v2.1 Paymill API diff --git a/README.md b/README.md index e3707de..398ff05 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ PAYMILL for WordPress * Contributors: Matthias Reuter * Donate link: * Tags: paymill, creditcard, elv, payment, woocommerce, paybutton, ecommerce, debitcard, subscriptions -* Requires at least: 4.2.2 -* Tested up to: 4.2.2 -* Stable tag: 1.10.2 +* Requires at least: 4.1 +* Tested up to: 4.1.1 +* Stable tag: 1.9 * License: [GPLv3 or later](http://www.gnu.org/licenses/gpl-3.0.html) With PAYMILL you are able to provide credit card based payments for your customers. diff --git a/lib/config.inc.php b/lib/config.inc.php index 1022d67..122c68d 100644 --- a/lib/config.inc.php +++ b/lib/config.inc.php @@ -113,7 +113,6 @@ public function paymill_register_general_settings(){ 'api_key_public' => __('Paymill PUBLIC API key', 'paymill'), 'payments_display' => __('Display Payment Types', 'paymill'), 'no_default_css' => __('Do not load default CSS', 'paymill'), - 'pci_dss_3' => __('Deactivate PCI DSS 3.0 Compatibility', 'paymill'), ); foreach($settings as $setting => $description){ @@ -344,7 +343,7 @@ private function print_config_form_fields($args) { } echo ''; } - }elseif($args['desc'] == 'products_quantityhide' || $args['desc'] == 'no_default_css' || $args['desc'] == 'pci_dss_3'){ // products_quantityhide, no_default_css, pci_dss_3 + }elseif($args['desc'] == 'products_quantityhide' || $args['desc'] == 'no_default_css'){ // products_quantityhide, no_default_css echo ' ISO 4217 e.g. "EUR" or "GBP"', 'paymill'); $descriptions['currency_format'] = __('Currency Format - use the following variables: %n = number, %s = symbol.', 'paymill'); $descriptions['api_key_private'] = __('Insert your Paymill PRIVATE API key.', 'paymill'); diff --git a/lib/css/paymill.css b/lib/css/paymill.css index 2a4f01a..eaec1b4 100644 --- a/lib/css/paymill.css +++ b/lib/css/paymill.css @@ -83,6 +83,7 @@ background-image:url('../img/payment_logos.png'); background-repeat:no-repeat; background-position:0px 30px; + font-size:90%; } #paymill_framebox img{ box-shadow:none !important; @@ -130,9 +131,6 @@ paymill_#form_credit, paymill_#form_elv{ .paymill_payment_logos{ margin-bottom:10px; } -.paymill_payment_logos img{ - display:inline; -} /* error box */ .paymill_payment_errors{ diff --git a/lib/img/logos/dc.png b/lib/img/logos/dc.png index 911a4b2..9ab8017 100644 Binary files a/lib/img/logos/dc.png and b/lib/img/logos/dc.png differ diff --git a/lib/img/payment_logos.png b/lib/img/payment_logos.png index 8e9255e..bc474e5 100644 Binary files a/lib/img/payment_logos.png and b/lib/img/payment_logos.png differ diff --git a/lib/integration/cart66.inc.php b/lib/integration/cart66.inc.php index 7719795..c6d1cb1 100644 --- a/lib/integration/cart66.inc.php +++ b/lib/integration/cart66.inc.php @@ -60,8 +60,6 @@ protected function _buildCheckoutView($gateway) { paymill_form_checkout_id = "#Cart66_paymill_for_wordpress_form"; paymill_form_checkout_submit_id = "#Cart66CheckoutButton"; paymill_shop_name = "cart66"; - paymill_pcidss3 = '.((empty($GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3']) || $GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3'] != '1') ? 1 : 0).'; - paymill_pcidss3_lang = "'.substr(apply_filters('plugin_locale', get_locale(), $domain),0,2).'"; '; @@ -165,7 +163,7 @@ private function processProducts(){ )); $this->transaction_id = $response['body']['data']['id']; - + return true; }else{ // total is zero, so just return true @@ -195,7 +193,6 @@ private function process_payment(){ // process subscriptions & products if($this->processProducts()){ // success - return true; }else{ if($GLOBALS['paymill_loader']->paymill_errors->status()){ $GLOBALS['paymill_loader']->paymill_errors->getErrors(); @@ -242,6 +239,7 @@ public function getCreditCardTypes() { public function initCheckout($total) { $this->_total = $total; + $this->process_payment(); } public function getTransactionResponseDescription() { @@ -249,8 +247,8 @@ public function getTransactionResponseDescription() { } public function doSale() { - $this->process_payment(); - return $this->transaction_id; + return $this->transaction_id; } + } } \ No newline at end of file diff --git a/lib/integration/magicmembers.inc.php b/lib/integration/magicmembers.inc.php index ebbbdb4..a2a5eb4 100644 --- a/lib/integration/magicmembers.inc.php +++ b/lib/integration/magicmembers.inc.php @@ -1427,8 +1427,6 @@ function process_html_redirect(){ paymill_form_checkout_id = ".checkout"; paymill_form_checkout_submit_id = "#place_order"; paymill_shop_name = "magicmembers"; - paymill_pcidss3 = '.((empty($GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3']) || $GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3'] != '1') ? 1 : 0).'; - paymill_pcidss3_lang = "'.substr(apply_filters('plugin_locale', get_locale(), $domain),0,2).'"; '; echo '
'; diff --git a/lib/integration/marketpress.inc.php b/lib/integration/marketpress.inc.php index 35e491b..c244d6d 100644 --- a/lib/integration/marketpress.inc.php +++ b/lib/integration/marketpress.inc.php @@ -201,8 +201,6 @@ function payment_form($global_cart, $shipping_info) { paymill_form_checkout_id = "#mp_payment_form"; paymill_form_checkout_submit_id = "#mp_payment_confirm"; paymill_shop_name = "marketpress"; - paymill_pcidss3 = '.((empty($GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3']) || $GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3'] != '1') ? 1 : 0).'; - paymill_pcidss3_lang = "'.substr(apply_filters('plugin_locale', get_locale(), $domain),0,2).'"; '; echo do_shortcode($mp->get_setting('gateways->paymill-for-wordpress->instructions')); diff --git a/lib/integration/pay_button.inc.php b/lib/integration/pay_button.inc.php index 383388e..90bb3fa 100644 --- a/lib/integration/pay_button.inc.php +++ b/lib/integration/pay_button.inc.php @@ -304,8 +304,6 @@ function widget($args, $instance){ paymill_form_checkout_id = ".checkout"; paymill_form_checkout_submit_id = "#place_order"; paymill_shop_name = "paybutton"; - paymill_pcidss3 = '.((empty($GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3']) || $GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3'] != '1') ? 1 : 0).'; - paymill_pcidss3_lang = "'.substr(apply_filters('plugin_locale', get_locale(), $domain),0,2).'"; '; if($this->subscriptions === false){ @@ -367,11 +365,9 @@ function form($instance) { "); - paymill_youshallpass = true; - form.submit(); + if (false == paymill.validateExpiry(jQuery('#paymill_card_expiry_month').val(), jQuery('#paymill_card_expiry_year').val())) { + jQuery(".paymill_payment_errors").text(paymill_lang.validateExpiry); + jQuery(paymill_form_checkout_submit_id).show(); + return false; + } + + if (false == paymill.validateCvc(jQuery('#paymill_card_cvc').val())) { + jQuery(".paymill_payment_errors").text(paymill_lang.validateCvc); + jQuery(paymill_form_checkout_submit_id).show(); + return false; + } + + paymill.createToken({ + number:jQuery('#paymill_card_number').val(), + exp_month:jQuery('#paymill_card_expiry_month').val(), + exp_year:jQuery('#paymill_card_expiry_year').val(), + cvc:jQuery('#paymill_card_cvc').val(), + cardholder:jQuery('#paymill_holdername').val(), + amount_int:jQuery('.paymill_amount').val(), + currency:jQuery('.paymill_currency').val() + }, function (error, result) { + if(error){ + // shows error + if(typeof paymill_lang[error.apierror] != 'undefined'){ + jQuery(".paymill_payment_errors").text(paymill_lang[error.apierror]); + }else{ + jQuery(".paymill_payment_errors").text(error.apierror); } - }); - }else{ - if (false == paymill.validateCardNumber(jQuery('#paymill_card_number').val())) { - jQuery(".paymill_payment_errors").text(paymill_lang.validateCardNumber); jQuery(paymill_form_checkout_submit_id).show(); - return false; - } + }else{ + + + jQuery(".paymill_payment_errors").text(""); + var form = jQuery(paymill_form_checkout_id); - if (false == paymill.validateExpiry(jQuery('#paymill_card_expiry_month').val(), jQuery('#paymill_card_expiry_year').val())) { - jQuery(".paymill_payment_errors").text(paymill_lang.validateExpiry); - jQuery(paymill_form_checkout_submit_id).show(); - return false; + // insert token into form + var token = result.token; + form.append(""); + paymill_youshallpass = true; + form.submit(); } - - if (false == paymill.validateCvc(jQuery('#paymill_card_cvc').val())) { - jQuery(".paymill_payment_errors").text(paymill_lang.validateCvc); + if(paymill_shop_name == 'shopplugin'){ jQuery(paymill_form_checkout_submit_id).show(); - return false; } - - paymill.createToken({ - number:jQuery('#paymill_card_number').val(), - exp_month:jQuery('#paymill_card_expiry_month').val(), - exp_year:jQuery('#paymill_card_expiry_year').val(), - cvc:jQuery('#paymill_card_cvc').val(), - cardholder:jQuery('#paymill_holdername_c').val(), - amount_int:jQuery('.paymill_amount').val(), - currency:jQuery('.paymill_currency').val() - }, function (error, result) { - if(error){ - // shows error - if(typeof paymill_lang[error.apierror] != 'undefined'){ - jQuery(".paymill_payment_errors").text(paymill_lang[error.apierror]); - }else{ - jQuery(".paymill_payment_errors").text(error.apierror); - } - jQuery(paymill_form_checkout_submit_id).show(); - }else{ - jQuery(".paymill_payment_errors").text(""); - var form = jQuery(paymill_form_checkout_id); - - // insert token into form - var token = result.token; - form.append(""); - paymill_youshallpass = true; - form.submit(); - } - if(paymill_shop_name == 'shopplugin'){ - jQuery(paymill_form_checkout_submit_id).show(); - } - }); - } - }else if(jQuery('#paymill_form_sepa').is(':visible') || (jQuery('#paymill_sepa_iban').length > 0 && jQuery('#paymill_sepa_iban').val() != '') && (jQuery('#payment_method_paymill').is(':checked') || jQuery('.wgm-second-checkout input[name=payment_method]').val() == 'paymill')){ + }); + }else if(jQuery('#paymill_form_sepa').is(':visible') || jQuery('#paymill_sepa_iban').val() != '' && (jQuery('#payment_method_paymill').is(':checked') || jQuery('.wgm-second-checkout input[name=payment_method]').val() == 'paymill')){ if (false == paymill.validateIban(jQuery('#paymill_sepa_iban').val())) { jQuery(".paymill_payment_errors").text(paymill_lang.validateIBAN); jQuery(paymill_form_checkout_submit_id).show(); @@ -175,7 +117,7 @@ jQuery(document).ready(function () { paymill.createToken({ iban:jQuery('#paymill_sepa_iban').val(), bic:jQuery('#paymill_sepa_bic').val(), - accountholder:jQuery('#paymill_holdername_s').val(), + accountholder:jQuery('#paymill_holdername').val(), amount_int:jQuery('.paymill_amount').val(), currency:jQuery('.paymill_currency').val() }, function (error, result) { @@ -198,7 +140,7 @@ jQuery(document).ready(function () { form.submit(); } }); - }else if(jQuery('#paymill_form_elv').is(':visible') || (jQuery('#paymill_elv_number').length > 0 && jQuery('#paymill_elv_number').val() != '') && (jQuery('#payment_method_paymill').is(':checked') || jQuery('.wgm-second-checkout input[name=payment_method]').val() == 'paymill')){ + }else if(jQuery('#paymill_form_elv').is(':visible') || jQuery('#paymill_elv_number').val() != '' && (jQuery('#payment_method_paymill').is(':checked') || jQuery('.wgm-second-checkout input[name=payment_method]').val() == 'paymill')){ if (false == paymill.validateAccountNumber(jQuery('#paymill_elv_number').val())) { jQuery(".paymill_payment_errors").text(paymill_lang.validateAccountNumber); jQuery(paymill_form_checkout_submit_id).show(); @@ -214,7 +156,7 @@ jQuery(document).ready(function () { paymill.createToken({ number:jQuery('#paymill_elv_number').val(), bank:jQuery('#paymill_elv_bank_code').val(), - accountholder:jQuery('#paymill_holdername_e').val(), + accountholder:jQuery('#paymill_holdername').val(), amount_int:jQuery('.paymill_amount').val(), currency:jQuery('.paymill_currency').val() }, function (error, result) { diff --git a/lib/scripts.inc.php b/lib/scripts.inc.php index 6ca1dbe..1d027f3 100644 --- a/lib/scripts.inc.php +++ b/lib/scripts.inc.php @@ -31,11 +31,7 @@ function paymill_load_frontend_scripts(){ if(paymill_BENCHMARK)paymill_doBenchmark(true,'paymill_load_frontend_scripts'); // benchmark wp_deregister_script(array('paymill_bridge','paymill_bridge_custom')); wp_enqueue_script('jquery.formatCurrency-1.4.0.js',PAYMILL_PLUGIN_URL.'lib/js/jquery.formatCurrency-1.4.0.js', array('jquery'), PAYMILL_VERSION); - if(empty($GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3']) || $GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3'] != '1'){ - wp_enqueue_script('paymill_bridge', 'https://bridge.paymill.com/dss3', array('jquery'), PAYMILL_VERSION); - }else{ - wp_enqueue_script('paymill_bridge', 'https://bridge.paymill.de/', array('jquery'), PAYMILL_VERSION); - } + wp_enqueue_script('paymill_bridge', 'https://bridge.paymill.de/', array('jquery'), PAYMILL_VERSION); wp_localize_script('paymill_bridge', 'paymill_lang', array( 'validateCardNumber' => esc_attr__('Invalid Credit Card Number', 'paymill'), 'validateExpiry' => esc_attr__('Invalid Expiration Date', 'paymill'), diff --git a/lib/tpl/checkout_form.php b/lib/tpl/checkout_form.php index 9c7a14a..f5c422f 100644 --- a/lib/tpl/checkout_form.php +++ b/lib/tpl/checkout_form.php @@ -55,15 +55,14 @@ } echo '
'.__('ELV', 'paymill').'
'; } - if(empty($GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3']) || $GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3'] != '1'){ -?> - - -