Skip to content

Commit

Permalink
revert to v1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
straightvisions-matthias-bathke committed Jun 5, 2015
1 parent fbdd70c commit 85df76b
Show file tree
Hide file tree
Showing 23 changed files with 396 additions and 588 deletions.
19 changes: 0 additions & 19 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions lib/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down Expand Up @@ -344,7 +343,7 @@ private function print_config_form_fields($args) {
}
echo '</select>';
}
}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 '
<input
type="checkbox"
Expand Down Expand Up @@ -434,7 +433,6 @@ private function paymill_do_settings_fields($page, $section){
$descriptions['thankyou_url'] = __('Redirect URL for custom thank your page.', 'paymill');

$descriptions['no_default_css'] = __('Advanced users want to fully customize the payment button. Disabling default CSS from Pay Button will make that much easier.', 'paymill');
$descriptions['pci_dss_3'] = __('Please ask Paymill customer support before deactivating this feature.', 'paymill');
$descriptions['currency'] = __('Currency, <a href="http://en.wikipedia.org/wiki/ISO_4217#Active_codes" target="_blank">ISO 4217</a> 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 <strong>PRIVATE</strong> API key.', 'paymill');
Expand Down
4 changes: 1 addition & 3 deletions lib/css/paymill.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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{
Expand Down
Binary file modified lib/img/logos/dc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/img/payment_logos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 4 additions & 6 deletions lib/integration/cart66.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).'";
</script>
';

Expand Down Expand Up @@ -165,7 +163,7 @@ private function processProducts(){
));

$this->transaction_id = $response['body']['data']['id'];

return true;
}else{ // total is zero, so just return true

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -242,15 +239,16 @@ public function getCreditCardTypes() {

public function initCheckout($total) {
$this->_total = $total;
$this->process_payment();
}

public function getTransactionResponseDescription() {
return array('errorcode' => '', 'errormessage' => 'No Transaction ID could be generated.');
}

public function doSale() {
$this->process_payment();
return $this->transaction_id;
return $this->transaction_id;
}

}
}
2 changes: 0 additions & 2 deletions lib/integration/magicmembers.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).'";
</script>';

echo '<div id="payment" class="paymill_pay_button paymill_magicmembers"><form action="'. $this->_get_endpoint('return') .'" name="' . $this->code . '_form" method="post" id="' . $this->code . '_form" class="checkout">';
Expand Down
2 changes: 0 additions & 2 deletions lib/integration/marketpress.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).'";
</script>';

echo do_shortcode($mp->get_setting('gateways->paymill-for-wordpress->instructions'));
Expand Down
10 changes: 3 additions & 7 deletions lib/integration/pay_button.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).'";
</script>';

