Changeset 3435631
- Timestamp:
- 01/09/2026 05:37:29 AM (6 weeks ago)
- Location:
- fasspay-for-woocommerce/trunk
- Files:
-
- 3 edited
-
fasspay-for-woocommerce.php (modified) (1 diff)
-
includes/class-fasspay-gateway.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fasspay-for-woocommerce/trunk/fasspay-for-woocommerce.php
r3426395 r3435631 3 3 * Plugin Name: Fasspay for WooCommerce 4 4 * Description: Accept payments via Fasspay gateway supporting JCB, Mydebit, FPX, Visa/Mastercard, DuitNow QR, and E-Wallet 5 * Version: 1.0. 05 * Version: 1.0.1 6 6 * Author: Fasspay 7 7 * Author URI: https://fasspay.com -
fasspay-for-woocommerce/trunk/includes/class-fasspay-gateway.php
r3426395 r3435631 173 173 ) . '<br/><button type="button" class="button fasspay-upload-logo">' . __('Upload Logo', 'fasspay-for-woocommerce') . '</button>' . 174 174 '<div class="fasspay-logo-container" style="margin-top:8px; position:relative; display:none;"><img class="fasspay-logo-preview" src="" style="max-height:50px; height:auto; width:auto; display:none; border:1px solid #ddd; padding:4px; background:#fff;"/>' . 175 '<button type="button" class="fasspay-remove-logo" style="display:none; position:absolute; top:-10px; right:-10px; background:#dc3232; color:#fff; border:none; border-radius:50%; width:20px; height:20px; cursor:pointer; font-size:12px; line-height:1; padding:0; box-shadow:0 1px 3px rgba(0,0,0,0.3); z-index:10;" title="' . __('Remove logo', 'fasspay-for-woocommerce') . '">×</button></div>', 175 '<button type="button" class="fasspay-remove-logo" style="display:none; position:absolute; top:-10px; right:-10px; background:#dc3232; color:#fff; border:none; border-radius:50%; width:20px; height:20px; cursor:pointer; font-size:12px; line-height:1; padding:0; box-shadow:0 1px 3px rgba(0,0,0,0.3); z-index:10;" title="' . __('Remove logo', 'fasspay-for-woocommerce') . '">×</button></div>' . 176 '<p style="margin-top:8px; color:#d63638; font-weight:500;"><em>' . __('Note: This setting only applies in Live/Production environment. It will be ignored in Sandbox/UAT mode.', 'fasspay-for-woocommerce') . '</em></p>', 176 177 'default' => '', 177 178 'desc_tip' => false, … … 181 182 'title' => __('Theme Color', 'fasspay-for-woocommerce'), 182 183 'type' => 'text', 183 'description' => __('Primary theme color (hex), e.g. #0055ff', 'fasspay-for-woocommerce'), 184 'description' => __('Primary theme color (hex), e.g. #0055ff', 'fasspay-for-woocommerce') . 185 '<p style="margin-top:8px; color:#d63638; font-weight:500;"><em>' . __('Note: This setting only applies in Live/Production environment. It will be ignored in Sandbox/UAT mode.', 'fasspay-for-woocommerce') . '</em></p>', 184 186 'default' => '', 185 187 'css' => 'max-width:150px;', … … 414 416 */ 415 417 private function maybe_send_white_label_update($logo_url, $theme_color) { 418 // Skip white label update in sandbox/UAT environment 419 if ($this->sandbox_mode === 'yes') { 420 $this->log_to_debug('White label update skipped: Sandbox/UAT mode is enabled', 'info'); 421 return; 422 } 416 423 417 424 $max_bytes = 200 * 1024; // 200 KB … … 459 466 460 467 /** 468 * Check if this gateway is available for use 469 * Restricts gateway to MYR currency only 470 */ 471 public function is_available() { 472 // First check if gateway is enabled 473 if ($this->enabled !== 'yes') { 474 return false; 475 } 476 477 // Check if currency is MYR 478 $currency = get_woocommerce_currency(); 479 if ($currency !== 'MYR') { 480 return false; 481 } 482 483 // Call parent method for any additional checks 484 return parent::is_available(); 485 } 486 487 /** 461 488 * Payment form on checkout page 462 489 */ … … 505 532 506 533 if (!$order) { 534 return array( 535 'result' => 'fail', 536 'redirect' => '' 537 ); 538 } 539 540 // Validate currency is MYR (safety check) 541 $currency = $order->get_currency(); 542 if ($currency !== 'MYR') { 543 $this->log_to_debug('Payment rejected: Currency must be MYR, but order currency is ' . $currency, 'error'); 544 wc_add_notice( 545 sprintf( 546 /* translators: %s: Currency code */ 547 __('Fasspay only accepts MYR currency. Your order is in %s. Please change your store currency to MYR.', 'fasspay-for-woocommerce'), 548 esc_html($currency) 549 ), 550 'error' 551 ); 507 552 return array( 508 553 'result' => 'fail', -
fasspay-for-woocommerce/trunk/readme.txt
r3426395 r3435631 4 4 Requires at least: 6.7 5 5 Tested up to: 6.9 6 Stable tag: 1.0. 06 Stable tag: 1.0.1 7 7 Requires PHP: 7.4 8 8 WC requires at least: 5.0 … … 79 79 The plugin automatically handles webhook callbacks from Fasspay with authentication in placed for security. Webhooks are processed to update order status automatically. 80 80 81 = Why are the brand logo and theme colors not reflecting on the payment page? 82 83 The brand logo and theme colors will not be applied in the sandbox environment. Do uncheck the sandbox mode and try it in the Production environment. 84 81 85 == Screenshots == 82 86 83 1. Checkout payment method selection with brand icons84 2. Payment gateway configuration in WooCommerce settings85 3. Fasspay admin settings page with environment info and test connection tool86 87 1. Fasspay payment gateway configuration in WooCommerce settings. 88 2. Fasspay payment gateway configuration in WooCommerce settings. 89 3. WooCommerce > Fasspay, here is the admin settings page with environment info and test connection tool. 90 4. Payment checkout page. 87 91 88 92 == Changelog == 93 94 = 1.0.1 = 95 - Enhanced payment gateway configuration. 96 - Restricted transactions to MYR currency. 89 97 90 98 = 1.0.0 =
Note: See TracChangeset
for help on using the changeset viewer.