Plugin Directory

Changeset 3814679


Ignore:
Timestamp:
11/21/2026 01:30:47 AM (less than one hour ago)
Author:
thenticpay
Message:

Release 1.0.11: Add simplified crypto checkout

Location:
thentic-pay/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • thentic-pay/trunk/assets/thentic-blocks.js

    r3570360 r3814679  
    1212    var chainTokens = settings.chainTokens || {};
    1313    var chains = Object.keys(chainTokens);
     14    var hideSelectors = settings.hideSelectors === true;
    1415
    1516    // Label
    … …  
    9293            { style: { marginTop: '12px' } },
    9394            createElement('p', { style: { fontSize: '14px', color: '#666', marginBottom: '12px' } }, description),
    94             createElement(
     95            !hideSelectors ? createElement(
    9596                'div',
    9697                { style: { display: 'flex', gap: '12px', flexWrap: 'wrap', marginBottom: '10px' } },
    … …  
    129130                    )
    130131                )
    131             ),
     132            ) : null,
    132133            createElement(
    133134                'p',
  • thentic-pay/trunk/class-thentic-blocks.php

    r3765020 r3814679  
    2424            plugin_dir_url(__FILE__) . 'assets/thentic-blocks.js',
    2525            ['wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities'],
    26             '1.0.10',
     26            '1.0.11',
    2727            true
    2828        );
    … …  
    3737            'icon'        => plugin_dir_url(__FILE__) . 'assets/thentic_logo.png',
    3838            'chainTokens' => $chain_tokens,
     39            'hideSelectors' => ($this->settings['hide_token_network_selection'] ?? 'no') === 'yes',
    3940            'supports'    => ['products'],
    4041        ];
  • thentic-pay/trunk/class-thentic-gateway.php

    r3570360 r3814679  
    8686            'merchant_id' => ['title' => 'Thentic Merchant ID', 'type' => 'text', 'description' => 'Your merchant ID from thentic.tech/pay', 'placeholder' => 'e.g. my-store-123', 'desc_tip' => true],
    8787            'wallet_address' => ['title' => 'Recipient Wallet Address', 'type' => 'text', 'description' => 'Your EVM-compatible wallet address (0x..., 42 characters).', 'placeholder' => '0x...', 'desc_tip' => true],
     88            'hide_token_network_selection' => ['title' => 'Simplified Checkout', 'type' => 'checkbox', 'label' => 'Hide network and token selectors and use the first enabled network and its first enabled token', 'default' => 'no', 'description' => 'Customers will not choose a network or token. Thentic Pay will use the first enabled network and its first enabled token from the settings below.'],
    8889            'include_commission' => ['title' => 'Include 1% Commission', 'type' => 'checkbox', 'label' => 'Add 1% Thentic Pay commission on top of order total', 'default' => 'no'],
    8990            'chains_tokens_header' => ['title' => 'Supported Chains & Tokens', 'type' => 'title', 'description' => 'Choose which blockchains and stablecoins your customers can pay with.'],
    … …  
    113114    }
    114115
     116    public function get_default_chain_token() {
     117        $active = $this->get_active_chain_tokens();
     118        $chain = !empty($active) ? array_key_first($active) : '';
     119        return [
     120            'chain' => $chain,
     121            'token' => ($chain && !empty($active[$chain])) ? $active[$chain][0] : '',
     122        ];
     123    }
     124
    115125    // ─── Currency Conversion ─────────────────────────────────────────────────
    116126    /**
    … …  
    175185        }
    176186
     187        $hide_selectors = $this->get_option('hide_token_network_selection', 'no') === 'yes';
    177188        echo '<div class="thentic-pay-fields">';
    178         echo '<div class="thentic-field-row">';
     189        echo '<div class="thentic-field-row"' . ($hide_selectors ? ' style="display:none"' : '') . '>';
    179190
    180191        echo '<div class="thentic-field-group">';
    … …  
    210221        $token = isset($_POST['thentic_token']) ? sanitize_text_field(wp_unslash($_POST['thentic_token'])) : '';
    211222        // phpcs:enable WordPress.Security.NonceVerification.Missing
     223
     224        if ($this->get_option('hide_token_network_selection', 'no') === 'yes') {
     225            $defaults = $this->get_default_chain_token();
     226            $chain = $defaults['chain'];
     227            $token = $defaults['token'];
     228        }
    212229
    213230        if (empty($chain)) {
    … …  
    256273        $selected_token = isset($_POST['thentic_token']) ? sanitize_text_field(wp_unslash($_POST['thentic_token'])) : 'USDT';
    257274        // phpcs:enable WordPress.Security.NonceVerification.Missing
     275
     276        if ($this->get_option('hide_token_network_selection', 'no') === 'yes') {
     277            $defaults = $this->get_default_chain_token();
     278            $selected_chain = $defaults['chain'];
     279            $selected_token = $defaults['token'];
     280        }
     281        $active = $this->get_active_chain_tokens();
     282        if (!isset($active[$selected_chain]) || !in_array($selected_token, $active[$selected_chain], true)) {
     283            wc_add_notice(__('Invalid payment network or token configuration.', 'thentic-pay'), 'error');
     284            return;
     285        }
    258286
    259287        if (empty($merchant_id) || empty($wallet_address)) {
  • thentic-pay/trunk/readme.txt

    r3765020 r3814679  
    55Tested up to: 7.0
    66Requires PHP: 7.4
    7 Stable tag: 1.0.10
     7Stable tag: 1.0.11
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    9797== Changelog ==
    9898
     99= 1.0.11 =
     100* Added optional simplified checkout that hides network and token selection while submitting the first enabled network and token.
     101
    99102= 1.0.10 =
    100103* Fixed oversized payment method icon on WooCommerce checkout pages.
  • thentic-pay/trunk/thentic-pay.php

    r3765020 r3814679  
    44 * Plugin URI: https://thentic.tech/woocommerce
    55 * Description: Accept crypto payments directly to your wallet. 30+ tokens across 12 blockchains. No KYC. No custodian. Works with WooCommerce. Powered by Thentic Pay.
    6  * Version: 1.0.10
     6 * Version: 1.0.11
    77 * Author: Thentic Pay
    88 * Author URI: https://thentic.tech
    … …  
    2828
    2929// ── Reset stale settings on plugin update ────────────────────────────────────
    30 define('THENTIC_PAY_VERSION', '1.0.10');
     30define('THENTIC_PAY_VERSION', '1.0.11');
    3131add_action('plugins_loaded', 'thentic_maybe_update_settings');
    3232function thentic_maybe_update_settings() {
Note: See TracChangeset for help on using the changeset viewer.