Plugin Directory

Changeset 3447683


Ignore:
Timestamp:
01/27/2026 09:35:04 AM (6 weeks ago)
Author:
paystack
Message:

Update to version 1.1.1 from GitHub

Location:
paystack-for-events-calendar
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • paystack-for-events-calendar/tags/1.1.1/classes/REST/Order_Endpoint.php

    r3012402 r3447683  
    3939     * @var string
    4040     */
    41     protected $path = '/commerce/paystack/order';
     41    protected string $path = '/commerce/paystack/order';
    4242
    4343    /**
  • paystack-for-events-calendar/tags/1.1.1/classes/class-gateway.php

    r3012402 r3447683  
    1818     * @inheritDoc
    1919     */
    20     protected static $key = 'paystack';
    21 
    22     /**
    23      * @inheritDoc
    24      */
    25     protected static $settings = Settings::class;
    26 
    27     /**
    28      * @inheritDoc
    29      */
    30     protected static $merchant = Merchant::class;
    31 
    32     /**
    33      * @inheritDoc
    34      */
    35     protected static $supported_currencies = array( 'NGN', 'GHS', 'USD', 'KES', 'ZAR', 'XOF', 'EGP' );
    36 
     20    protected static string $key = 'paystack';
     21
     22    /**
     23     * @inheritDoc
     24     */
     25    protected static string $settings = Settings::class;
     26
     27    /**
     28     * @inheritDoc
     29     */
     30    protected static string $merchant = Merchant::class;
     31
     32    /**
     33     * @inheritDoc
     34     */
     35    protected static array $supported_currencies = array(       
     36        'NGN' => array(
     37            'code'   => 'NGN',
     38            'symbol' => '₦',
     39            'entity' => '₦',
     40        ),
     41        'GHS' => array(
     42            'code'   => 'GHS',
     43            'symbol' => '₵',
     44            'entity' => '₵',
     45        ),
     46        'USD' => array(
     47            'code'   => 'USD',
     48            'symbol' => '$',
     49            'entity' => '$',
     50        ),
     51        'KES' => array(
     52            'code'   => 'KES',
     53            'symbol' => 'KSh',
     54            'entity' => 'KSh',
     55        ),
     56        'ZAR' => array(
     57            'code'   => 'ZAR',
     58            'symbol' => 'R',
     59            'entity' => 'R',
     60        ),
     61        'XOF' => array(
     62            'code'   => 'XOF',
     63            'symbol' => 'CFA',
     64            'entity' => 'CFA',
     65        ),
     66        'EGP' => array(
     67            'code'   => 'EGP',
     68            'symbol' => '£',
     69            'entity' => '£',
     70        )
     71    );
     72   
    3773    /**
    3874     * @inheritDoc
     
    85121        // If option is not explicitly set, the default will be if Paystack is connected.
    86122        return static::is_connected();
     123    }
     124
     125    /**
     126     * Check if a currency is supported by Paystack.
     127     *
     128     * @param string $currency_code The currency code to check.
     129     * @return bool True if supported, false otherwise.
     130     */
     131    public static function is_currency_supported( $currency_code ) {
     132        return isset( static::$supported_currencies[ $currency_code ] );
    87133    }
    88134
  • paystack-for-events-calendar/tags/1.1.1/classes/class-merchant.php

    r3440377 r3447683  
    263263
    264264    /**
     265     * Save merchant data to database.
     266     *
     267     * @since 5.1.9
     268     *
     269     * @return bool
     270     */
     271    public function save() {
     272        error_log( 'Merchant Save: needs_save = ' . ( $this->needs_save() ? 'TRUE' : 'FALSE' ) );
     273       
     274        if ( ! $this->needs_save() ) {
     275            error_log( 'Merchant Save: No changes to save, returning true' );
     276            return true; // No changes to save
     277        }
     278
     279        $data = $this->to_array();
     280        $account_key = $this->get_account_key();
     281       
     282        error_log( 'Merchant Save: account_key = ' . $account_key );
     283        error_log( 'Merchant Save: data = ' . print_r( $data, true ) );
     284       
     285        $result = update_option( $account_key, $data );
     286       
     287        error_log( 'Merchant Save: update_option result = ' . ( $result ? 'SUCCESS' : 'FAILED' ) );
     288       
     289        if ( $result ) {
     290            $this->needs_save = false; // Reset the flag after successful save
     291        }
     292       
     293        return $result;
     294    }
     295
     296    /**
    265297     * Disconnects the merchant completely.
    266298     *
     
    342374
    343375    /**
    344      * Save merchant data to WordPress options.
    345      *
    346      * @since 5.1.9
    347      *
    348      * @return bool Whether the save was successful.
    349      */
    350     public function save() {
    351         if ( ! $this->needs_save() ) {
    352             return true; // No changes to save
    353         }
    354 
    355         $data = $this->to_array();
    356         $account_key = $this->get_account_key();
    357        
    358         $result = update_option( $account_key, $data );
    359        
    360         if ( $result ) {
    361             $this->needs_save = false; // Reset the flag after successful save
    362         }
    363        
    364         return $result;
     376     * Gets the client secret for merchant.
     377     *
     378     * @since 5.24.0
     379     *
     380     * @return ?string
     381     */
     382    public function get_client_secret(): ?string {
     383        if ( 'test' === $this->paystack_mode ) {
     384            return $this->secret_key_test ?: null;
     385        } elseif ( 'live' === $this->paystack_mode ) {
     386            return $this->secret_key_live ?: null;
     387        }
     388       
     389        return null;
    365390    }
    366391}
  • paystack-for-events-calendar/tags/1.1.1/classes/class-provider.php

    r3440377 r3447683  
    1414        $this->container->singleton( Gateway::class );
    1515
     16       
    1617        // Register Paystack as an available payment gateway
    1718        add_filter( 'tec_tickets_commerce_gateways', array( $this, 'register_paystack_gateway' ) );
     
    3031        require_once( PS_TEC_PATH . '/classes/class-settings.php' );
    3132        $this->container->singleton( Settings::class );
    32         add_action( 'tribe_settings_save_tab_paystack', '\paystack\tec\classes\Settings::update_settings', 10, 1 );
     33add_action( 'tribe_settings_save_tab_paystack', '\paystack\tec\classes\Settings::update_settings', 10, 1 );
    3334
    3435        //$this->container->singleton( Refresh_Token::class );
     
    8485    }
    8586
     87   
    8688    /**
    8789     * Register Paystack as an available gateway.
     
    148150                'code'     => 'XOF',
    149151                'symbol'   => 'CFA',
    150                 'name'     => 'West African CFA franc',
     152                'name'     => 'West African CFA Franc',
    151153                'decimals' => 0,
    152154            ),
  • paystack-for-events-calendar/tags/1.1.1/classes/class-settings.php

    r2847454 r3447683  
    189189    public static function update_settings() {
    190190        $section = tribe_get_request_var( 'tc-section', false );
     191       
     192        // Debug logging
     193        error_log( 'Paystack Settings: tc-section = ' . $section );
     194        error_log( 'Paystack Settings: POST data = ' . print_r( $_POST, true ) );
     195       
    191196        if ( 'paystack' === $section ) {
    192197            $merchant = tribe( Merchant::class );
    193198
    194199            foreach ( self::$fields as $key => $value ) {
    195                 $to_save = tribe_get_request_var( self::$field_prefix . $key, $value );
     200                $field_name = self::$field_prefix . $key;
     201                $to_save = tribe_get_request_var( $field_name, $value );
     202               
     203                // Debug logging for each field
     204                error_log( "Paystack Settings: Looking for field '{$field_name}', found: '{$to_save}'" );
     205               
    196206                $merchant->set_prop( $key, $to_save );
    197207            }
    198208
    199             $merchant->save();
     209            $save_result = $merchant->save();
     210            error_log( 'Paystack Settings: Save result = ' . ( $save_result ? 'SUCCESS' : 'FAILED' ) );
    200211        }
    201212    }
  • paystack-for-events-calendar/tags/1.1.1/package.json

    r3243741 r3447683  
    11{
    22    "name": "tec-paystack",
    3     "version": "1.0.7",
     3    "version": "1.1.1",
    44    "description": "Paystack for The Events Calendar",
    55    "scripts": {
  • paystack-for-events-calendar/tags/1.1.1/paystack-tec.php

    r3440377 r3447683  
    55 * Description: Add-on for The Event Calendar that allows you to accept payments for event tickets via Paystack
    66 * Author:      Paystack
    7  * Version:     1.1.0
     7 * Version:     1.1.1
    88 * Author URI:  https://paystack.com/
    99 * License:     GPL3
     
    2020define( 'PS_TEC_CORE', __FILE__ );
    2121define( 'PS_TEC_URL', plugin_dir_url( __FILE__ ) );
    22 define( 'PS_TEC_VER', '1.1.0' );
     22define( 'PS_TEC_VER', '1.1.1' );
    2323
    2424/* ======================= Below is the Plugin Class init ========================= */
  • paystack-for-events-calendar/tags/1.1.1/paystack/admin-views/connect/active.php

    r2847454 r3447683  
    2121?>
    2222<div class="tec-tickets__admin-settings-tickets-commerce-gateway-connected">
     23   
     24    <!-- Hidden field to identify this as paystack section -->
     25    <input type="hidden" name="tc-section" value="paystack" />
     26
     27    <!-- Add save button for connected state -->
     28    <div class="tec-tickets__admin-settings-tickets-commerce-gateway-connect-button">
     29        <input
     30            type="submit"
     31            name="tribeSaveSettings"
     32            class="button button-primary"
     33            value="<?php esc_attr_e( 'Save Settings', 'paystack-for-events-calendar' ); ?>"
     34        />
     35    </div>
     36
    2337    <h3><?php esc_html_e( 'Additional Settings', 'paystack-for-events-calendar' ); ?></h3>
    2438    <?php
  • paystack-for-events-calendar/tags/1.1.1/paystack/admin-views/connect/inactive.php

    r2846787 r3447683  
    1919
    2020    <div class="tec-tickets__admin-settings-tickets-commerce-gateway-signup-links">
     21
     22        <!-- Hidden field to identify this as paystack section -->
     23        <input type="hidden" name="tc-section" value="paystack" />
     24       
    2125        <?php
    2226        echo wp_kses(
  • paystack-for-events-calendar/tags/1.1.1/readme.txt

    r3440377 r3447683  
    44Requires at least: 5.8.6
    55Tested up to: 6.7.2
    6 Stable tag: 1.1.0
     6Stable tag: 1.1.1
    77Requires PHP: 8.0 and higher
    88License: GPL3
     
    4747== Changelog ==
    4848
    49 = 1.1.0 =
    50 * Compatibility with WordPress 6.9 and PHP 8.3.8
    51 * Fix 'Undefined array key NGN' currency errors
    52 * Implement dual currency registration (TEC Commerce + legacy Tribe systems)
    53 * Fix API key saving functionality
    54 * Add comprehensive debug logging for troubleshooting
    55 * Improve admin form structure and eliminate duplicate fields
    56 * Add support for multiple African currencies (NGN, GHS, KES, ZAR, XOF, EGP)
    57 * Enhance merchant data persistence with proper WordPress hooks
    58 
    5949= 1.0.7 =
    6050* Compatibility with WordPress 6.7.2 and PHP 8.3.8
     
    7666== Upgrade Notice ==
    7767
    78 = 1.1.0 =
    79 * Critical fixes for currency support and API key saving
    80 * Compatibility with WordPress 6.9 and PHP 8.3.8
    81 
    8268= 1.0.7 =
    8369* Compatibility with WordPress 6.7.2 and PHP 8.3.8
  • paystack-for-events-calendar/trunk/classes/REST/Order_Endpoint.php

    r3012402 r3447683  
    3939     * @var string
    4040     */
    41     protected $path = '/commerce/paystack/order';
     41    protected string $path = '/commerce/paystack/order';
    4242
    4343    /**
  • paystack-for-events-calendar/trunk/classes/class-gateway.php

    r3012402 r3447683  
    1818     * @inheritDoc
    1919     */
    20     protected static $key = 'paystack';
    21 
    22     /**
    23      * @inheritDoc
    24      */
    25     protected static $settings = Settings::class;
    26 
    27     /**
    28      * @inheritDoc
    29      */
    30     protected static $merchant = Merchant::class;
    31 
    32     /**
    33      * @inheritDoc
    34      */
    35     protected static $supported_currencies = array( 'NGN', 'GHS', 'USD', 'KES', 'ZAR', 'XOF', 'EGP' );
    36 
     20    protected static string $key = 'paystack';
     21
     22    /**
     23     * @inheritDoc
     24     */
     25    protected static string $settings = Settings::class;
     26
     27    /**
     28     * @inheritDoc
     29     */
     30    protected static string $merchant = Merchant::class;
     31
     32    /**
     33     * @inheritDoc
     34     */
     35    protected static array $supported_currencies = array(       
     36        'NGN' => array(
     37            'code'   => 'NGN',
     38            'symbol' => '₦',
     39            'entity' => '&#8358;',
     40        ),
     41        'GHS' => array(
     42            'code'   => 'GHS',
     43            'symbol' => '₵',
     44            'entity' => '₵',
     45        ),
     46        'USD' => array(
     47            'code'   => 'USD',
     48            'symbol' => '$',
     49            'entity' => '&#36;',
     50        ),
     51        'KES' => array(
     52            'code'   => 'KES',
     53            'symbol' => 'KSh',
     54            'entity' => 'KSh',
     55        ),
     56        'ZAR' => array(
     57            'code'   => 'ZAR',
     58            'symbol' => 'R',
     59            'entity' => 'R',
     60        ),
     61        'XOF' => array(
     62            'code'   => 'XOF',
     63            'symbol' => 'CFA',
     64            'entity' => 'CFA',
     65        ),
     66        'EGP' => array(
     67            'code'   => 'EGP',
     68            'symbol' => '£',
     69            'entity' => '&#163;',
     70        )
     71    );
     72   
    3773    /**
    3874     * @inheritDoc
     
    85121        // If option is not explicitly set, the default will be if Paystack is connected.
    86122        return static::is_connected();
     123    }
     124
     125    /**
     126     * Check if a currency is supported by Paystack.
     127     *
     128     * @param string $currency_code The currency code to check.
     129     * @return bool True if supported, false otherwise.
     130     */
     131    public static function is_currency_supported( $currency_code ) {
     132        return isset( static::$supported_currencies[ $currency_code ] );
    87133    }
    88134
  • paystack-for-events-calendar/trunk/classes/class-merchant.php

    r3440377 r3447683  
    263263
    264264    /**
     265     * Save merchant data to database.
     266     *
     267     * @since 5.1.9
     268     *
     269     * @return bool
     270     */
     271    public function save() {
     272        error_log( 'Merchant Save: needs_save = ' . ( $this->needs_save() ? 'TRUE' : 'FALSE' ) );
     273       
     274        if ( ! $this->needs_save() ) {
     275            error_log( 'Merchant Save: No changes to save, returning true' );
     276            return true; // No changes to save
     277        }
     278
     279        $data = $this->to_array();
     280        $account_key = $this->get_account_key();
     281       
     282        error_log( 'Merchant Save: account_key = ' . $account_key );
     283        error_log( 'Merchant Save: data = ' . print_r( $data, true ) );
     284       
     285        $result = update_option( $account_key, $data );
     286       
     287        error_log( 'Merchant Save: update_option result = ' . ( $result ? 'SUCCESS' : 'FAILED' ) );
     288       
     289        if ( $result ) {
     290            $this->needs_save = false; // Reset the flag after successful save
     291        }
     292       
     293        return $result;
     294    }
     295
     296    /**
    265297     * Disconnects the merchant completely.
    266298     *
     
    342374
    343375    /**
    344      * Save merchant data to WordPress options.
    345      *
    346      * @since 5.1.9
    347      *
    348      * @return bool Whether the save was successful.
    349      */
    350     public function save() {
    351         if ( ! $this->needs_save() ) {
    352             return true; // No changes to save
    353         }
    354 
    355         $data = $this->to_array();
    356         $account_key = $this->get_account_key();
    357        
    358         $result = update_option( $account_key, $data );
    359        
    360         if ( $result ) {
    361             $this->needs_save = false; // Reset the flag after successful save
    362         }
    363        
    364         return $result;
     376     * Gets the client secret for merchant.
     377     *
     378     * @since 5.24.0
     379     *
     380     * @return ?string
     381     */
     382    public function get_client_secret(): ?string {
     383        if ( 'test' === $this->paystack_mode ) {
     384            return $this->secret_key_test ?: null;
     385        } elseif ( 'live' === $this->paystack_mode ) {
     386            return $this->secret_key_live ?: null;
     387        }
     388       
     389        return null;
    365390    }
    366391}
  • paystack-for-events-calendar/trunk/classes/class-provider.php

    r3440377 r3447683  
    1414        $this->container->singleton( Gateway::class );
    1515
     16       
    1617        // Register Paystack as an available payment gateway
    1718        add_filter( 'tec_tickets_commerce_gateways', array( $this, 'register_paystack_gateway' ) );
     
    3031        require_once( PS_TEC_PATH . '/classes/class-settings.php' );
    3132        $this->container->singleton( Settings::class );
    32         add_action( 'tribe_settings_save_tab_paystack', '\paystack\tec\classes\Settings::update_settings', 10, 1 );
     33add_action( 'tribe_settings_save_tab_paystack', '\paystack\tec\classes\Settings::update_settings', 10, 1 );
    3334
    3435        //$this->container->singleton( Refresh_Token::class );
     
    8485    }
    8586
     87   
    8688    /**
    8789     * Register Paystack as an available gateway.
     
    148150                'code'     => 'XOF',
    149151                'symbol'   => 'CFA',
    150                 'name'     => 'West African CFA franc',
     152                'name'     => 'West African CFA Franc',
    151153                'decimals' => 0,
    152154            ),
  • paystack-for-events-calendar/trunk/classes/class-settings.php

    r2847454 r3447683  
    189189    public static function update_settings() {
    190190        $section = tribe_get_request_var( 'tc-section', false );
     191       
     192        // Debug logging
     193        error_log( 'Paystack Settings: tc-section = ' . $section );
     194        error_log( 'Paystack Settings: POST data = ' . print_r( $_POST, true ) );
     195       
    191196        if ( 'paystack' === $section ) {
    192197            $merchant = tribe( Merchant::class );
    193198
    194199            foreach ( self::$fields as $key => $value ) {
    195                 $to_save = tribe_get_request_var( self::$field_prefix . $key, $value );
     200                $field_name = self::$field_prefix . $key;
     201                $to_save = tribe_get_request_var( $field_name, $value );
     202               
     203                // Debug logging for each field
     204                error_log( "Paystack Settings: Looking for field '{$field_name}', found: '{$to_save}'" );
     205               
    196206                $merchant->set_prop( $key, $to_save );
    197207            }
    198208
    199             $merchant->save();
     209            $save_result = $merchant->save();
     210            error_log( 'Paystack Settings: Save result = ' . ( $save_result ? 'SUCCESS' : 'FAILED' ) );
    200211        }
    201212    }
  • paystack-for-events-calendar/trunk/package.json

    r3243741 r3447683  
    11{
    22    "name": "tec-paystack",
    3     "version": "1.0.7",
     3    "version": "1.1.1",
    44    "description": "Paystack for The Events Calendar",
    55    "scripts": {
  • paystack-for-events-calendar/trunk/paystack-tec.php

    r3440377 r3447683  
    55 * Description: Add-on for The Event Calendar that allows you to accept payments for event tickets via Paystack
    66 * Author:      Paystack
    7  * Version:     1.1.0
     7 * Version:     1.1.1
    88 * Author URI:  https://paystack.com/
    99 * License:     GPL3
     
    2020define( 'PS_TEC_CORE', __FILE__ );
    2121define( 'PS_TEC_URL', plugin_dir_url( __FILE__ ) );
    22 define( 'PS_TEC_VER', '1.1.0' );
     22define( 'PS_TEC_VER', '1.1.1' );
    2323
    2424/* ======================= Below is the Plugin Class init ========================= */
  • paystack-for-events-calendar/trunk/paystack/admin-views/connect/active.php

    r2847454 r3447683  
    2121?>
    2222<div class="tec-tickets__admin-settings-tickets-commerce-gateway-connected">
     23   
     24    <!-- Hidden field to identify this as paystack section -->
     25    <input type="hidden" name="tc-section" value="paystack" />
     26
     27    <!-- Add save button for connected state -->
     28    <div class="tec-tickets__admin-settings-tickets-commerce-gateway-connect-button">
     29        <input
     30            type="submit"
     31            name="tribeSaveSettings"
     32            class="button button-primary"
     33            value="<?php esc_attr_e( 'Save Settings', 'paystack-for-events-calendar' ); ?>"
     34        />
     35    </div>
     36
    2337    <h3><?php esc_html_e( 'Additional Settings', 'paystack-for-events-calendar' ); ?></h3>
    2438    <?php
  • paystack-for-events-calendar/trunk/paystack/admin-views/connect/inactive.php

    r2846787 r3447683  
    1919
    2020    <div class="tec-tickets__admin-settings-tickets-commerce-gateway-signup-links">
     21
     22        <!-- Hidden field to identify this as paystack section -->
     23        <input type="hidden" name="tc-section" value="paystack" />
     24       
    2125        <?php
    2226        echo wp_kses(
  • paystack-for-events-calendar/trunk/readme.txt

    r3440377 r3447683  
    44Requires at least: 5.8.6
    55Tested up to: 6.7.2
    6 Stable tag: 1.1.0
     6Stable tag: 1.1.1
    77Requires PHP: 8.0 and higher
    88License: GPL3
     
    4747== Changelog ==
    4848
    49 = 1.1.0 =
    50 * Compatibility with WordPress 6.9 and PHP 8.3.8
    51 * Fix 'Undefined array key NGN' currency errors
    52 * Implement dual currency registration (TEC Commerce + legacy Tribe systems)
    53 * Fix API key saving functionality
    54 * Add comprehensive debug logging for troubleshooting
    55 * Improve admin form structure and eliminate duplicate fields
    56 * Add support for multiple African currencies (NGN, GHS, KES, ZAR, XOF, EGP)
    57 * Enhance merchant data persistence with proper WordPress hooks
    58 
    5949= 1.0.7 =
    6050* Compatibility with WordPress 6.7.2 and PHP 8.3.8
     
    7666== Upgrade Notice ==
    7767
    78 = 1.1.0 =
    79 * Critical fixes for currency support and API key saving
    80 * Compatibility with WordPress 6.9 and PHP 8.3.8
    81 
    8268= 1.0.7 =
    8369* Compatibility with WordPress 6.7.2 and PHP 8.3.8
Note: See TracChangeset for help on using the changeset viewer.