Plugin Directory

Changeset 2945267


Ignore:
Timestamp:
07/31/2023 08:33:12 AM (3 years ago)
Author:
tripleatechnology
Message:

releasing v2.0.8

Location:
triplea-cryptocurrency-payment-gateway-for-woocommerce
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • triplea-cryptocurrency-payment-gateway-for-woocommerce/tags/2.0.8/assets/js/checkout.js

    r2814849 r2945267  
    7272        $('#triplea_embedded_payment_form_btn').hide();
    7373        $('#triplea_embedded_payment_form_loading_txt').hide();
     74
     75        triplea_freeze_checkout_form();
    7476
    7577        triplea_createHiddenInputData('triplea_order_txid', response.order_txid);
     
    259261        }
    260262    }
    261 
     263    function triplea_freeze_checkout_form(){
     264        var billingFieldsDiv = document.querySelector('.woocommerce-billing-fields');
     265
     266        // Apply the blur effect using inline styles
     267        billingFieldsDiv.style.webkitFilter = 'blur(5px)';
     268        billingFieldsDiv.style.mozFilter = 'blur(5px)';
     269        billingFieldsDiv.style.oFilter = 'blur(5px)';
     270        billingFieldsDiv.style.msFilter = 'blur(5px)';
     271        billingFieldsDiv.style.filter = 'blur(1px)';
     272        billingFieldsDiv.style.pointerEvents = 'none';
     273        billingFieldsDiv.style.position = 'relative';
     274
     275    }
    262276    function triplea_validateCheckoutCallback(response) {
    263277        if (response.data && response.success === false) {
  • triplea-cryptocurrency-payment-gateway-for-woocommerce/tags/2.0.8/includes/WooCommerce/TripleA_Payment_Gateway.php

    r2936473 r2945267  
    358358        $self->logger->write_log( 'triplea_checkout_check() called.', $self->debugLog );
    359359
     360        $validation_done = false;
     361        if (!is_null($errors)) {
     362            $validation_done = true;
     363        }
     364
    360365        if (is_null($errors)) {
    361366            $self->logger->write_log( 'triplea_checkout_check() Form errors found.', $self->debugLog );
     
    369374        if (empty($error_messages)) {
    370375            $self->logger->write_log( 'triplea_checkout_check() success.', $self->debugLog );
     376
     377            if (has_action('woocommerce_checkout_process')) {
     378
     379                $self->logger->write_log( 'triplea_checkout_check() site has custom validation on woocommerce_checkout_process hoook.', $self->debugLog );
     380
     381                // Run the custom validation
     382                do_action('woocommerce_checkout_process');
     383
     384                $error_messages = $errors->get_error_messages();
     385
     386                $wc_notices = wc_get_notices();
     387
     388                // Merge the WooCommerce notices with the validation errors
     389                $error_messages = array_merge($error_messages, $wc_notices);
     390                foreach ($error_messages as $message) {
     391                    $errors->add('validation', $message);
     392                }
     393                wc_clear_notices();
     394                if(!empty($error_messages)){
     395
     396                    if (isset($error_messages['error']) && count($error_messages['error']) > 1) {
     397                        $map = [];
     398                        $dup = [];
     399                        foreach ($error_messages['error'] as $key => $val) {
     400                            if (!array_key_exists($val['notice'], $map)) {
     401                                $map[$val['notice']] = $key;
     402                            } else {
     403                                $dup[] = $key;
     404                            }
     405                        }
     406                        foreach ($dup as $key => $val) {
     407                            unset($error_messages['error'][$val]);
     408                        }
     409                        sort($error_messages['error']);
     410                    }
     411                    $self->logger->write_log( 'triplea_checkout_check() custom validation: Form errors found.', $self->debugLog );
     412                    //$self->logger->write_log(json_encode($error_messages), $self->debugLog );
     413                    $self->logger->write_log( 'triplea_checkout_check()  custom validationfailed.', $self->debugLog );
     414                    wp_send_json_error(
     415                        [
     416                            'messages' => $error_messages,
     417                            'status'   => 'notok',
     418                            'from '   => 'triplea_checkout_check custom validation'
     419                        ]
     420                    );
     421                }
     422
     423            }
    371424            wp_send_json_success(
    372425                [
     
    376429        } else {
    377430            $self->logger->write_log( 'triplea_checkout_check(): Form errors found.', $self->debugLog );
     431            //$self->logger->write_log(json_encode($error_messages)), $self->debugLog );
     432           // $self->logger->write_log(json_encode($error_messages), $self->debugLog );
    378433            $self->logger->write_log( 'triplea_checkout_check() failed.', $self->debugLog );
    379434            wp_send_json_error(
     
    381436                'messages' => $error_messages,
    382437                'status'   => 'notok',
     438                'from '   => 'triplea_checkout_check',
    383439                ]
    384440            );
     
    15991655                        .'To be paid to '.$payment_data->crypto_currency.' address:' . '<br>'
    16001656                        . $bitcoin_address . "<br>"
     1657                        . "Payment reference: <br>"
     1658                        . $payment_data->payment_reference . "<br>"
    16011659                        . "<a href='https://www.blockchain.com/search?search=" . $bitcoin_address . "' target='_blank'>(View details on the blockchain)</a>";
    16021660            }
  • triplea-cryptocurrency-payment-gateway-for-woocommerce/tags/2.0.8/readme.txt

    r2936473 r2945267  
    77Requires at least: 5.5
    88Tested up to: 6.2.2
    9 Stable tag: 2.0.7
     9Stable tag: 2.0.8
    1010Requires PHP: 7.0
    1111License: GPLv2 or later
     
    109109== Changelog ==
    110110
     111= 2.0.8 =
     112Fixed: Check custom validation in checkout form before calling for payment form
     113Added: Blur effect on payment form
     114Added: Payment Reference added on Order Notes
     115
    111116= 2.0.7 =
    112117Fixed: Unusual token request from elementor or javascript from frontend
     
    272277== Upgrade Notice ==
    273278
     279= 2.0.8 =
     280Simply install the update. No further action is needed.
     281
    274282= 2.0.7 =
    275283Simply install the update. No further action is needed.
  • triplea-cryptocurrency-payment-gateway-for-woocommerce/tags/2.0.8/triplea-cryptocurrency-payment-gateway-for-woocommerce.php

    r2936473 r2945267  
    1717 * Plugin URI:        https://wordpress.org/plugins/triplea-cryptocurrency-payment-gateway-for-woocommerce/
    1818 * Description:       Offer cryptocurrency as a payment option on your website and get access to even more clients. Receive payments in cryptocurrency or in your local currency, directly in your bank account. Enjoy an easy setup, no cryptocurrency expertise required. Powered by TripleA.
    19  * Version:           2.0.7
     19 * Version:           2.0.8
    2020 * Author:            TripleA Team
    2121 * Author URI:        https://triple-a.io
     
    4545     * $var string
    4646     */
    47     const version = '2.0.7';
     47    const version = '2.0.8';
    4848
    4949    /*
  • triplea-cryptocurrency-payment-gateway-for-woocommerce/trunk/assets/js/checkout.js

    r2814849 r2945267  
    7272        $('#triplea_embedded_payment_form_btn').hide();
    7373        $('#triplea_embedded_payment_form_loading_txt').hide();
     74
     75        triplea_freeze_checkout_form();
    7476
    7577        triplea_createHiddenInputData('triplea_order_txid', response.order_txid);
     
    259261        }
    260262    }
    261 
     263    function triplea_freeze_checkout_form(){
     264        var billingFieldsDiv = document.querySelector('.woocommerce-billing-fields');
     265
     266        // Apply the blur effect using inline styles
     267        billingFieldsDiv.style.webkitFilter = 'blur(5px)';
     268        billingFieldsDiv.style.mozFilter = 'blur(5px)';
     269        billingFieldsDiv.style.oFilter = 'blur(5px)';
     270        billingFieldsDiv.style.msFilter = 'blur(5px)';
     271        billingFieldsDiv.style.filter = 'blur(1px)';
     272        billingFieldsDiv.style.pointerEvents = 'none';
     273        billingFieldsDiv.style.position = 'relative';
     274
     275    }
    262276    function triplea_validateCheckoutCallback(response) {
    263277        if (response.data && response.success === false) {
  • triplea-cryptocurrency-payment-gateway-for-woocommerce/trunk/includes/WooCommerce/TripleA_Payment_Gateway.php

    r2936473 r2945267  
    358358        $self->logger->write_log( 'triplea_checkout_check() called.', $self->debugLog );
    359359
     360        $validation_done = false;
     361        if (!is_null($errors)) {
     362            $validation_done = true;
     363        }
     364
    360365        if (is_null($errors)) {
    361366            $self->logger->write_log( 'triplea_checkout_check() Form errors found.', $self->debugLog );
     
    369374        if (empty($error_messages)) {
    370375            $self->logger->write_log( 'triplea_checkout_check() success.', $self->debugLog );
     376
     377            if (has_action('woocommerce_checkout_process')) {
     378
     379                $self->logger->write_log( 'triplea_checkout_check() site has custom validation on woocommerce_checkout_process hoook.', $self->debugLog );
     380
     381                // Run the custom validation
     382                do_action('woocommerce_checkout_process');
     383
     384                $error_messages = $errors->get_error_messages();
     385
     386                $wc_notices = wc_get_notices();
     387
     388                // Merge the WooCommerce notices with the validation errors
     389                $error_messages = array_merge($error_messages, $wc_notices);
     390                foreach ($error_messages as $message) {
     391                    $errors->add('validation', $message);
     392                }
     393                wc_clear_notices();
     394                if(!empty($error_messages)){
     395
     396                    if (isset($error_messages['error']) && count($error_messages['error']) > 1) {
     397                        $map = [];
     398                        $dup = [];
     399                        foreach ($error_messages['error'] as $key => $val) {
     400                            if (!array_key_exists($val['notice'], $map)) {
     401                                $map[$val['notice']] = $key;
     402                            } else {
     403                                $dup[] = $key;
     404                            }
     405                        }
     406                        foreach ($dup as $key => $val) {
     407                            unset($error_messages['error'][$val]);
     408                        }
     409                        sort($error_messages['error']);
     410                    }
     411                    $self->logger->write_log( 'triplea_checkout_check() custom validation: Form errors found.', $self->debugLog );
     412                    //$self->logger->write_log(json_encode($error_messages), $self->debugLog );
     413                    $self->logger->write_log( 'triplea_checkout_check()  custom validationfailed.', $self->debugLog );
     414                    wp_send_json_error(
     415                        [
     416                            'messages' => $error_messages,
     417                            'status'   => 'notok',
     418                            'from '   => 'triplea_checkout_check custom validation'
     419                        ]
     420                    );
     421                }
     422
     423            }
    371424            wp_send_json_success(
    372425                [
     
    376429        } else {
    377430            $self->logger->write_log( 'triplea_checkout_check(): Form errors found.', $self->debugLog );
     431            //$self->logger->write_log(json_encode($error_messages)), $self->debugLog );
     432           // $self->logger->write_log(json_encode($error_messages), $self->debugLog );
    378433            $self->logger->write_log( 'triplea_checkout_check() failed.', $self->debugLog );
    379434            wp_send_json_error(
     
    381436                'messages' => $error_messages,
    382437                'status'   => 'notok',
     438                'from '   => 'triplea_checkout_check',
    383439                ]
    384440            );
     
    15991655                        .'To be paid to '.$payment_data->crypto_currency.' address:' . '<br>'
    16001656                        . $bitcoin_address . "<br>"
     1657                        . "Payment reference: <br>"
     1658                        . $payment_data->payment_reference . "<br>"
    16011659                        . "<a href='https://www.blockchain.com/search?search=" . $bitcoin_address . "' target='_blank'>(View details on the blockchain)</a>";
    16021660            }
  • triplea-cryptocurrency-payment-gateway-for-woocommerce/trunk/readme.txt

    r2936473 r2945267  
    77Requires at least: 5.5
    88Tested up to: 6.2.2
    9 Stable tag: 2.0.7
     9Stable tag: 2.0.8
    1010Requires PHP: 7.0
    1111License: GPLv2 or later
     
    109109== Changelog ==
    110110
     111= 2.0.8 =
     112Fixed: Check custom validation in checkout form before calling for payment form
     113Added: Blur effect on payment form
     114Added: Payment Reference added on Order Notes
     115
    111116= 2.0.7 =
    112117Fixed: Unusual token request from elementor or javascript from frontend
     
    272277== Upgrade Notice ==
    273278
     279= 2.0.8 =
     280Simply install the update. No further action is needed.
     281
    274282= 2.0.7 =
    275283Simply install the update. No further action is needed.
  • triplea-cryptocurrency-payment-gateway-for-woocommerce/trunk/triplea-cryptocurrency-payment-gateway-for-woocommerce.php

    r2936473 r2945267  
    1717 * Plugin URI:        https://wordpress.org/plugins/triplea-cryptocurrency-payment-gateway-for-woocommerce/
    1818 * Description:       Offer cryptocurrency as a payment option on your website and get access to even more clients. Receive payments in cryptocurrency or in your local currency, directly in your bank account. Enjoy an easy setup, no cryptocurrency expertise required. Powered by TripleA.
    19  * Version:           2.0.7
     19 * Version:           2.0.8
    2020 * Author:            TripleA Team
    2121 * Author URI:        https://triple-a.io
     
    4545     * $var string
    4646     */
    47     const version = '2.0.7';
     47    const version = '2.0.8';
    4848
    4949    /*
Note: See TracChangeset for help on using the changeset viewer.