Plugin Directory

Changeset 3160196


Ignore:
Timestamp:
10/01/2024 02:52:35 AM (17 months ago)
Author:
9pay
Message:

Update fix some bugs from default data

Location:
9pay-gateway/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 9pay-gateway/trunk/includes/gateways/core/config.php

    r2919019 r3160196  
    2222
    2323        'exc_rate_host_production'  => 'https://payment.9pay.vn/exchange-rate',
    24         'exc_rate_host_sand'        => 'https://sand-portal.9pay.vn/exchange-rate',
     24        'exc_rate_host_sand'        => 'https://sand-payment.9pay.vn/exchange-rate',
    2525    ),
    2626    'min_amount'                 => 2000,
  • 9pay-gateway/trunk/mc-ninepay.php

    r2919019 r3160196  
    327327
    328328        $all_currencies = json_decode( $result, true );
     329        if($currency === "VND") return 1;
    329330        return $all_currencies[ $currency ]['rate'];
    330331    }
     
    748749        if ( 'ninepay-gateway' === WC()->session->get( 'chosen_payment_method' ) ) {
    749750            $payment     = new WC_Payment_Gateways();
     751           
     752            $ninepay_payment_method = sanitize_text_field( wp_unslash( $_POST['ninepay_payment_method'] ) );
     753   
    750754            $config      = $payment->get_available_payment_gateways()['ninepay-gateway']->settings;
    751755            $config_lang = include 'includes/gateways/core/lang.php';
    752756            $lang        = $config['ninepay_lang'];
    753             if(empty($_POST['post_data'])) {
    754                 return;
    755             }
     757            if(empty($_POST['post_data'])) {
     758                return;
     759            }
    756760            $post_data = sanitize_text_field( wp_unslash( $_POST['post_data'] ) );
    757761            if ( is_null( $post_data ) ) {
     
    763767            $total_amount = $cart->cart_contents_total;
    764768
    765             $fee = ninepay_add_fee( $ninepay_payment_method, $total_amount, $config );
     769            $fee = !empty($ninepay_payment_method) ? ninepay_add_fee( $ninepay_payment_method, $total_amount, $config ) : 0;
    766770
    767771            if ( $fee !== 0 ) {
Note: See TracChangeset for help on using the changeset viewer.