Plugin Directory

Changeset 3115658

Timestamp:
07/10/2024 02:09:21 PM (2 weeks ago)
Author:
belluno
Message:

feat: Melhoria de segurança no checkout

Location:
wc-belluno/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wc-belluno/trunk/includes/class-wc-belluno-card.php

    r3108946 r3115658  
    621621        $args = array(
    622622            'body' => json_encode(array(
    623                 "document" => $document,
    624                 "postal_code" =>  str_replace('-', '', sanitize_text_field($_POST['billing_postcode'])),
     623                "document" => $document,
     624                "postal_code" => str_replace('-', '', sanitize_text_field($_POST['billing_postcode'])),
    625625            )),
    626626            'headers' => array(
     
    641641        if ($body->valid) {
    642642            wc_add_notice('A transação não pode ser concluída no momento! Tente novamente mais tarde.', 'error');
     643
    643644            return false;
    644645        }
     
    892893            $order = wc_get_order($order_id);
    893894            if ($order->has_status('failed')) {
     895
     896
     897
     898
    894899                $this->belluno_add_notice('Ocorreu um erro ao processar seu pagamento: ' . $response->transaction->reason);
    895900                return;
     
    902907            }
    903908        }
     909
     910
     911
     912
     913
     914
     915
     916
     917
     918
     919
     920
     921
     922
     923
     924
     925
     926
     927
     928
     929
     930
     931
     932
     933
     934
     935
     936
     937
     938
     939
     940
    904941    }
    905942
     
    12361273    protected function belluno_add_notice($message, $type = 'error')
    12371274    {
     1275
     1276
     1277
     1278
    12381279        return wc_add_notice($message, $type);
    12391280    }
  • wc-belluno/trunk/includes/functions-belluno.php

    r3098762 r3115658  
    249249{
    250250    $chosen_payment_method = WC()->session->get('chosen_payment_method');
    251     $installment_number = WC()->session->get('installment_number');
     251
     252    if (!is_null(WC()->session->get('installment_number'))) {
     253        $installment_number = WC()->session->get('installment_number');
     254    } else {
     255        $installment_number = 1;
     256    }
     257
     258    if (!is_null(WC()->session->get('chosen_payment_method'))) {
     259        $chosen_payment_method = WC()->session->get('chosen_payment_method');
     260    } else {
     261        $chosen_payment_method = '';
     262    }
     263
    252264
    253265    if (
     
    291303        // Add fee with updated amount
    292304        $cart->add_fee($fee_name, $fee_amount, false);
    293     } 
     305    }
    294306}
    295307
  • wc-belluno/trunk/readme.txt

    r3108946 r3115658  
    100100== Changelog ==
    101101
     102
     103
     104
     105
     106
     107
     108
     109
    102110= v5.0.5 (24/06/2024) =
    103111* Fix
  • wc-belluno/trunk/woocommerce-belluno.php

    r3108946 r3115658  
    44 * Plugin Name: Gateway de pagamento Belluno
    55 * Description: Gateway de pagamento Belluno para WooCommerce.
    6  * Version: 5.0.5
     6 * Version: 5.0.
    77 * Author: Belluno Digital Bank
    88 * Author URI: https://belluno.digital/
     
    132132                include_once 'includes/class-wc-belluno-bankslip.php';
    133133                include_once 'includes/class-wc-belluno-pix.php';
     134
    134135            }
    135136            /**
Note: See TracChangeset for help on using the changeset viewer.