if($this->subscriptions === false){
Expand Down Expand Up @@ -367,11 +365,9 @@ function form($instance) {
<select class="widefat" style="width:220px;overflow:hidden;" id="'.$this->get_field_id('products').'" name="'.$this->get_field_name('products').'[]" multiple>
<option value=""'.((!is_array($products_whitelist) || $products_whitelist[0] == '') ? ' selected="selected"' : '').'>'.__('All Products', 'paymill').'</option>
';
if(isset($GLOBALS['paymill_settings']->paymill_pay_button_settings['products']) && is_array($GLOBALS['paymill_settings']->paymill_pay_button_settings['products']) && count($GLOBALS['paymill_settings']->paymill_pay_button_settings['products']) > 0){
foreach($GLOBALS['paymill_settings']->paymill_pay_button_settings['products'] as $id => $product){
if(strlen($product['products_title']) > 0){
echo '<option value="'.$id.'"'.(is_array(unserialize($instance['products'])) && in_array($id,unserialize($instance['products'])) ? ' selected="selected"' : '').'>'.$product['products_title'].'</option>';
}
foreach($GLOBALS['paymill_settings']->paymill_pay_button_settings['products'] as $id => $product){
if(strlen($product['products_title']) > 0){
echo '<option value="'.$id.'"'.(is_array(unserialize($instance['products'])) && in_array($id,unserialize($instance['products'])) ? ' selected="selected"' : '').'>'.$product['products_title'].'</option>';
}
}
echo '
Expand Down
2 changes: 0 additions & 2 deletions lib/integration/shopplugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ function form(){
paymill_form_checkout_id = "#checkout";
paymill_form_checkout_submit_id = "#checkout-button";
paymill_shop_name = "shopplugin";
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).'";
</script>';

// html / icons
Expand Down
7 changes: 2 additions & 5 deletions lib/integration/subscriptions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,14 @@ public function offerCreate($params){
$GLOBALS['paymill_loader']->request_offer->setTrialPeriodDays($params['trial_period_days']);

$output = $GLOBALS['paymill_loader']->request->create($GLOBALS['paymill_loader']->request_offer);

$offerID = $output->getId();

$this->offerGetList(true);
//$output = $this->offerGetDetailByID($offerID);
$output = $offerID;
$output = $this->offerGetDetailByID($offerID);
}catch(Exception $e){
$GLOBALS['paymill_loader']->paymill_errors->setError(__($e->getMessage(),'paymill'));
$output = false;
}

if(paymill_BENCHMARK)paymill_doBenchmark(false,'paymill_subscription_offerCreate'); // benchmark
return $output;
}
Expand Down
12 changes: 5 additions & 7 deletions lib/integration/woocommerce.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,14 @@ private function processSubscriptions(){
'trial_period_days' => intval($trial_time)
);
$offer = $this->subscriptions->offerCreate($params);

if($GLOBALS['paymill_loader']->paymill_errors->status()){
$GLOBALS['paymill_loader']->paymill_errors->getErrors();
return false;
}
}

// create user subscription
$user_sub = $this->subscriptions->create($this->client->getId(), $offer, $this->paymentClass->getPaymentID(),(isset($_POST['paymill_delivery_date']) ? $_POST['paymill_delivery_date'] : false),$periodOfValidity);
$user_sub = $this->subscriptions->create($this->client->getId(), $offer['id'], $this->paymentClass->getPaymentID(),(isset($_POST['paymill_delivery_date']) ? $_POST['paymill_delivery_date'] : false),$periodOfValidity);

if($GLOBALS['paymill_loader']->paymill_errors->status()){
$GLOBALS['paymill_loader']->paymill_errors->getErrors();
Expand All @@ -568,8 +568,8 @@ private function processSubscriptions(){
// subscription successful
do_action('paymill_woocommerce_subscription_created', array(
'product_id' => $product['product_id'],
'offer_id' => $offer,
//'offer_data' => $offer
'offer_id' => $offer['id'],
'offer_data' => $offer
));

return true;
Expand Down Expand Up @@ -714,7 +714,7 @@ public function validate_fields(){
global $woocommerce;
// check Paymill payment
if(empty($_POST['paymillToken'])){
wc_add_notice(__('Token not Found','paymill'));
$woocommerce->add_error(__('Token not Found','paymill'));
return false;
}
return true;
Expand All @@ -736,8 +736,6 @@ public function payment_fields(){
paymill_form_checkout_id = "form.checkout, form#order_review";
paymill_form_checkout_submit_id = "#place_order";
paymill_shop_name = "woocommerce";
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).'";
</script>';


Expand Down
64 changes: 23 additions & 41 deletions lib/js/livevalidation_custom.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,29 @@
jQuery(document).ready(function () {
if(typeof paymill_shop_name != 'undefined'){
jQuery("body").on("click", "#paymill_payment_form", function() {
if(jQuery('#paymill_holdername_c').length > 0){
var f0c = new LiveValidation('paymill_holdername_c', { validMessage: "✔", onlyOnBlur: true, failureMessage: paymill_livevl.notEmpty} );
f0c.add( Validate.Presence,{failureMessage: paymill_livevl.notEmpty} );
}
if(jQuery('#paymill_holdername_s').length > 0){
var f0s = new LiveValidation('paymill_holdername_s', { validMessage: "✔", onlyOnBlur: true, failureMessage: paymill_livevl.notEmpty} );
f0s.add( Validate.Presence,{failureMessage: paymill_livevl.notEmpty} );
}
if(jQuery('#paymill_holdername_e').length > 0){
var f0e = new LiveValidation('paymill_holdername_e', { validMessage: "✔", onlyOnBlur: true, failureMessage: paymill_livevl.notEmpty} );
f0e.add( Validate.Presence,{failureMessage: paymill_livevl.notEmpty} );
}

if(jQuery('#paymill_card_number').length){
var f1 = new LiveValidation('paymill_card_number', { validMessage: "✔", onlyOnBlur: true });
var maximum = 16;
f1.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } );
f1.add( Validate.Length, { maximum: maximum, wrongLengthMessage:paymill_livevl.wrongLength.replace('{maximum}',maximum), tooShortMessage:paymill_livevl.tooShort, tooLongMessage:paymill_livevl.tooLong.replace('{maximum}',maximum) } );
}

if(jQuery('#paymill_card_cvc').length){
var f2 = new LiveValidation('paymill_card_cvc', { validMessage: "✔", onlyOnBlur: true });
var maximum = 4;
var minimum = 3;
f2.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } );
f2.add( Validate.Length, { minimum: minimum, maximum: maximum, wrongLengthMessage:paymill_livevl.wrongLength.replace('{maximum}',maximum).replace('{minimum}',minimum), tooShortMessage:paymill_livevl.tooShort.replace('{minimum}',minimum), tooLongMessage:paymill_livevl.tooLong.replace('{maximum}',maximum) } );
}

if(jQuery('#paymill_card_expiry_month').length){
var f3 = new LiveValidation('paymill_card_expiry_month', { validMessage: "✔", onlyOnBlur: true });
var is = 2;
f3.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } );
f3.add( Validate.Length, { is: is, wrongLengthMessage:paymill_livevl.wrongLength.replace('{is}',is), tooShortMessage:paymill_livevl.tooShort.replace('{is}',is), tooLongMessage:paymill_livevl.tooLong.replace('{is}',is) } );
}

if(jQuery('#paymill_card_expiry_year').length){
var f4 = new LiveValidation('paymill_card_expiry_year', { validMessage: "✔", onlyOnBlur: true });
var is = 4;
f4.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } );
f4.add( Validate.Length, { is: is, wrongLengthMessage:paymill_livevl.wrongLength.replace('{is}',is), tooShortMessage:paymill_livevl.tooShort.replace('{is}',is), tooLongMessage:paymill_livevl.tooLong.replace('{is}',is) } );
}
var f0 = new LiveValidation('paymill_holdername', { validMessage: "✔", onlyOnBlur: true, failureMessage: paymill_livevl.notEmpty} );
f0.add( Validate.Presence,{failureMessage: paymill_livevl.notEmpty} );

var f1 = new LiveValidation('paymill_card_number', { validMessage: "✔", onlyOnBlur: true });
var maximum = 16;
f1.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } );
f1.add( Validate.Length, { maximum: maximum, wrongLengthMessage:paymill_livevl.wrongLength.replace('{maximum}',maximum), tooShortMessage:paymill_livevl.tooShort, tooLongMessage:paymill_livevl.tooLong.replace('{maximum}',maximum) } );

