Changeset 3447683
- Timestamp:
- 01/27/2026 09:35:04 AM (6 weeks ago)
- Location:
- paystack-for-events-calendar
- Files:
-
- 20 edited
- 1 copied
-
tags/1.1.1 (copied) (copied from paystack-for-events-calendar/trunk)
-
tags/1.1.1/classes/REST/Order_Endpoint.php (modified) (1 diff)
-
tags/1.1.1/classes/class-gateway.php (modified) (2 diffs)
-
tags/1.1.1/classes/class-merchant.php (modified) (2 diffs)
-
tags/1.1.1/classes/class-provider.php (modified) (4 diffs)
-
tags/1.1.1/classes/class-settings.php (modified) (1 diff)
-
tags/1.1.1/package.json (modified) (1 diff)
-
tags/1.1.1/paystack-tec.php (modified) (2 diffs)
-
tags/1.1.1/paystack/admin-views/connect/active.php (modified) (1 diff)
-
tags/1.1.1/paystack/admin-views/connect/inactive.php (modified) (1 diff)
-
tags/1.1.1/readme.txt (modified) (3 diffs)
-
trunk/classes/REST/Order_Endpoint.php (modified) (1 diff)
-
trunk/classes/class-gateway.php (modified) (2 diffs)
-
trunk/classes/class-merchant.php (modified) (2 diffs)
-
trunk/classes/class-provider.php (modified) (4 diffs)
-
trunk/classes/class-settings.php (modified) (1 diff)
-
trunk/package.json (modified) (1 diff)
-
trunk/paystack-tec.php (modified) (2 diffs)
-
trunk/paystack/admin-views/connect/active.php (modified) (1 diff)
-
trunk/paystack/admin-views/connect/inactive.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
paystack-for-events-calendar/tags/1.1.1/classes/REST/Order_Endpoint.php
r3012402 r3447683 39 39 * @var string 40 40 */ 41 protected $path = '/commerce/paystack/order';41 protected string $path = '/commerce/paystack/order'; 42 42 43 43 /** -
paystack-for-events-calendar/tags/1.1.1/classes/class-gateway.php
r3012402 r3447683 18 18 * @inheritDoc 19 19 */ 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 37 73 /** 38 74 * @inheritDoc … … 85 121 // If option is not explicitly set, the default will be if Paystack is connected. 86 122 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 ] ); 87 133 } 88 134 -
paystack-for-events-calendar/tags/1.1.1/classes/class-merchant.php
r3440377 r3447683 263 263 264 264 /** 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 /** 265 297 * Disconnects the merchant completely. 266 298 * … … 342 374 343 375 /** 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; 365 390 } 366 391 } -
paystack-for-events-calendar/tags/1.1.1/classes/class-provider.php
r3440377 r3447683 14 14 $this->container->singleton( Gateway::class ); 15 15 16 16 17 // Register Paystack as an available payment gateway 17 18 add_filter( 'tec_tickets_commerce_gateways', array( $this, 'register_paystack_gateway' ) ); … … 30 31 require_once( PS_TEC_PATH . '/classes/class-settings.php' ); 31 32 $this->container->singleton( Settings::class ); 32 add_action( 'tribe_settings_save_tab_paystack', '\paystack\tec\classes\Settings::update_settings', 10, 1 );33 add_action( 'tribe_settings_save_tab_paystack', '\paystack\tec\classes\Settings::update_settings', 10, 1 ); 33 34 34 35 //$this->container->singleton( Refresh_Token::class ); … … 84 85 } 85 86 87 86 88 /** 87 89 * Register Paystack as an available gateway. … … 148 150 'code' => 'XOF', 149 151 'symbol' => 'CFA', 150 'name' => 'West African CFA franc',152 'name' => 'West African CFA Franc', 151 153 'decimals' => 0, 152 154 ), -
paystack-for-events-calendar/tags/1.1.1/classes/class-settings.php
r2847454 r3447683 189 189 public static function update_settings() { 190 190 $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 191 196 if ( 'paystack' === $section ) { 192 197 $merchant = tribe( Merchant::class ); 193 198 194 199 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 196 206 $merchant->set_prop( $key, $to_save ); 197 207 } 198 208 199 $merchant->save(); 209 $save_result = $merchant->save(); 210 error_log( 'Paystack Settings: Save result = ' . ( $save_result ? 'SUCCESS' : 'FAILED' ) ); 200 211 } 201 212 } -
paystack-for-events-calendar/tags/1.1.1/package.json
r3243741 r3447683 1 1 { 2 2 "name": "tec-paystack", 3 "version": "1. 0.7",3 "version": "1.1.1", 4 4 "description": "Paystack for The Events Calendar", 5 5 "scripts": { -
paystack-for-events-calendar/tags/1.1.1/paystack-tec.php
r3440377 r3447683 5 5 * Description: Add-on for The Event Calendar that allows you to accept payments for event tickets via Paystack 6 6 * Author: Paystack 7 * Version: 1.1. 07 * Version: 1.1.1 8 8 * Author URI: https://paystack.com/ 9 9 * License: GPL3 … … 20 20 define( 'PS_TEC_CORE', __FILE__ ); 21 21 define( 'PS_TEC_URL', plugin_dir_url( __FILE__ ) ); 22 define( 'PS_TEC_VER', '1.1. 0' );22 define( 'PS_TEC_VER', '1.1.1' ); 23 23 24 24 /* ======================= Below is the Plugin Class init ========================= */ -
paystack-for-events-calendar/tags/1.1.1/paystack/admin-views/connect/active.php
r2847454 r3447683 21 21 ?> 22 22 <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 23 37 <h3><?php esc_html_e( 'Additional Settings', 'paystack-for-events-calendar' ); ?></h3> 24 38 <?php -
paystack-for-events-calendar/tags/1.1.1/paystack/admin-views/connect/inactive.php
r2846787 r3447683 19 19 20 20 <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 21 25 <?php 22 26 echo wp_kses( -
paystack-for-events-calendar/tags/1.1.1/readme.txt
r3440377 r3447683 4 4 Requires at least: 5.8.6 5 5 Tested up to: 6.7.2 6 Stable tag: 1.1. 06 Stable tag: 1.1.1 7 7 Requires PHP: 8.0 and higher 8 8 License: GPL3 … … 47 47 == Changelog == 48 48 49 = 1.1.0 =50 * Compatibility with WordPress 6.9 and PHP 8.3.851 * Fix 'Undefined array key NGN' currency errors52 * Implement dual currency registration (TEC Commerce + legacy Tribe systems)53 * Fix API key saving functionality54 * Add comprehensive debug logging for troubleshooting55 * Improve admin form structure and eliminate duplicate fields56 * Add support for multiple African currencies (NGN, GHS, KES, ZAR, XOF, EGP)57 * Enhance merchant data persistence with proper WordPress hooks58 59 49 = 1.0.7 = 60 50 * Compatibility with WordPress 6.7.2 and PHP 8.3.8 … … 76 66 == Upgrade Notice == 77 67 78 = 1.1.0 =79 * Critical fixes for currency support and API key saving80 * Compatibility with WordPress 6.9 and PHP 8.3.881 82 68 = 1.0.7 = 83 69 * Compatibility with WordPress 6.7.2 and PHP 8.3.8 -
paystack-for-events-calendar/trunk/classes/REST/Order_Endpoint.php
r3012402 r3447683 39 39 * @var string 40 40 */ 41 protected $path = '/commerce/paystack/order';41 protected string $path = '/commerce/paystack/order'; 42 42 43 43 /** -
paystack-for-events-calendar/trunk/classes/class-gateway.php
r3012402 r3447683 18 18 * @inheritDoc 19 19 */ 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 37 73 /** 38 74 * @inheritDoc … … 85 121 // If option is not explicitly set, the default will be if Paystack is connected. 86 122 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 ] ); 87 133 } 88 134 -
paystack-for-events-calendar/trunk/classes/class-merchant.php
r3440377 r3447683 263 263 264 264 /** 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 /** 265 297 * Disconnects the merchant completely. 266 298 * … … 342 374 343 375 /** 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; 365 390 } 366 391 } -
paystack-for-events-calendar/trunk/classes/class-provider.php
r3440377 r3447683 14 14 $this->container->singleton( Gateway::class ); 15 15 16 16 17 // Register Paystack as an available payment gateway 17 18 add_filter( 'tec_tickets_commerce_gateways', array( $this, 'register_paystack_gateway' ) ); … … 30 31 require_once( PS_TEC_PATH . '/classes/class-settings.php' ); 31 32 $this->container->singleton( Settings::class ); 32 add_action( 'tribe_settings_save_tab_paystack', '\paystack\tec\classes\Settings::update_settings', 10, 1 );33 add_action( 'tribe_settings_save_tab_paystack', '\paystack\tec\classes\Settings::update_settings', 10, 1 ); 33 34 34 35 //$this->container->singleton( Refresh_Token::class ); … … 84 85 } 85 86 87 86 88 /** 87 89 * Register Paystack as an available gateway. … … 148 150 'code' => 'XOF', 149 151 'symbol' => 'CFA', 150 'name' => 'West African CFA franc',152 'name' => 'West African CFA Franc', 151 153 'decimals' => 0, 152 154 ), -
paystack-for-events-calendar/trunk/classes/class-settings.php
r2847454 r3447683 189 189 public static function update_settings() { 190 190 $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 191 196 if ( 'paystack' === $section ) { 192 197 $merchant = tribe( Merchant::class ); 193 198 194 199 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 196 206 $merchant->set_prop( $key, $to_save ); 197 207 } 198 208 199 $merchant->save(); 209 $save_result = $merchant->save(); 210 error_log( 'Paystack Settings: Save result = ' . ( $save_result ? 'SUCCESS' : 'FAILED' ) ); 200 211 } 201 212 } -
paystack-for-events-calendar/trunk/package.json
r3243741 r3447683 1 1 { 2 2 "name": "tec-paystack", 3 "version": "1. 0.7",3 "version": "1.1.1", 4 4 "description": "Paystack for The Events Calendar", 5 5 "scripts": { -
paystack-for-events-calendar/trunk/paystack-tec.php
r3440377 r3447683 5 5 * Description: Add-on for The Event Calendar that allows you to accept payments for event tickets via Paystack 6 6 * Author: Paystack 7 * Version: 1.1. 07 * Version: 1.1.1 8 8 * Author URI: https://paystack.com/ 9 9 * License: GPL3 … … 20 20 define( 'PS_TEC_CORE', __FILE__ ); 21 21 define( 'PS_TEC_URL', plugin_dir_url( __FILE__ ) ); 22 define( 'PS_TEC_VER', '1.1. 0' );22 define( 'PS_TEC_VER', '1.1.1' ); 23 23 24 24 /* ======================= Below is the Plugin Class init ========================= */ -
paystack-for-events-calendar/trunk/paystack/admin-views/connect/active.php
r2847454 r3447683 21 21 ?> 22 22 <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 23 37 <h3><?php esc_html_e( 'Additional Settings', 'paystack-for-events-calendar' ); ?></h3> 24 38 <?php -
paystack-for-events-calendar/trunk/paystack/admin-views/connect/inactive.php
r2846787 r3447683 19 19 20 20 <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 21 25 <?php 22 26 echo wp_kses( -
paystack-for-events-calendar/trunk/readme.txt
r3440377 r3447683 4 4 Requires at least: 5.8.6 5 5 Tested up to: 6.7.2 6 Stable tag: 1.1. 06 Stable tag: 1.1.1 7 7 Requires PHP: 8.0 and higher 8 8 License: GPL3 … … 47 47 == Changelog == 48 48 49 = 1.1.0 =50 * Compatibility with WordPress 6.9 and PHP 8.3.851 * Fix 'Undefined array key NGN' currency errors52 * Implement dual currency registration (TEC Commerce + legacy Tribe systems)53 * Fix API key saving functionality54 * Add comprehensive debug logging for troubleshooting55 * Improve admin form structure and eliminate duplicate fields56 * Add support for multiple African currencies (NGN, GHS, KES, ZAR, XOF, EGP)57 * Enhance merchant data persistence with proper WordPress hooks58 59 49 = 1.0.7 = 60 50 * Compatibility with WordPress 6.7.2 and PHP 8.3.8 … … 76 66 == Upgrade Notice == 77 67 78 = 1.1.0 =79 * Critical fixes for currency support and API key saving80 * Compatibility with WordPress 6.9 and PHP 8.3.881 82 68 = 1.0.7 = 83 69 * Compatibility with WordPress 6.7.2 and PHP 8.3.8
Note: See TracChangeset
for help on using the changeset viewer.