Plugin Directory

Changeset 3262651


Ignore:
Timestamp:
03/27/2025 09:10:06 AM (12 months ago)
Author:
sepayteam
Message:

improve webhook URL generation logic

Location:
sepay-gateway/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sepay-gateway/trunk/includes/class-wc-gateway-sepay.php

    r3253700 r3262651  
    3434        $this->supports = ['products'];
    3535
    36         $this->init_form_fields();
     36        if (is_admin()) {
     37            $this->init_form_fields();
     38        }
    3739        $this->init_settings();
    3840
  • sepay-gateway/trunk/includes/class-wc-sepay-api.php

    r3257439 r3262651  
    290290    {
    291291        $api_key = wp_generate_password(32, false);
    292         $webhook_url = home_url('/wp-json/sepay-gateway/v2/add-payment');
     292
     293        $api_path = 'sepay-gateway/v2/add-payment';
     294        $webhook_url = get_option('permalink_structure') ? '/wp-json/' . $api_path : '/?rest_route=/' . $api_path;
     295        $webhook_url = home_url($webhook_url);
    293296
    294297        if ($webhook_id) {
     
    303306                'is_verify_payment' => 1,
    304307                'skip_if_no_code' => 1,
     308                'only_va' => 0,
    305309                'active' => 1,
    306310            ]);
     
    316320                'is_verify_payment' => 1,
    317321                'skip_if_no_code' => 1,
     322                'only_va' => 0,
    318323                'active' => 1,
    319324            ]);
  • sepay-gateway/trunk/readme.txt

    r3257439 r3262651  
    44 - Tags: woocommerce, payment gateway, vietqr, ngan hang, thanh toan
    55 - Requires WooCommerce at least: 2.1
    6  - Stable Tag: 1.1.2
    7  - Version: 1.1.2
     6 - Stable Tag: 1.1.3
     7 - Version: 1.1.3
    88 - Tested up to: 6.6
    99 - Requires at least: 5.6
  • sepay-gateway/trunk/sepay-gateway.php

    r3257439 r3262651  
    66 * Author: SePay Team
    77 * Author URI: https://sepay.vn/
    8  * Version: 1.1.2
     8 * Version: 1.1.3
    99 * Requires Plugins: woocommerce
    1010 * Text Domain: sepay-gateway
Note: See TracChangeset for help on using the changeset viewer.