Plugin Directory

Changeset 3282559


Ignore:
Timestamp:
04/27/2025 03:01:08 AM (11 months ago)
Author:
mustangpay
Message:

Initial plugin release

Location:
mustangpay/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mustangpay/trunk/mustangpay.php

    r3281618 r3282559  
    44 * Plugin URI:  https://www.mustangpay.co.za
    55 * Description: South Africa's trusted payment gateway offering secure card payments and EFT services.
    6  * Version:     1.1.1
     6 * Version:     1.1.2
    77 * Author:      MustangPay
    88 * Author URI:  https://www.mustangpay.co.za/contact-us
  • mustangpay/trunk/readme.txt

    r3281623 r3282559  
    55Tested up to: 6.7
    66Requires PHP: 7.4
    7 Stable tag: 1.1.1
     7Stable tag: 1.1.2
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • mustangpay/trunk/src/MustangpayApiUtilsV1.php

    r3281526 r3282559  
    122122           
    123123            if (empty($merchant_id)) {
    124                 wp_send_json_error(array('message' => __( 'Please configure Merchant Id', 'mustangpay' )));
     124               
     125                return  array(
     126                        'status' =>0,
     127                        'message'=>__( 'Please configure Merchant Id', 'mustangpay' )
     128                    );
    125129            }
    126130           
     
    131135               
    132136                if (empty($config->get_option('rsaPrivateKey_test'))) {
    133                     wp_send_json_error(array('message' => __( 'Please configure rsaPrivateKey_test', 'mustangpay' )));
     137                   
     138                    return  array(
     139                        'status' =>0,
     140                        'message'=>__( 'Please configure rsaPrivateKey_test', 'mustangpay' )
     141                    );
     142                   
    134143                }
    135144               
     
    138147               
    139148                if (empty($config->get_option('rsaPrivateKey'))) {
    140                     wp_send_json_error(array('message' => __( 'Please configure rsaPrivateKey', 'mustangpay' )));
     149                   
     150                     return  array(
     151                        'status' =>0,
     152                        'message'=>__( 'Please configure rsaPrivateKey', 'mustangpay' )
     153                    ); 
    141154                }
    142155               
  • mustangpay/trunk/src/PaymentGateway.php

    r3281526 r3282559  
    7777    }
    7878   
     79function timed_redirect_with_message($msg) {
     80    // 提示信息
     81    $message = $msg.',The page will jump in 3 seconds.';
     82    // 跳转目标URL
     83    //$redirect_url = $url;
     84    // 跳转等待时间(秒)
     85    $delay = 3;
     86
     87    $redirect_url = home_url('index.php/checkout/');
     88
     89    // 输出包含提示信息和JavaScript定时跳转代码的HTML
     90    echo '<div style="padding: 20px; background-color: #f0f0f0; text-align: center;">';
     91    echo '<p>'. esc_html( $message ). '</p>';
     92    echo '<script type="text/javascript">';
     93    echo 'setTimeout(function() { window.location.href = "'. esc_url( $redirect_url ). '"; }, '. ( $delay * 1000 ). ');';
     94    echo '</script>';
     95    echo '</div>';
     96}
     97
    7998    /**
    8099     * Gateway settings
     
    240259        if(!$order||(method_exists($order, 'is_paid')?$order->is_paid():in_array($order->get_status(),  array( 'processing', 'completed' )))){
    241260           
    242             $return_url= $order->get_checkout_order_received_url();
     261            //$return_url= $order->get_checkout_order_received_url();
    243262           
     263            $return_url = home_url('index.php/checkout/');
    244264           /* return array(
    245265                 'result'   => 'success',
     
    296316        $order = wc_get_order( $order_id );
    297317       
    298         $pagrurl=$this->getCurrentUrl();
    299        
     318        //$pagrurl=$this->getCurrentUrl();
     319        $pagrurl = home_url('index.php/checkout/');
    300320        //var_dump($pagrurl);
    301321       
     
    327347        $notify_url= WC()->api_request_url('hpj-wc-wechatpay-notify');
    328348       
     349       
     350
    329351       
    330352        $return_url= $order->get_checkout_order_received_url();
     
    372394                exit;
    373395        }else{
    374              wp_send_json_error($data['message']);
     396            //exit;
     397            //$this->timed_redirect_with_message($data['message']);
     398            wp_send_json_error($data['message']);
    375399        } 
    376400        ?>
    377             <div class="pay-weixin-design">
     401            <div class="pay-weixin-design" hidden>
    378402           
    379403                 <div class="p-w-center" style="padding:15px">
     
    494518                }
    495519        ";
    496         wp_enqueue_style('mustangpay-css',get_stylesheet_uri());
    497         wp_add_inline_style('mustangpay-css', $inline_css);
     520       // wp_enqueue_style('mustangpay-css',get_stylesheet_uri());
     521       // wp_add_inline_style('mustangpay-css', $inline_css);
    498522       /* $nonce=wp_create_nonce('mustangpay');
    499523        var_dump($nonce);exit;*/
     
    629653
    630654
    631         wp_register_script( 'mustangpay-js', false );
    632         wp_enqueue_script( 'mustangpay-js' );
     655       // wp_register_script( 'mustangpay-js', false );
     656     //   wp_enqueue_script( 'mustangpay-js' );
    633657
    634658       
    635659       
    636         //$safe_js = wp_json_encode($inline_js);
    637         wp_add_inline_script('mustangpay-js',$inline_js);
     660      //  wp_add_inline_script('mustangpay-js',$inline_js);
    638661         
    639662         
Note: See TracChangeset for help on using the changeset viewer.