Changeset 2771968
- Timestamp:
- 08/18/2022 07:48:40 AM (4 years ago)
- Location:
- omise
- Files:
-
- 32 added
- 36 edited
- 1 copied
-
tags/4.23.2 (copied) (copied from omise/trunk)
-
tags/4.23.2/CHANGELOG.md (modified) (1 diff)
-
tags/4.23.2/assets/images/boost.png (added)
-
tags/4.23.2/assets/images/duitnow-obw.png (added)
-
tags/4.23.2/assets/images/duitnow-qr.png (added)
-
tags/4.23.2/assets/images/grabpay.png (added)
-
tags/4.23.2/assets/images/maybank-qr.png (added)
-
tags/4.23.2/assets/images/shopeepay.png (added)
-
tags/4.23.2/assets/images/touch-n-go.png (added)
-
tags/4.23.2/assets/javascripts/omise-payment-form-handler.js (modified) (4 diffs)
-
tags/4.23.2/includes/backends/class-omise-backend-fpx.php (modified) (1 diff)
-
tags/4.23.2/includes/backends/class-omise-backend-installment.php (modified) (1 diff)
-
tags/4.23.2/includes/backends/class-omise-backend-mobile-banking.php (modified) (1 diff)
-
tags/4.23.2/includes/backends/class-omise-backend-touch-n-go.php (added)
-
tags/4.23.2/includes/class-omise-callback.php (modified) (5 diffs)
-
tags/4.23.2/includes/class-omise-capabilities.php (modified) (2 diffs)
-
tags/4.23.2/includes/class-omise-payment-factory.php (modified) (1 diff)
-
tags/4.23.2/includes/gateway/class-omise-payment-alipayplus.php (modified) (1 diff)
-
tags/4.23.2/includes/gateway/class-omise-payment-boost.php (added)
-
tags/4.23.2/includes/gateway/class-omise-payment-duitnow-obw.php (added)
-
tags/4.23.2/includes/gateway/class-omise-payment-duitnow-qr.php (added)
-
tags/4.23.2/includes/gateway/class-omise-payment-grabpay.php (modified) (1 diff)
-
tags/4.23.2/includes/gateway/class-omise-payment-installment.php (modified) (1 diff)
-
tags/4.23.2/includes/gateway/class-omise-payment-maybank-qr.php (added)
-
tags/4.23.2/includes/gateway/class-omise-payment-shopeepay.php (added)
-
tags/4.23.2/includes/gateway/class-omise-payment-touch-n-go.php (added)
-
tags/4.23.2/includes/libraries/omise-plugin/Omise.php (modified) (1 diff)
-
tags/4.23.2/includes/libraries/omise-plugin/helpers/request.php (added)
-
tags/4.23.2/languages/omise-ja.mo (modified) (previous)
-
tags/4.23.2/languages/omise-ja.po (modified) (3 diffs)
-
tags/4.23.2/omise-woocommerce.php (modified) (4 diffs)
-
tags/4.23.2/readme.txt (modified) (2 diffs)
-
tags/4.23.2/templates/myaccount/my-card.php (modified) (4 diffs)
-
tags/4.23.2/templates/payment/form-duitnow-obw.php (added)
-
tags/4.23.2/templates/payment/form-fpx.php (modified) (1 diff)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/assets/images/boost.png (added)
-
trunk/assets/images/duitnow-obw.png (added)
-
trunk/assets/images/duitnow-qr.png (added)
-
trunk/assets/images/grabpay.png (added)
-
trunk/assets/images/maybank-qr.png (added)
-
trunk/assets/images/shopeepay.png (added)
-
trunk/assets/images/touch-n-go.png (added)
-
trunk/assets/javascripts/omise-payment-form-handler.js (modified) (4 diffs)
-
trunk/includes/backends/class-omise-backend-fpx.php (modified) (1 diff)
-
trunk/includes/backends/class-omise-backend-installment.php (modified) (1 diff)
-
trunk/includes/backends/class-omise-backend-mobile-banking.php (modified) (1 diff)
-
trunk/includes/backends/class-omise-backend-touch-n-go.php (added)
-
trunk/includes/class-omise-callback.php (modified) (5 diffs)
-
trunk/includes/class-omise-capabilities.php (modified) (2 diffs)
-
trunk/includes/class-omise-payment-factory.php (modified) (1 diff)
-
trunk/includes/gateway/class-omise-payment-alipayplus.php (modified) (1 diff)
-
trunk/includes/gateway/class-omise-payment-boost.php (added)
-
trunk/includes/gateway/class-omise-payment-duitnow-obw.php (added)
-
trunk/includes/gateway/class-omise-payment-duitnow-qr.php (added)
-
trunk/includes/gateway/class-omise-payment-grabpay.php (modified) (1 diff)
-
trunk/includes/gateway/class-omise-payment-installment.php (modified) (1 diff)
-
trunk/includes/gateway/class-omise-payment-maybank-qr.php (added)
-
trunk/includes/gateway/class-omise-payment-shopeepay.php (added)
-
trunk/includes/gateway/class-omise-payment-touch-n-go.php (added)
-
trunk/includes/libraries/omise-plugin/Omise.php (modified) (1 diff)
-
trunk/includes/libraries/omise-plugin/helpers/request.php (added)
-
trunk/languages/omise-ja.mo (modified) (previous)
-
trunk/languages/omise-ja.po (modified) (3 diffs)
-
trunk/omise-woocommerce.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/templates/myaccount/my-card.php (modified) (4 diffs)
-
trunk/templates/payment/form-duitnow-obw.php (added)
-
trunk/templates/payment/form-fpx.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
omise/tags/4.23.2/CHANGELOG.md
r2766266 r2771968 1 1 # CHANGELOG 2 3 ### [v4.23.2 _(Aug 18, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.2) 4 5 #### 👾 Bug Fixes 6 - Handle capabilities failed. (PR [#294](https://github.com/omise/omise-woocommerce/pull/294)) 2 7 3 8 ### [v4.23.1 _(Aug 4, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.1) -
omise/tags/4.23.2/assets/javascripts/omise-payment-form-handler.js
r2766266 r2771968 23 23 24 24 $form.prepend( $ulError ); 25 $("html, body").animate({ 26 scrollTop:0 27 },"slow"); 25 $("html, body").animate({ scrollTop:0 },"slow"); 28 26 } 29 27 … … 71 69 }); 72 70 73 let errors = [],74 omise_card = {},71 let errors = [], 72 omise_card = {}, 75 73 omise_card_number_field = 'number', 76 omise_card_fields = { 77 'name' : $( '#omise_card_name' ), 78 'number' : $( '#omise_card_number' ), 74 omise_card_state_field = 'state', 75 omise_card_fields = { 76 'name' : $( '#omise_card_name' ), 77 'number' : $( '#omise_card_number' ), 79 78 'expiration_month' : $( '#omise_card_expiration_month' ), 80 'expiration_year' : $( '#omise_card_expiration_year' ), 81 'security_code' : $( '#omise_card_security_code' ) 79 'expiration_year' : $( '#omise_card_expiration_year' ), 80 'security_code' : $( '#omise_card_security_code' ), 81 'city' : $( '#billing_city' ), 82 'state' : $( '#billing_state' ), 83 'country' : $( '#billing_country' ), 84 'postal_code' : $( '#billing_postcode' ), 85 'street1' : $( '#billing_address_1' ) 82 86 }; 83 87 84 88 $.each( omise_card_fields, function( index, field ) { 85 omise_card[ index ] = (index === omise_card_number_field) ? field.val().replace(/\s/g, '') : field.val(); 89 if (index === omise_card_state_field) { 90 omise_card[ index ] = field.find(":selected").text(); 91 } else { 92 omise_card[ index ] = (index === omise_card_number_field) ? field.val().replace(/\s/g, '') : field.val(); 93 } 94 86 95 if ( "" === omise_card[ index ] ) { 87 96 errors.push( omise_params[ 'required_card_' + index ] ); … … 102 111 if (statusCode == 200) { 103 112 $.each( omise_card_fields, function( index, field ) { 104 field.val( '' ); 113 const sensitiveDataIndex = ['name', 'number', 'expiration_year', 'expiration_month', 'security_code']; 114 if (sensitiveDataIndex.includes(index)) { 115 field.val( '' ); 116 } 105 117 } ); 106 118 $form.append( '<input type="hidden" class="omise_token" name="omise_token" value="' + response.id + '"/>' ); … … 110 122 }; 111 123 }); 112 } else{124 } else { 113 125 showError( omise_params.cannot_load_omisejs + '<br/>' + omise_params.check_internet_connection ); 114 126 $form.unblock(); -
omise/tags/4.23.2/includes/backends/class-omise-backend-fpx.php
r2737840 r2771968 19 19 */ 20 20 public function get_available_banks() { 21 $providers = $this->capabilities()->getFPXBanks(); 21 $capabilities = $this->capabilities(); 22 23 if ( !$capabilities ){ 24 return null; 25 } 26 27 $providers = $capabilities->getFPXBanks(); 22 28 $first_value = reset($providers); 23 29 -
omise/tags/4.23.2/includes/backends/class-omise-backend-installment.php
r2621135 r2771968 98 98 */ 99 99 public function get_available_providers( $currency, $purchase_amount ) { 100 $capabilities = $this->capabilities(); 101 102 if ( !$capabilities ){ 103 return null; 104 } 105 100 106 // Note: As installment payment at the moment only supports THB and MYR currency, the 101 107 // $purchase_amount is multiplied with 100 to convert the amount into subunit (satang and sen). 102 $providers = $ this->capabilities()->getInstallmentBackends( $currency, ( $purchase_amount * 100 ) );108 $providers = $capabilities->getInstallmentBackends( $currency, ( $purchase_amount * 100 ) ); 103 109 104 110 foreach ( $providers as &$provider ) { -
omise/tags/4.23.2/includes/backends/class-omise-backend-mobile-banking.php
r2720994 r2771968 36 36 */ 37 37 public function get_available_providers( $currency ) { 38 $mobile_banking_providers = array(); 39 $capabilities = $this->capabilities(); 38 40 39 $providers = $this->capabilities()->getBackends( $currency ); 41 if ( $capabilities ){ 42 $providers = $capabilities->getBackends( $currency ); 40 43 41 $mobile_banking_providers = array(); 44 foreach ( $providers as &$provider ) { 45 if(isset(self::$providers[ $provider->_id ])){ 42 46 43 foreach ( $providers as &$provider ) { 44 if(isset(self::$providers[ $provider->_id ])){ 47 $provider_detail = self::$providers[ $provider->_id ]; 48 $provider->provider_name = $provider_detail['title']; 49 $provider->provider_logo = $provider_detail['logo']; 45 50 46 $provider_detail = self::$providers[ $provider->_id ]; 47 $provider->provider_name = $provider_detail['title']; 48 $provider->provider_logo = $provider_detail['logo']; 49 50 array_push($mobile_banking_providers, $provider); 51 array_push($mobile_banking_providers, $provider); 52 } 51 53 } 52 54 } -
omise/tags/4.23.2/includes/class-omise-callback.php
r2766266 r2771968 26 26 27 27 public static function execute() { 28 if(RequestHelper::isUserOriginated()) { 29 return wp_redirect( wc_get_checkout_url() ); 30 } 31 28 32 $order_id = isset( $_GET['order_id'] ) ? sanitize_text_field( $_GET['order_id'] ) : null; 29 33 … … 68 72 $message = __( 69 73 '<strong>We cannot validate your payment result:</strong><br/> 70 Note that your payment may have already been processed.<br/>71 Please contact our support team if you have any questions.',74 Note that your payment may have already been processed.<br/> 75 Please contact our support team if you have any questions.', 72 76 'omise' 73 77 ); … … 109 113 $message = __( 110 114 'Omise: The payment is being processed.<br/> 111 An amount %1$s %2$s has been authorized.',115 An amount %1$s %2$s has been authorized.', 112 116 'omise' 113 117 ); … … 135 139 $message = __( 136 140 'Omise: The payment is being processed.<br/> 137 Depending on the payment provider, this may take some time to process.<br/>138 Please do a manual \'Sync Payment Status\' action from the <strong>Order Actions</strong> panel, or check the payment status directly at the Omise Dashboard later.',141 Depending on the payment provider, this may take some time to process.<br/> 142 Please do a manual \'Sync Payment Status\' action from the <strong>Order Actions</strong> panel, or check the payment status directly at the Omise Dashboard later.', 139 143 'omise' 140 144 ); … … 153 157 */ 154 158 protected function payment_failed() { 155 $message = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' );159 $message = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' ); 156 160 $failure_message = Omise()->translate( $this->charge['failure_message'] ) . ' (code: ' . $this->charge['failure_code'] . ')'; 157 161 -
omise/tags/4.23.2/includes/class-omise-capabilities.php
r2766266 r2771968 21 21 public static function retrieve() { 22 22 if ( ! self::$the_instance ) { 23 try { 24 $capabilities = OmiseCapabilities::retrieve(); 25 } catch(\Exception $e) { 26 // suppressing error on the admin dashboard 27 return null; 28 } 29 23 30 self::$the_instance = new self(); 24 self::$the_instance->capabilities = OmiseCapabilities::retrieve();31 self::$the_instance->capabilities = $capabilities; 25 32 } 26 33 27 34 return self::$the_instance; 28 35 } … … 63 70 64 71 /** 72 * Retrieves details of Touch n Go payment backends from capabilities. 73 * 74 * @return string 75 */ 76 public function getTouchNGoBackends() { 77 $params = array(); 78 $params[] = $this->capabilities->backendFilter['type']('touch_n_go'); 79 80 return $this->capabilities->getBackends( $params ); 81 } 82 83 /** 65 84 * Retrieves details of fpx bank list from capabilities. 66 85 * -
omise/tags/4.23.2/includes/class-omise-payment-factory.php
r2766266 r2771968 34 34 'Omise_Payment_OCBC_PAO', 35 35 'Omise_Payment_GrabPay', 36 'Omise_Payment_GooglePay' 36 'Omise_Payment_GooglePay', 37 'Omise_Payment_Boost', 38 'Omise_Payment_ShopeePay', 39 'Omise_Payment_Maybank_QR', 40 'Omise_Payment_DuitNow_QR', 41 'Omise_Payment_DuitNow_OBW' 37 42 ); 38 43 -
omise/tags/4.23.2/includes/gateway/class-omise-payment-alipayplus.php
r2766266 r2771968 148 148 } 149 149 } 150 151 class Omise_Payment_TouchNGo extends Omise_Payment_Alipayplus {152 public function __construct() {153 $source = 'touch_n_go';154 $title = 'TNG eWallet';155 $countries = array( 'SG' );156 parent::__construct( $source, $title, $countries );157 }158 } -
omise/tags/4.23.2/includes/gateway/class-omise-payment-grabpay.php
r2766266 r2771968 77 77 ) ); 78 78 } 79 80 /** 81 * Get icons 82 * 83 * @see WC_Payment_Gateway::get_icon() 84 */ 85 public function get_icon() { 86 $icon = Omise_Image::get_image( array( 87 'file' => 'grabpay.png', 88 'alternate_text' => 'GrabPay', 89 )); 90 return apply_filters( 'woocommerce_gateway_icon', $icon, $this->id ); 91 } 79 92 } -
omise/tags/4.23.2/includes/gateway/class-omise-payment-installment.php
r2711951 r2771968 73 73 array( 74 74 'installment_backends' => $this->backend->get_available_providers( $currency, $cart_total ), 75 'is_zero_interest' => $this->backend->capabilities() ->is_zero_interest()75 'is_zero_interest' => $this->backend->capabilities() ? $this->backend->capabilities()->is_zero_interest() : false 76 76 ) 77 77 ); -
omise/tags/4.23.2/includes/libraries/omise-plugin/Omise.php
r2766266 r2771968 4 4 require_once dirname(__FILE__).'/helpers/wc_order.php'; 5 5 require_once dirname(__FILE__).'/helpers/mailer.php'; 6 require_once dirname(__FILE__).'/helpers/request.php'; -
omise/tags/4.23.2/languages/omise-ja.po
r2766266 r2771968 357 357 #: templates/payment/form-konhini.php:4 358 358 msgid "Name" 359 msgstr " 名前"359 msgstr "カード名義" 360 360 361 361 #: templates/payment/form-konhini.php:8 … … 377 377 #: includes/class-omise-callback.php:156 378 378 msgid "email is in invalid format and phone_number must contain 10-11 digit characters" 379 msgstr " "電子メールの形式が無効です。電話_番号には10-11桁の数字を入力してください"。"379 msgstr "電子メールの形式が無効です。電話_番号には10-11桁の数字を入力してください。" 380 380 381 381 #: includes/class-omise-callback.php:156 … … 462 462 msgid "Your payment code has been sent to your email" 463 463 msgstr "お客様のメールに決済コードが送信されました。" 464 465 #: templates/myaccount/my-card.php 466 msgid "Cards" 467 msgstr "カード" 468 469 #: templates/myaccount/my-card.php 470 msgid "Number" 471 msgstr "カード番号" 472 473 #: templates/myaccount/my-card.php 474 msgid "Created date" 475 msgstr "カード作成日" 476 477 #: templates/myaccount/my-card.php 478 msgid "Action" 479 msgstr "アクション" 480 481 #: templates/myaccount/my-card.php 482 msgid "Add new card" 483 msgstr "新しいカードを追加する" 484 485 #: templates/myaccount/my-card.php 486 msgid "Save card" 487 msgstr "カードを保存する" 488 489 #: templates/myaccount/my-card.php 490 msgid "Delete" 491 msgstr "削除する" -
omise/tags/4.23.2/omise-woocommerce.php
r2766266 r2771968 4 4 * Plugin URI: https://www.omise.co/woocommerce 5 5 * Description: Omise WooCommerce Gateway Plugin is a WordPress plugin designed specifically for WooCommerce. The plugin adds support for Omise Payment Gateway payment method to WooCommerce. 6 * Version: 4.23. 16 * Version: 4.23.2 7 7 * Author: Omise and contributors 8 8 * Author URI: https://github.com/omise/omise-woocommerce/graphs/contributors … … 21 21 * @var string 22 22 */ 23 public $version = '4.23. 1';23 public $version = '4.23.2'; 24 24 25 25 /** … … 125 125 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/backends/class-omise-backend-mobile-banking.php'; 126 126 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/backends/class-omise-backend-fpx.php'; 127 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/backends/class-omise-backend-touch-n-go.php'; 127 128 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/classes/class-omise-charge.php'; 128 129 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/classes/class-omise-card-image.php'; … … 151 152 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-grabpay.php'; 152 153 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-ocbc-pao.php'; 154 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-boost.php'; 155 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-duitnow-obw.php'; 156 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-duitnow-qr.php'; 157 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-maybank-qr.php'; 158 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-shopeepay.php'; 159 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-touch-n-go.php'; 153 160 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment.php'; 154 161 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/libraries/omise-php/lib/Omise.php'; -
omise/tags/4.23.2/readme.txt
r2766266 r2771968 4 4 Requires at least: 4.3.1 5 5 Tested up to: 5.9.0 6 Stable tag: 4.23. 16 Stable tag: 4.23.2 7 7 License: MIT 8 8 License URI: https://opensource.org/licenses/MIT … … 33 33 34 34 == Changelog == 35 36 = 4.23.2 = 37 38 #### 👾 Bug Fixes 39 - Handle capabilities failed. (PR [#294](https://github.com/omise/omise-woocommerce/pull/294)) 35 40 36 41 = 4.23.1 = -
omise/tags/4.23.2/templates/myaccount/my-card.php
r2766266 r2771968 1 <h2>Omise settings</h2> 2 <h3>Cards</h3> 1 <h3><?php _e( 'Cards', 'omise' ); ?></h3> 3 2 <div id="omise_card_panel"> 4 3 <table> 5 4 <tr> 6 <th> Name</th>7 <th> Number</th>8 <th> Created date</th>9 <th> Action</th>5 <th><?php _e( 'Name', 'omise' ); ?></th> 6 <th><?php _e( 'Number', 'omise' ); ?></th> 7 <th><?php _e( 'Created date', 'omise' ); ?></th> 8 <th><?php _e( 'Action', 'omise' ); ?></th> 10 9 </tr> 11 10 <tbody> … … 13 12 <?php foreach( $viewData['existingCards']['data'] as $card ): ?> 14 13 <?php 15 $nonce = wp_create_nonce( 'omise_delete_card_' . $card['id'] ); 16 echo "<tr><td>{$card['name']}</td><td>XXXX XXXX XXXX {$card['last_digits']}</td>"; 17 $created_date = date_i18n( get_option( 'date_format' ), strtotime($card['created'])); 18 echo "<td>{$created_date}</td>"; 19 echo "<td><button class='button delete_card' data-card-id='{$card['id']}' data-delete-card-nonce='{$nonce}'>Delete</button></td></tr>"; 14 $nonce = wp_create_nonce( 'omise_delete_card_' . $card['id'] ); 15 $created_date = date_i18n( get_option( 'date_format' ), strtotime($card['created'])); 20 16 ?> 17 <tr> 18 <td><?= $card['name'] ?></td> 19 <td>XXXX XXXX XXXX <?= $card['last_digits'] ?></td> 20 <td><?= $created_date ?></td> 21 <td> 22 <button 23 class='button delete_card' 24 data-card-id=<?= $card['id'] ?> 25 data-delete-card-nonce=<?= $nonce ?> 26 > 27 <?php _e( 'Delete', 'omise' ); ?> 28 </button> 29 </td> 30 </tr> 21 31 <?php endforeach; ?> 22 32 <?php endif; ?> … … 24 34 </table> 25 35 26 <h4> Add new card</h4>36 <h4><?php _e( 'Add new card', 'omise' ); ?></h4> 27 37 <form name="omise_cc_form" id="omise_cc_form"> 28 38 <?php wp_nonce_field('omise_add_card','omise_add_card_nonce'); ?> … … 32 42 </fieldset> 33 43 </form> 34 <button id="omise_add_new_card" class="button"> Save card</button>44 <button id="omise_add_new_card" class="button"><?php _e( 'Save card', 'omise' ); ?></button> 35 45 </div> -
omise/tags/4.23.2/templates/payment/form-fpx.php
r2737840 r2771968 33 33 <script type="text/javascript"> 34 34 var selectElem = document.getElementById("fpx-select-bank"); 35 selectElem.addEventListener('change', function(e) { 36 selectElem.setAttribute("class", e.target.value); 37 }) 35 if(selectElem) { 36 selectElem.addEventListener('change', function(e) { 37 selectElem.setAttribute("class", e.target.value); 38 }) 39 } 38 40 </script> -
omise/trunk/CHANGELOG.md
r2766266 r2771968 1 1 # CHANGELOG 2 3 ### [v4.23.2 _(Aug 18, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.2) 4 5 #### 👾 Bug Fixes 6 - Handle capabilities failed. (PR [#294](https://github.com/omise/omise-woocommerce/pull/294)) 2 7 3 8 ### [v4.23.1 _(Aug 4, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.1) -
omise/trunk/assets/javascripts/omise-payment-form-handler.js
r2766266 r2771968 23 23 24 24 $form.prepend( $ulError ); 25 $("html, body").animate({ 26 scrollTop:0 27 },"slow"); 25 $("html, body").animate({ scrollTop:0 },"slow"); 28 26 } 29 27 … … 71 69 }); 72 70 73 let errors = [],74 omise_card = {},71 let errors = [], 72 omise_card = {}, 75 73 omise_card_number_field = 'number', 76 omise_card_fields = { 77 'name' : $( '#omise_card_name' ), 78 'number' : $( '#omise_card_number' ), 74 omise_card_state_field = 'state', 75 omise_card_fields = { 76 'name' : $( '#omise_card_name' ), 77 'number' : $( '#omise_card_number' ), 79 78 'expiration_month' : $( '#omise_card_expiration_month' ), 80 'expiration_year' : $( '#omise_card_expiration_year' ), 81 'security_code' : $( '#omise_card_security_code' ) 79 'expiration_year' : $( '#omise_card_expiration_year' ), 80 'security_code' : $( '#omise_card_security_code' ), 81 'city' : $( '#billing_city' ), 82 'state' : $( '#billing_state' ), 83 'country' : $( '#billing_country' ), 84 'postal_code' : $( '#billing_postcode' ), 85 'street1' : $( '#billing_address_1' ) 82 86 }; 83 87 84 88 $.each( omise_card_fields, function( index, field ) { 85 omise_card[ index ] = (index === omise_card_number_field) ? field.val().replace(/\s/g, '') : field.val(); 89 if (index === omise_card_state_field) { 90 omise_card[ index ] = field.find(":selected").text(); 91 } else { 92 omise_card[ index ] = (index === omise_card_number_field) ? field.val().replace(/\s/g, '') : field.val(); 93 } 94 86 95 if ( "" === omise_card[ index ] ) { 87 96 errors.push( omise_params[ 'required_card_' + index ] ); … … 102 111 if (statusCode == 200) { 103 112 $.each( omise_card_fields, function( index, field ) { 104 field.val( '' ); 113 const sensitiveDataIndex = ['name', 'number', 'expiration_year', 'expiration_month', 'security_code']; 114 if (sensitiveDataIndex.includes(index)) { 115 field.val( '' ); 116 } 105 117 } ); 106 118 $form.append( '<input type="hidden" class="omise_token" name="omise_token" value="' + response.id + '"/>' ); … … 110 122 }; 111 123 }); 112 } else{124 } else { 113 125 showError( omise_params.cannot_load_omisejs + '<br/>' + omise_params.check_internet_connection ); 114 126 $form.unblock(); -
omise/trunk/includes/backends/class-omise-backend-fpx.php
r2737840 r2771968 19 19 */ 20 20 public function get_available_banks() { 21 $providers = $this->capabilities()->getFPXBanks(); 21 $capabilities = $this->capabilities(); 22 23 if ( !$capabilities ){ 24 return null; 25 } 26 27 $providers = $capabilities->getFPXBanks(); 22 28 $first_value = reset($providers); 23 29 -
omise/trunk/includes/backends/class-omise-backend-installment.php
r2621135 r2771968 98 98 */ 99 99 public function get_available_providers( $currency, $purchase_amount ) { 100 $capabilities = $this->capabilities(); 101 102 if ( !$capabilities ){ 103 return null; 104 } 105 100 106 // Note: As installment payment at the moment only supports THB and MYR currency, the 101 107 // $purchase_amount is multiplied with 100 to convert the amount into subunit (satang and sen). 102 $providers = $ this->capabilities()->getInstallmentBackends( $currency, ( $purchase_amount * 100 ) );108 $providers = $capabilities->getInstallmentBackends( $currency, ( $purchase_amount * 100 ) ); 103 109 104 110 foreach ( $providers as &$provider ) { -
omise/trunk/includes/backends/class-omise-backend-mobile-banking.php
r2720994 r2771968 36 36 */ 37 37 public function get_available_providers( $currency ) { 38 $mobile_banking_providers = array(); 39 $capabilities = $this->capabilities(); 38 40 39 $providers = $this->capabilities()->getBackends( $currency ); 41 if ( $capabilities ){ 42 $providers = $capabilities->getBackends( $currency ); 40 43 41 $mobile_banking_providers = array(); 44 foreach ( $providers as &$provider ) { 45 if(isset(self::$providers[ $provider->_id ])){ 42 46 43 foreach ( $providers as &$provider ) { 44 if(isset(self::$providers[ $provider->_id ])){ 47 $provider_detail = self::$providers[ $provider->_id ]; 48 $provider->provider_name = $provider_detail['title']; 49 $provider->provider_logo = $provider_detail['logo']; 45 50 46 $provider_detail = self::$providers[ $provider->_id ]; 47 $provider->provider_name = $provider_detail['title']; 48 $provider->provider_logo = $provider_detail['logo']; 49 50 array_push($mobile_banking_providers, $provider); 51 array_push($mobile_banking_providers, $provider); 52 } 51 53 } 52 54 } -
omise/trunk/includes/class-omise-callback.php
r2766266 r2771968 26 26 27 27 public static function execute() { 28 if(RequestHelper::isUserOriginated()) { 29 return wp_redirect( wc_get_checkout_url() ); 30 } 31 28 32 $order_id = isset( $_GET['order_id'] ) ? sanitize_text_field( $_GET['order_id'] ) : null; 29 33 … … 68 72 $message = __( 69 73 '<strong>We cannot validate your payment result:</strong><br/> 70 Note that your payment may have already been processed.<br/>71 Please contact our support team if you have any questions.',74 Note that your payment may have already been processed.<br/> 75 Please contact our support team if you have any questions.', 72 76 'omise' 73 77 ); … … 109 113 $message = __( 110 114 'Omise: The payment is being processed.<br/> 111 An amount %1$s %2$s has been authorized.',115 An amount %1$s %2$s has been authorized.', 112 116 'omise' 113 117 ); … … 135 139 $message = __( 136 140 'Omise: The payment is being processed.<br/> 137 Depending on the payment provider, this may take some time to process.<br/>138 Please do a manual \'Sync Payment Status\' action from the <strong>Order Actions</strong> panel, or check the payment status directly at the Omise Dashboard later.',141 Depending on the payment provider, this may take some time to process.<br/> 142 Please do a manual \'Sync Payment Status\' action from the <strong>Order Actions</strong> panel, or check the payment status directly at the Omise Dashboard later.', 139 143 'omise' 140 144 ); … … 153 157 */ 154 158 protected function payment_failed() { 155 $message = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' );159 $message = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' ); 156 160 $failure_message = Omise()->translate( $this->charge['failure_message'] ) . ' (code: ' . $this->charge['failure_code'] . ')'; 157 161 -
omise/trunk/includes/class-omise-capabilities.php
r2766266 r2771968 21 21 public static function retrieve() { 22 22 if ( ! self::$the_instance ) { 23 try { 24 $capabilities = OmiseCapabilities::retrieve(); 25 } catch(\Exception $e) { 26 // suppressing error on the admin dashboard 27 return null; 28 } 29 23 30 self::$the_instance = new self(); 24 self::$the_instance->capabilities = OmiseCapabilities::retrieve();31 self::$the_instance->capabilities = $capabilities; 25 32 } 26 33 27 34 return self::$the_instance; 28 35 } … … 63 70 64 71 /** 72 * Retrieves details of Touch n Go payment backends from capabilities. 73 * 74 * @return string 75 */ 76 public function getTouchNGoBackends() { 77 $params = array(); 78 $params[] = $this->capabilities->backendFilter['type']('touch_n_go'); 79 80 return $this->capabilities->getBackends( $params ); 81 } 82 83 /** 65 84 * Retrieves details of fpx bank list from capabilities. 66 85 * -
omise/trunk/includes/class-omise-payment-factory.php
r2766266 r2771968 34 34 'Omise_Payment_OCBC_PAO', 35 35 'Omise_Payment_GrabPay', 36 'Omise_Payment_GooglePay' 36 'Omise_Payment_GooglePay', 37 'Omise_Payment_Boost', 38 'Omise_Payment_ShopeePay', 39 'Omise_Payment_Maybank_QR', 40 'Omise_Payment_DuitNow_QR', 41 'Omise_Payment_DuitNow_OBW' 37 42 ); 38 43 -
omise/trunk/includes/gateway/class-omise-payment-alipayplus.php
r2766266 r2771968 148 148 } 149 149 } 150 151 class Omise_Payment_TouchNGo extends Omise_Payment_Alipayplus {152 public function __construct() {153 $source = 'touch_n_go';154 $title = 'TNG eWallet';155 $countries = array( 'SG' );156 parent::__construct( $source, $title, $countries );157 }158 } -
omise/trunk/includes/gateway/class-omise-payment-grabpay.php
r2766266 r2771968 77 77 ) ); 78 78 } 79 80 /** 81 * Get icons 82 * 83 * @see WC_Payment_Gateway::get_icon() 84 */ 85 public function get_icon() { 86 $icon = Omise_Image::get_image( array( 87 'file' => 'grabpay.png', 88 'alternate_text' => 'GrabPay', 89 )); 90 return apply_filters( 'woocommerce_gateway_icon', $icon, $this->id ); 91 } 79 92 } -
omise/trunk/includes/gateway/class-omise-payment-installment.php
r2711951 r2771968 73 73 array( 74 74 'installment_backends' => $this->backend->get_available_providers( $currency, $cart_total ), 75 'is_zero_interest' => $this->backend->capabilities() ->is_zero_interest()75 'is_zero_interest' => $this->backend->capabilities() ? $this->backend->capabilities()->is_zero_interest() : false 76 76 ) 77 77 ); -
omise/trunk/includes/libraries/omise-plugin/Omise.php
r2766266 r2771968 4 4 require_once dirname(__FILE__).'/helpers/wc_order.php'; 5 5 require_once dirname(__FILE__).'/helpers/mailer.php'; 6 require_once dirname(__FILE__).'/helpers/request.php'; -
omise/trunk/languages/omise-ja.po
r2766266 r2771968 357 357 #: templates/payment/form-konhini.php:4 358 358 msgid "Name" 359 msgstr " 名前"359 msgstr "カード名義" 360 360 361 361 #: templates/payment/form-konhini.php:8 … … 377 377 #: includes/class-omise-callback.php:156 378 378 msgid "email is in invalid format and phone_number must contain 10-11 digit characters" 379 msgstr " "電子メールの形式が無効です。電話_番号には10-11桁の数字を入力してください"。"379 msgstr "電子メールの形式が無効です。電話_番号には10-11桁の数字を入力してください。" 380 380 381 381 #: includes/class-omise-callback.php:156 … … 462 462 msgid "Your payment code has been sent to your email" 463 463 msgstr "お客様のメールに決済コードが送信されました。" 464 465 #: templates/myaccount/my-card.php 466 msgid "Cards" 467 msgstr "カード" 468 469 #: templates/myaccount/my-card.php 470 msgid "Number" 471 msgstr "カード番号" 472 473 #: templates/myaccount/my-card.php 474 msgid "Created date" 475 msgstr "カード作成日" 476 477 #: templates/myaccount/my-card.php 478 msgid "Action" 479 msgstr "アクション" 480 481 #: templates/myaccount/my-card.php 482 msgid "Add new card" 483 msgstr "新しいカードを追加する" 484 485 #: templates/myaccount/my-card.php 486 msgid "Save card" 487 msgstr "カードを保存する" 488 489 #: templates/myaccount/my-card.php 490 msgid "Delete" 491 msgstr "削除する" -
omise/trunk/omise-woocommerce.php
r2766266 r2771968 4 4 * Plugin URI: https://www.omise.co/woocommerce 5 5 * Description: Omise WooCommerce Gateway Plugin is a WordPress plugin designed specifically for WooCommerce. The plugin adds support for Omise Payment Gateway payment method to WooCommerce. 6 * Version: 4.23. 16 * Version: 4.23.2 7 7 * Author: Omise and contributors 8 8 * Author URI: https://github.com/omise/omise-woocommerce/graphs/contributors … … 21 21 * @var string 22 22 */ 23 public $version = '4.23. 1';23 public $version = '4.23.2'; 24 24 25 25 /** … … 125 125 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/backends/class-omise-backend-mobile-banking.php'; 126 126 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/backends/class-omise-backend-fpx.php'; 127 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/backends/class-omise-backend-touch-n-go.php'; 127 128 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/classes/class-omise-charge.php'; 128 129 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/classes/class-omise-card-image.php'; … … 151 152 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-grabpay.php'; 152 153 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-ocbc-pao.php'; 154 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-boost.php'; 155 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-duitnow-obw.php'; 156 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-duitnow-qr.php'; 157 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-maybank-qr.php'; 158 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-shopeepay.php'; 159 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-touch-n-go.php'; 153 160 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment.php'; 154 161 require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/libraries/omise-php/lib/Omise.php'; -
omise/trunk/readme.txt
r2766266 r2771968 4 4 Requires at least: 4.3.1 5 5 Tested up to: 5.9.0 6 Stable tag: 4.23. 16 Stable tag: 4.23.2 7 7 License: MIT 8 8 License URI: https://opensource.org/licenses/MIT … … 33 33 34 34 == Changelog == 35 36 = 4.23.2 = 37 38 #### 👾 Bug Fixes 39 - Handle capabilities failed. (PR [#294](https://github.com/omise/omise-woocommerce/pull/294)) 35 40 36 41 = 4.23.1 = -
omise/trunk/templates/myaccount/my-card.php
r2766266 r2771968 1 <h2>Omise settings</h2> 2 <h3>Cards</h3> 1 <h3><?php _e( 'Cards', 'omise' ); ?></h3> 3 2 <div id="omise_card_panel"> 4 3 <table> 5 4 <tr> 6 <th> Name</th>7 <th> Number</th>8 <th> Created date</th>9 <th> Action</th>5 <th><?php _e( 'Name', 'omise' ); ?></th> 6 <th><?php _e( 'Number', 'omise' ); ?></th> 7 <th><?php _e( 'Created date', 'omise' ); ?></th> 8 <th><?php _e( 'Action', 'omise' ); ?></th> 10 9 </tr> 11 10 <tbody> … … 13 12 <?php foreach( $viewData['existingCards']['data'] as $card ): ?> 14 13 <?php 15 $nonce = wp_create_nonce( 'omise_delete_card_' . $card['id'] ); 16 echo "<tr><td>{$card['name']}</td><td>XXXX XXXX XXXX {$card['last_digits']}</td>"; 17 $created_date = date_i18n( get_option( 'date_format' ), strtotime($card['created'])); 18 echo "<td>{$created_date}</td>"; 19 echo "<td><button class='button delete_card' data-card-id='{$card['id']}' data-delete-card-nonce='{$nonce}'>Delete</button></td></tr>"; 14 $nonce = wp_create_nonce( 'omise_delete_card_' . $card['id'] ); 15 $created_date = date_i18n( get_option( 'date_format' ), strtotime($card['created'])); 20 16 ?> 17 <tr> 18 <td><?= $card['name'] ?></td> 19 <td>XXXX XXXX XXXX <?= $card['last_digits'] ?></td> 20 <td><?= $created_date ?></td> 21 <td> 22 <button 23 class='button delete_card' 24 data-card-id=<?= $card['id'] ?> 25 data-delete-card-nonce=<?= $nonce ?> 26 > 27 <?php _e( 'Delete', 'omise' ); ?> 28 </button> 29 </td> 30 </tr> 21 31 <?php endforeach; ?> 22 32 <?php endif; ?> … … 24 34 </table> 25 35 26 <h4> Add new card</h4>36 <h4><?php _e( 'Add new card', 'omise' ); ?></h4> 27 37 <form name="omise_cc_form" id="omise_cc_form"> 28 38 <?php wp_nonce_field('omise_add_card','omise_add_card_nonce'); ?> … … 32 42 </fieldset> 33 43 </form> 34 <button id="omise_add_new_card" class="button"> Save card</button>44 <button id="omise_add_new_card" class="button"><?php _e( 'Save card', 'omise' ); ?></button> 35 45 </div> -
omise/trunk/templates/payment/form-fpx.php
r2737840 r2771968 33 33 <script type="text/javascript"> 34 34 var selectElem = document.getElementById("fpx-select-bank"); 35 selectElem.addEventListener('change', function(e) { 36 selectElem.setAttribute("class", e.target.value); 37 }) 35 if(selectElem) { 36 selectElem.addEventListener('change', function(e) { 37 selectElem.setAttribute("class", e.target.value); 38 }) 39 } 38 40 </script>
Note: See TracChangeset
for help on using the changeset viewer.