var f2 = new LiveValidation('paymill_card_cvc', { validMessage: "✔", onlyOnBlur: true });
var maximum = 4;
var minimum = 3;
f2.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } );
f2.add( Validate.Length, { minimum: minimum, maximum: maximum, wrongLengthMessage:paymill_livevl.wrongLength.replace('{maximum}',maximum).replace('{minimum}',minimum), tooShortMessage:paymill_livevl.tooShort.replace('{minimum}',minimum), tooLongMessage:paymill_livevl.tooLong.replace('{maximum}',maximum) } );

var f3 = new LiveValidation('paymill_card_expiry_month', { validMessage: "✔", onlyOnBlur: true });
var is = 2;
f3.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } );
f3.add( Validate.Length, { is: is, wrongLengthMessage:paymill_livevl.wrongLength.replace('{is}',is), tooShortMessage:paymill_livevl.tooShort.replace('{is}',is), tooLongMessage:paymill_livevl.tooLong.replace('{is}',is) } );

var f4 = new LiveValidation('paymill_card_expiry_year', { validMessage: "✔", onlyOnBlur: true });
var is = 4;
f4.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } );
f4.add( Validate.Length, { is: is, wrongLengthMessage:paymill_livevl.wrongLength.replace('{is}',is), tooShortMessage:paymill_livevl.tooShort.replace('{is}',is), tooLongMessage:paymill_livevl.tooLong.replace('{is}',is) } );

var f5 = new LiveValidation('paymill_sepa_iban', { validMessage: "✔", onlyOnBlur: true });
var minimum = 15;
Expand Down
Loading

0 comments on commit 85df76b

Please sign in to comment.