Plugin Directory

Changeset 3269720


Ignore:
Timestamp:
04/09/2025 01:13:03 PM (12 months ago)
Author:
sepayteam
Message:

tagging version 1.1.4

Location:
sepay-gateway
Files:
5 deleted
3 edited
10 copied

Legend:

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

    r3262651 r3269720  
    363363            'type' => 'select',
    364364            'description' => 'Chọn trạng thái đơn hàng khi thanh toán hoàn tất. Nếu chọn "Không chỉ định", trạng thái đơn hàng sẽ được xử lý theo luồng của WooCommerce.',
    365             'options' => [
    366                 'not_set' => 'Không chỉ định',
    367                 'processing' => 'Đang xử lý',
    368                 'completed' => 'Hoàn thành',
    369             ],
     365            'options' => $this->getWcOrderStatuses(),
    370366            'default' => 'processing',
    371367            'desc_tip' => true,
     
    504500                'desc_tip'    => true,
    505501                'description' => 'Trạng thái đơn hàng sau khi thanh toán thành công. Nếu bạn không chỉ định, trạng thái đơn hàng sẽ được xử lý theo luồng của WooCommerce.',
    506                 'options'  => array(
    507                     'not_set' => 'Không chỉ định',
    508                     'processing' => 'Đang xử lý (Processing)',
    509                     'completed' => 'Đã hoàn tất (Completed)',
    510                 ),
     502                'options'  => $this->getWcOrderStatuses(),
     503                'default' => 'processing',
    511504            ),
    512505            'download_mode' => array(
     
    533526            ),
    534527        );
     528    }
     529
     530    public function getWcOrderStatuses(): array
     531    {
     532        $statuses = wc_get_order_statuses();
     533        $result = [];
     534       
     535        foreach ($statuses as $key => $label) {
     536            $result[str_replace('wc-', '', $key)] = $label;
     537        }
     538
     539        return $result;
    535540    }
    536541
     
    654659            'ajax_url' => esc_url(admin_url('admin-ajax.php')),
    655660            'order_code' => $this->get_option('pay_code_prefix') . $order_id,
    656             'account_number' => $this->api->is_connected() ? $this->cached_bank_account_data['account_number'] : $this->get_option('bank_account_number'),
     661            'account_number' => $this->api->is_connected() ? ($this->get_option('sub_account') ?: $this->cached_bank_account_data['account_number']) : $this->get_option('bank_account_number'),
    657662            'remark' => $this->get_remark($order_id),
    658663            'amount' => $order->get_total(),
  • sepay-gateway/tags/1.1.4/readme.txt

    r3262651 r3269720  
    44 - Tags: woocommerce, payment gateway, vietqr, ngan hang, thanh toan
    55 - Requires WooCommerce at least: 2.1
    6  - Stable Tag: 1.1.3
    7  - Version: 1.1.3
     6 - Stable Tag: 1.1.4
     7 - Version: 1.1.4
    88 - Tested up to: 6.6
    99 - Requires at least: 5.6
     
    5252
    5353== CHANGELOG ==
     5410/04/2025:
     55- [Cập nhật] Mở rộng tùy chọn trạng thái đơn hàng sau khi thanh toán thành công. Giờ đây có thể chọn từ tất cả các trạng thái đơn hàng của WooCommerce thay vì chỉ giới hạn ở "Đang xử lý" và "Hoàn thành".
     56- [Fix lỗi] Copy số tài khoản không đúng ở trang thanh toán
    5457
    555811/03/2025:
  • sepay-gateway/tags/1.1.4/sepay-gateway.php

    r3262651 r3269720  
    66 * Author: SePay Team
    77 * Author URI: https://sepay.vn/
    8  * Version: 1.1.3
     8 * Version: 1.1.4
    99 * Requires Plugins: woocommerce
    1010 * Text Domain: sepay-gateway
     
    340340        );
    341341
     342        $order_status_when_completed = $sepay_gateway->get_option('order_when_completed') ?: OrderStatus::PROCESSING;
    342343        if ($order_total === $parameters['transferAmount']) {
    343             if (in_array($sepay_gateway->get_option('order_when_completed'), ['processing', 'completed'])) {
    344                 $order->update_status($sepay_gateway->get_option('order_when_completed'));
     344            if (in_array($order_status_when_completed, array_keys($sepay_gateway->getWcOrderStatuses()))) {
     345                $order->update_status($order_status_when_completed);
    345346            } else {
    346347                $order->payment_complete();
     
    352353                $order_note,
    353354                wc_get_order_status_name($order_status),
    354                 wc_get_order_status_name(OrderStatus::COMPLETED)
     355                wc_get_order_status_name($order_status_when_completed)
    355356            );
    356357        } else if ($order_total > $parameters['transferAmount']) {
  • sepay-gateway/trunk/includes/class-wc-gateway-sepay.php

    r3262651 r3269720  
    363363            'type' => 'select',
    364364            'description' => 'Chọn trạng thái đơn hàng khi thanh toán hoàn tất. Nếu chọn "Không chỉ định", trạng thái đơn hàng sẽ được xử lý theo luồng của WooCommerce.',
    365             'options' => [
    366                 'not_set' => 'Không chỉ định',
    367                 'processing' => 'Đang xử lý',
    368                 'completed' => 'Hoàn thành',
    369             ],
     365            'options' => $this->getWcOrderStatuses(),
    370366            'default' => 'processing',
    371367            'desc_tip' => true,
     
    504500                'desc_tip'    => true,
    505501                'description' => 'Trạng thái đơn hàng sau khi thanh toán thành công. Nếu bạn không chỉ định, trạng thái đơn hàng sẽ được xử lý theo luồng của WooCommerce.',
    506                 'options'  => array(
    507                     'not_set' => 'Không chỉ định',
    508                     'processing' => 'Đang xử lý (Processing)',
    509                     'completed' => 'Đã hoàn tất (Completed)',
    510                 ),
     502                'options'  => $this->getWcOrderStatuses(),
     503                'default' => 'processing',
    511504            ),
    512505            'download_mode' => array(
     
    533526            ),
    534527        );
     528    }
     529
     530    public function getWcOrderStatuses(): array
     531    {
     532        $statuses = wc_get_order_statuses();
     533        $result = [];
     534       
     535        foreach ($statuses as $key => $label) {
     536            $result[str_replace('wc-', '', $key)] = $label;
     537        }
     538
     539        return $result;
    535540    }
    536541
     
    654659            'ajax_url' => esc_url(admin_url('admin-ajax.php')),
    655660            'order_code' => $this->get_option('pay_code_prefix') . $order_id,
    656             'account_number' => $this->api->is_connected() ? $this->cached_bank_account_data['account_number'] : $this->get_option('bank_account_number'),
     661            'account_number' => $this->api->is_connected() ? ($this->get_option('sub_account') ?: $this->cached_bank_account_data['account_number']) : $this->get_option('bank_account_number'),
    657662            'remark' => $this->get_remark($order_id),
    658663            'amount' => $order->get_total(),
  • sepay-gateway/trunk/readme.txt

    r3262651 r3269720  
    44 - Tags: woocommerce, payment gateway, vietqr, ngan hang, thanh toan
    55 - Requires WooCommerce at least: 2.1
    6  - Stable Tag: 1.1.3
    7  - Version: 1.1.3
     6 - Stable Tag: 1.1.4
     7 - Version: 1.1.4
    88 - Tested up to: 6.6
    99 - Requires at least: 5.6
     
    5252
    5353== CHANGELOG ==
     5410/04/2025:
     55- [Cập nhật] Mở rộng tùy chọn trạng thái đơn hàng sau khi thanh toán thành công. Giờ đây có thể chọn từ tất cả các trạng thái đơn hàng của WooCommerce thay vì chỉ giới hạn ở "Đang xử lý" và "Hoàn thành".
     56- [Fix lỗi] Copy số tài khoản không đúng ở trang thanh toán
    5457
    555811/03/2025:
  • sepay-gateway/trunk/sepay-gateway.php

    r3262651 r3269720  
    66 * Author: SePay Team
    77 * Author URI: https://sepay.vn/
    8  * Version: 1.1.3
     8 * Version: 1.1.4
    99 * Requires Plugins: woocommerce
    1010 * Text Domain: sepay-gateway
     
    340340        );
    341341
     342        $order_status_when_completed = $sepay_gateway->get_option('order_when_completed') ?: OrderStatus::PROCESSING;
    342343        if ($order_total === $parameters['transferAmount']) {
    343             if (in_array($sepay_gateway->get_option('order_when_completed'), ['processing', 'completed'])) {
    344                 $order->update_status($sepay_gateway->get_option('order_when_completed'));
     344            if (in_array($order_status_when_completed, array_keys($sepay_gateway->getWcOrderStatuses()))) {
     345                $order->update_status($order_status_when_completed);
    345346            } else {
    346347                $order->payment_complete();
     
    352353                $order_note,
    353354                wc_get_order_status_name($order_status),
    354                 wc_get_order_status_name(OrderStatus::COMPLETED)
     355                wc_get_order_status_name($order_status_when_completed)
    355356            );
    356357        } else if ($order_total > $parameters['transferAmount']) {
Note: See TracChangeset for help on using the changeset viewer.