Plugin Directory

Changeset 2777535


Ignore:
Timestamp:
08/30/2022 05:54:07 AM (3 years ago)
Author:
omise
Message:

Update to version 4.23.3 from GitHub

Location:
omise
Files:
32 deleted
36 edited
1 copied

Legend:

Unmodified
Added
Removed
  • omise/tags/4.23.3/CHANGELOG.md

    r2771968 r2777535  
    11# CHANGELOG
     2
     3### [v4.23.3 _(Aug 30, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.3)
     4#### 👾 Bug Fixes
     5- Fixing the issue of card payment by reverting v4.23.2. (PR [#299](https://github.com/omise/omise-woocommerce/pull/299))
    26
    37### [v4.23.2 _(Aug 18, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.2)
  • omise/tags/4.23.3/assets/javascripts/omise-payment-form-handler.js

    r2771968 r2777535  
    2323       
    2424        $form.prepend( $ulError );
    25         $("html, body").animate({ scrollTop:0 },"slow");
     25        $("html, body").animate({
     26             scrollTop:0
     27             },"slow");
    2628    }
    2729   
     
    6971                });
    7072
    71                 let errors = [],
    72                     omise_card = {},
     73                let errors                  = [],
     74                    omise_card              = {},
    7375                    omise_card_number_field = 'number',
    74                     omise_card_state_field = 'state',
    75                     omise_card_fields = {
    76                         'name' : $( '#omise_card_name' ),
    77                         'number' : $( '#omise_card_number' ),
     76                    omise_card_fields       = {
     77                        'name'             : $( '#omise_card_name' ),
     78                        'number'           : $( '#omise_card_number' ),
    7879                        'expiration_month' : $( '#omise_card_expiration_month' ),
    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' )
     80                        'expiration_year'  : $( '#omise_card_expiration_year' ),
     81                        'security_code'    : $( '#omise_card_security_code' )
    8682                    };
    8783
    8884                $.each( omise_card_fields, function( index, field ) {
    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 
     85                    omise_card[ index ] = (index === omise_card_number_field) ? field.val().replace(/\s/g, '') : field.val();
    9586                    if ( "" === omise_card[ index ] ) {
    9687                        errors.push( omise_params[ 'required_card_' + index ] );
     
    111102                        if (statusCode == 200) {
    112103                            $.each( omise_card_fields, function( index, field ) {
    113                                 const sensitiveDataIndex = ['name', 'number', 'expiration_year', 'expiration_month', 'security_code'];
    114                                 if (sensitiveDataIndex.includes(index)) {
    115                                     field.val( '' );
    116                                 }
     104                                field.val( '' );
    117105                            } );
    118106                            $form.append( '<input type="hidden" class="omise_token" name="omise_token" value="' + response.id + '"/>' );
     
    122110                        };
    123111                    });
    124                 } else {
     112                }else{
    125113                    showError( omise_params.cannot_load_omisejs + '<br/>' + omise_params.check_internet_connection );
    126114                    $form.unblock();
  • omise/tags/4.23.3/includes/backends/class-omise-backend-fpx.php

    r2771968 r2777535  
    1919     */
    2020    public function get_available_banks() {
    21         $capabilities = $this->capabilities();
    22 
    23         if ( !$capabilities ){
    24             return null;
    25         }
    26 
    27         $providers = $capabilities->getFPXBanks();
     21        $providers = $this->capabilities()->getFPXBanks();
    2822        $first_value = reset($providers);
    2923
  • omise/tags/4.23.3/includes/backends/class-omise-backend-installment.php

    r2771968 r2777535  
    9898     */
    9999    public function get_available_providers( $currency, $purchase_amount ) {
    100         $capabilities = $this->capabilities();
    101 
    102         if ( !$capabilities ){
    103             return null;
    104         }
    105 
    106100        // Note: As installment payment at the moment only supports THB and MYR currency, the
    107101        //       $purchase_amount is multiplied with 100 to convert the amount into subunit (satang and sen).
    108         $providers = $capabilities->getInstallmentBackends( $currency, ( $purchase_amount * 100 ) );
     102        $providers = $this->capabilities()->getInstallmentBackends( $currency, ( $purchase_amount * 100 ) );
    109103
    110104        foreach ( $providers as &$provider ) {
  • omise/tags/4.23.3/includes/backends/class-omise-backend-mobile-banking.php

    r2771968 r2777535  
    3636     */
    3737    public function get_available_providers( $currency ) {
     38
     39        $providers = $this->capabilities()->getBackends( $currency );
     40
    3841        $mobile_banking_providers = array();
    39         $capabilities = $this->capabilities();
    4042
    41         if ( $capabilities ){
    42             $providers = $capabilities->getBackends( $currency );
     43        foreach ( $providers as &$provider ) {
     44            if(isset(self::$providers[ $provider->_id ])){
    4345
    44             foreach ( $providers as &$provider ) {
    45                 if(isset(self::$providers[ $provider->_id ])){
     46                $provider_detail = self::$providers[ $provider->_id ];
     47                $provider->provider_name   = $provider_detail['title'];
     48                $provider->provider_logo   = $provider_detail['logo'];
    4649
    47                     $provider_detail = self::$providers[ $provider->_id ];
    48                     $provider->provider_name   = $provider_detail['title'];
    49                     $provider->provider_logo   = $provider_detail['logo'];
    50 
    51                     array_push($mobile_banking_providers, $provider);
    52                 }
     50                array_push($mobile_banking_providers, $provider);
    5351            }
    5452        }
  • omise/tags/4.23.3/includes/class-omise-callback.php

    r2771968 r2777535  
    2626
    2727    public static function execute() {
    28         if(RequestHelper::isUserOriginated()) {
    29             return wp_redirect( wc_get_checkout_url() );
    30         }
    31 
    3228        $order_id = isset( $_GET['order_id'] ) ? sanitize_text_field( $_GET['order_id'] ) : null;
    3329
     
    7268        $message = __(
    7369            '<strong>We cannot validate your payment result:</strong><br/>
    74             Note that your payment may have already been processed.<br/>
    75             Please contact our support team if you have any questions.',
     70             Note that your payment may have already been processed.<br/>
     71             Please contact our support team if you have any questions.',
    7672            'omise'
    7773        );
     
    113109            $message = __(
    114110                'Omise: The payment is being processed.<br/>
    115                 An amount %1$s %2$s has been authorized.',
     111                 An amount %1$s %2$s has been authorized.',
    116112                'omise'
    117113            );
     
    139135        $message = __(
    140136            'Omise: The payment is being processed.<br/>
    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.',
     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.',
    143139            'omise'
    144140        );
     
    157153     */
    158154    protected function payment_failed() {
    159         $message = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' );
     155        $message         = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' );
    160156        $failure_message = Omise()->translate( $this->charge['failure_message'] ) . ' (code: ' . $this->charge['failure_code'] . ')';
    161157
  • omise/tags/4.23.3/includes/class-omise-capabilities.php

    r2771968 r2777535  
    2121    public static function retrieve() {
    2222        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    
    3023            self::$the_instance = new self();
    31             self::$the_instance->capabilities = $capabilities;
     24            self::$the_instance->capabilities = OmiseCapabilities::retrieve();
    3225        }
    33    
     26
    3427        return self::$the_instance;
    3528    }
     
    7063
    7164    /**
    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     /**
    8465     * Retrieves details of fpx bank list from capabilities.
    8566     *
  • omise/tags/4.23.3/includes/class-omise-payment-factory.php

    r2771968 r2777535  
    3434        'Omise_Payment_OCBC_PAO',
    3535        'Omise_Payment_GrabPay',
    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'
     36        'Omise_Payment_GooglePay'
    4237    );
    4338
  • omise/tags/4.23.3/includes/gateway/class-omise-payment-alipayplus.php

    r2771968 r2777535  
    148148    }
    149149}
     150
     151class 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.3/includes/gateway/class-omise-payment-grabpay.php

    r2771968 r2777535  
    7777        ) );
    7878    }
    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     }
    9279}
  • omise/tags/4.23.3/includes/gateway/class-omise-payment-installment.php

    r2771968 r2777535  
    7373            array(
    7474                'installment_backends' => $this->backend->get_available_providers( $currency, $cart_total ),
    75                 'is_zero_interest'     => $this->backend->capabilities() ? $this->backend->capabilities()->is_zero_interest() : false
     75                'is_zero_interest'     => $this->backend->capabilities()->is_zero_interest()
    7676            )
    7777        );
  • omise/tags/4.23.3/includes/libraries/omise-plugin/Omise.php

    r2771968 r2777535  
    44require_once dirname(__FILE__).'/helpers/wc_order.php';
    55require_once dirname(__FILE__).'/helpers/mailer.php';
    6 require_once dirname(__FILE__).'/helpers/request.php';
  • omise/tags/4.23.3/languages/omise-ja.po

    r2771968 r2777535  
    357357#: templates/payment/form-konhini.php:4
    358358msgid "Name"
    359 msgstr "カード名義"
     359msgstr "名前"
    360360
    361361#: templates/payment/form-konhini.php:8
     
    377377#: includes/class-omise-callback.php:156
    378378msgid "email is in invalid format and phone_number must contain 10-11 digit characters"
    379 msgstr "電子メールの形式が無効です。電話_番号には10-11桁の数字を入力してください。"
     379msgstr ""電子メールの形式が無効です。電話_番号には10-11桁の数字を入力してください"。"
    380380
    381381#: includes/class-omise-callback.php:156
     
    462462msgid "Your payment code has been sent to your email"
    463463msgstr "お客様のメールに決済コードが送信されました。"
    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.3/omise-woocommerce.php

    r2771968 r2777535  
    44 * Plugin URI:  https://www.omise.co/woocommerce
    55 * 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.2
     6 * Version:     4.23.3
    77 * Author:      Omise and contributors
    88 * Author URI:  https://github.com/omise/omise-woocommerce/graphs/contributors
    99 * Text Domain: omise
    1010 * WC requires at least: 3.3.4
    11  * WC tested up to: 5.7.0
     11 * WC tested up to: 6.0.1
    1212 * License:     MIT
    1313 * License URI: https://opensource.org/licenses/MIT
     
    2121     * @var string
    2222     */
    23     public $version = '4.23.2';
     23    public $version = '4.23.3';
    2424
    2525    /**
     
    125125        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/backends/class-omise-backend-mobile-banking.php';
    126126        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';
    128127        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/classes/class-omise-charge.php';
    129128        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/classes/class-omise-card-image.php';
     
    152151        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-grabpay.php';
    153152        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';
    160153        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment.php';
    161154        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/libraries/omise-php/lib/Omise.php';
  • omise/tags/4.23.3/readme.txt

    r2771968 r2777535  
    33Tags: omise, payment, payment gateway, woocommerce plugin, installment, internet banking, alipay, paynow, truemoney wallet, woocommerce payment
    44Requires at least: 4.3.1
    5 Tested up to: 5.9.0
    6 Stable tag: 4.23.2
     5Tested up to: 6.0.1
     6Stable tag: 4.23.3
    77License: MIT
    88License URI: https://opensource.org/licenses/MIT
     
    3333
    3434== Changelog ==
     35
     36= 4.23.3 =
     37
     38#### 👾 Bug Fixes
     39- Fixing the issue of card payment by reverting v4.23.2. (PR [#299](https://github.com/omise/omise-woocommerce/pull/299))
    3540
    3641= 4.23.2 =
  • omise/tags/4.23.3/templates/myaccount/my-card.php

    r2771968 r2777535  
    1 <h3><?php _e( 'Cards', 'omise' ); ?></h3>
     1<h2>Omise settings</h2>
     2<h3>Cards</h3>
    23<div id="omise_card_panel">
    34    <table>
    45        <tr>
    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>
     6            <th>Name</th>
     7            <th>Number</th>
     8            <th>Created date</th>
     9            <th>Action</th>
    910        </tr>
    1011        <tbody>
     
    1213                <?php foreach( $viewData['existingCards']['data'] as $card ): ?>
    1314                    <?php
    14                         $nonce = wp_create_nonce( 'omise_delete_card_' . $card['id'] );
    15                         $created_date = date_i18n( get_option( 'date_format' ), strtotime($card['created']));
     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>";
    1620                    ?>
    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>
    3121                <?php endforeach; ?>
    3222            <?php endif; ?>
     
    3424    </table>
    3525
    36     <h4><?php _e( 'Add new card', 'omise' ); ?></h4>
     26    <h4>Add new card</h4>
    3727    <form name="omise_cc_form" id="omise_cc_form">
    3828        <?php wp_nonce_field('omise_add_card','omise_add_card_nonce'); ?>
     
    4232        </fieldset>
    4333    </form>
    44     <button id="omise_add_new_card" class="button"><?php _e( 'Save card', 'omise' ); ?></button>
     34    <button id="omise_add_new_card" class="button">Save card</button>
    4535</div>
  • omise/tags/4.23.3/templates/payment/form-fpx.php

    r2771968 r2777535  
    3333<script type="text/javascript">
    3434    var selectElem = document.getElementById("fpx-select-bank");
    35     if(selectElem) {
    36         selectElem.addEventListener('change', function(e) {
    37             selectElem.setAttribute("class", e.target.value);
    38         })
    39     }
     35    selectElem.addEventListener('change', function(e) {
     36         selectElem.setAttribute("class", e.target.value);
     37    })
    4038</script>
  • omise/trunk/CHANGELOG.md

    r2771968 r2777535  
    11# CHANGELOG
     2
     3### [v4.23.3 _(Aug 30, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.3)
     4#### 👾 Bug Fixes
     5- Fixing the issue of card payment by reverting v4.23.2. (PR [#299](https://github.com/omise/omise-woocommerce/pull/299))
    26
    37### [v4.23.2 _(Aug 18, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.2)
  • omise/trunk/assets/javascripts/omise-payment-form-handler.js

    r2771968 r2777535  
    2323       
    2424        $form.prepend( $ulError );
    25         $("html, body").animate({ scrollTop:0 },"slow");
     25        $("html, body").animate({
     26             scrollTop:0
     27             },"slow");
    2628    }
    2729   
     
    6971                });
    7072
    71                 let errors = [],
    72                     omise_card = {},
     73                let errors                  = [],
     74                    omise_card              = {},
    7375                    omise_card_number_field = 'number',
    74                     omise_card_state_field = 'state',
    75                     omise_card_fields = {
    76                         'name' : $( '#omise_card_name' ),
    77                         'number' : $( '#omise_card_number' ),
     76                    omise_card_fields       = {
     77                        'name'             : $( '#omise_card_name' ),
     78                        'number'           : $( '#omise_card_number' ),
    7879                        'expiration_month' : $( '#omise_card_expiration_month' ),
    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' )
     80                        'expiration_year'  : $( '#omise_card_expiration_year' ),
     81                        'security_code'    : $( '#omise_card_security_code' )
    8682                    };
    8783
    8884                $.each( omise_card_fields, function( index, field ) {
    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 
     85                    omise_card[ index ] = (index === omise_card_number_field) ? field.val().replace(/\s/g, '') : field.val();
    9586                    if ( "" === omise_card[ index ] ) {
    9687                        errors.push( omise_params[ 'required_card_' + index ] );
     
    111102                        if (statusCode == 200) {
    112103                            $.each( omise_card_fields, function( index, field ) {
    113                                 const sensitiveDataIndex = ['name', 'number', 'expiration_year', 'expiration_month', 'security_code'];
    114                                 if (sensitiveDataIndex.includes(index)) {
    115                                     field.val( '' );
    116                                 }
     104                                field.val( '' );
    117105                            } );
    118106                            $form.append( '<input type="hidden" class="omise_token" name="omise_token" value="' + response.id + '"/>' );
     
    122110                        };
    123111                    });
    124                 } else {
     112                }else{
    125113                    showError( omise_params.cannot_load_omisejs + '<br/>' + omise_params.check_internet_connection );
    126114                    $form.unblock();
  • omise/trunk/includes/backends/class-omise-backend-fpx.php

    r2771968 r2777535  
    1919     */
    2020    public function get_available_banks() {
    21         $capabilities = $this->capabilities();
    22 
    23         if ( !$capabilities ){
    24             return null;
    25         }
    26 
    27         $providers = $capabilities->getFPXBanks();
     21        $providers = $this->capabilities()->getFPXBanks();
    2822        $first_value = reset($providers);
    2923
  • omise/trunk/includes/backends/class-omise-backend-installment.php

    r2771968 r2777535  
    9898     */
    9999    public function get_available_providers( $currency, $purchase_amount ) {
    100         $capabilities = $this->capabilities();
    101 
    102         if ( !$capabilities ){
    103             return null;
    104         }
    105 
    106100        // Note: As installment payment at the moment only supports THB and MYR currency, the
    107101        //       $purchase_amount is multiplied with 100 to convert the amount into subunit (satang and sen).
    108         $providers = $capabilities->getInstallmentBackends( $currency, ( $purchase_amount * 100 ) );
     102        $providers = $this->capabilities()->getInstallmentBackends( $currency, ( $purchase_amount * 100 ) );
    109103
    110104        foreach ( $providers as &$provider ) {
  • omise/trunk/includes/backends/class-omise-backend-mobile-banking.php

    r2771968 r2777535  
    3636     */
    3737    public function get_available_providers( $currency ) {
     38
     39        $providers = $this->capabilities()->getBackends( $currency );
     40
    3841        $mobile_banking_providers = array();
    39         $capabilities = $this->capabilities();
    4042
    41         if ( $capabilities ){
    42             $providers = $capabilities->getBackends( $currency );
     43        foreach ( $providers as &$provider ) {
     44            if(isset(self::$providers[ $provider->_id ])){
    4345
    44             foreach ( $providers as &$provider ) {
    45                 if(isset(self::$providers[ $provider->_id ])){
     46                $provider_detail = self::$providers[ $provider->_id ];
     47                $provider->provider_name   = $provider_detail['title'];
     48                $provider->provider_logo   = $provider_detail['logo'];
    4649
    47                     $provider_detail = self::$providers[ $provider->_id ];
    48                     $provider->provider_name   = $provider_detail['title'];
    49                     $provider->provider_logo   = $provider_detail['logo'];
    50 
    51                     array_push($mobile_banking_providers, $provider);
    52                 }
     50                array_push($mobile_banking_providers, $provider);
    5351            }
    5452        }
  • omise/trunk/includes/class-omise-callback.php

    r2771968 r2777535  
    2626
    2727    public static function execute() {
    28         if(RequestHelper::isUserOriginated()) {
    29             return wp_redirect( wc_get_checkout_url() );
    30         }
    31 
    3228        $order_id = isset( $_GET['order_id'] ) ? sanitize_text_field( $_GET['order_id'] ) : null;
    3329
     
    7268        $message = __(
    7369            '<strong>We cannot validate your payment result:</strong><br/>
    74             Note that your payment may have already been processed.<br/>
    75             Please contact our support team if you have any questions.',
     70             Note that your payment may have already been processed.<br/>
     71             Please contact our support team if you have any questions.',
    7672            'omise'
    7773        );
     
    113109            $message = __(
    114110                'Omise: The payment is being processed.<br/>
    115                 An amount %1$s %2$s has been authorized.',
     111                 An amount %1$s %2$s has been authorized.',
    116112                'omise'
    117113            );
     
    139135        $message = __(
    140136            'Omise: The payment is being processed.<br/>
    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.',
     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.',
    143139            'omise'
    144140        );
     
    157153     */
    158154    protected function payment_failed() {
    159         $message = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' );
     155        $message         = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' );
    160156        $failure_message = Omise()->translate( $this->charge['failure_message'] ) . ' (code: ' . $this->charge['failure_code'] . ')';
    161157
  • omise/trunk/includes/class-omise-capabilities.php

    r2771968 r2777535  
    2121    public static function retrieve() {
    2222        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    
    3023            self::$the_instance = new self();
    31             self::$the_instance->capabilities = $capabilities;
     24            self::$the_instance->capabilities = OmiseCapabilities::retrieve();
    3225        }
    33    
     26
    3427        return self::$the_instance;
    3528    }
     
    7063
    7164    /**
    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     /**
    8465     * Retrieves details of fpx bank list from capabilities.
    8566     *
  • omise/trunk/includes/class-omise-payment-factory.php

    r2771968 r2777535  
    3434        'Omise_Payment_OCBC_PAO',
    3535        'Omise_Payment_GrabPay',
    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'
     36        'Omise_Payment_GooglePay'
    4237    );
    4338
  • omise/trunk/includes/gateway/class-omise-payment-alipayplus.php

    r2771968 r2777535  
    148148    }
    149149}
     150
     151class 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

    r2771968 r2777535  
    7777        ) );
    7878    }
    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     }
    9279}
  • omise/trunk/includes/gateway/class-omise-payment-installment.php

    r2771968 r2777535  
    7373            array(
    7474                'installment_backends' => $this->backend->get_available_providers( $currency, $cart_total ),
    75                 'is_zero_interest'     => $this->backend->capabilities() ? $this->backend->capabilities()->is_zero_interest() : false
     75                'is_zero_interest'     => $this->backend->capabilities()->is_zero_interest()
    7676            )
    7777        );
  • omise/trunk/includes/libraries/omise-plugin/Omise.php

    r2771968 r2777535  
    44require_once dirname(__FILE__).'/helpers/wc_order.php';
    55require_once dirname(__FILE__).'/helpers/mailer.php';
    6 require_once dirname(__FILE__).'/helpers/request.php';
  • omise/trunk/languages/omise-ja.po

    r2771968 r2777535  
    357357#: templates/payment/form-konhini.php:4
    358358msgid "Name"
    359 msgstr "カード名義"
     359msgstr "名前"
    360360
    361361#: templates/payment/form-konhini.php:8
     
    377377#: includes/class-omise-callback.php:156
    378378msgid "email is in invalid format and phone_number must contain 10-11 digit characters"
    379 msgstr "電子メールの形式が無効です。電話_番号には10-11桁の数字を入力してください。"
     379msgstr ""電子メールの形式が無効です。電話_番号には10-11桁の数字を入力してください"。"
    380380
    381381#: includes/class-omise-callback.php:156
     
    462462msgid "Your payment code has been sent to your email"
    463463msgstr "お客様のメールに決済コードが送信されました。"
    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

    r2771968 r2777535  
    44 * Plugin URI:  https://www.omise.co/woocommerce
    55 * 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.2
     6 * Version:     4.23.3
    77 * Author:      Omise and contributors
    88 * Author URI:  https://github.com/omise/omise-woocommerce/graphs/contributors
    99 * Text Domain: omise
    1010 * WC requires at least: 3.3.4
    11  * WC tested up to: 5.7.0
     11 * WC tested up to: 6.0.1
    1212 * License:     MIT
    1313 * License URI: https://opensource.org/licenses/MIT
     
    2121     * @var string
    2222     */
    23     public $version = '4.23.2';
     23    public $version = '4.23.3';
    2424
    2525    /**
     
    125125        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/backends/class-omise-backend-mobile-banking.php';
    126126        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';
    128127        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/classes/class-omise-charge.php';
    129128        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/classes/class-omise-card-image.php';
     
    152151        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment-grabpay.php';
    153152        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';
    160153        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/gateway/class-omise-payment.php';
    161154        require_once OMISE_WOOCOMMERCE_PLUGIN_PATH . '/includes/libraries/omise-php/lib/Omise.php';
  • omise/trunk/readme.txt

    r2771968 r2777535  
    33Tags: omise, payment, payment gateway, woocommerce plugin, installment, internet banking, alipay, paynow, truemoney wallet, woocommerce payment
    44Requires at least: 4.3.1
    5 Tested up to: 5.9.0
    6 Stable tag: 4.23.2
     5Tested up to: 6.0.1
     6Stable tag: 4.23.3
    77License: MIT
    88License URI: https://opensource.org/licenses/MIT
     
    3333
    3434== Changelog ==
     35
     36= 4.23.3 =
     37
     38#### 👾 Bug Fixes
     39- Fixing the issue of card payment by reverting v4.23.2. (PR [#299](https://github.com/omise/omise-woocommerce/pull/299))
    3540
    3641= 4.23.2 =
  • omise/trunk/templates/myaccount/my-card.php

    r2771968 r2777535  
    1 <h3><?php _e( 'Cards', 'omise' ); ?></h3>
     1<h2>Omise settings</h2>
     2<h3>Cards</h3>
    23<div id="omise_card_panel">
    34    <table>
    45        <tr>
    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>
     6            <th>Name</th>
     7            <th>Number</th>
     8            <th>Created date</th>
     9            <th>Action</th>
    910        </tr>
    1011        <tbody>
     
    1213                <?php foreach( $viewData['existingCards']['data'] as $card ): ?>
    1314                    <?php
    14                         $nonce = wp_create_nonce( 'omise_delete_card_' . $card['id'] );
    15                         $created_date = date_i18n( get_option( 'date_format' ), strtotime($card['created']));
     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>";
    1620                    ?>
    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>
    3121                <?php endforeach; ?>
    3222            <?php endif; ?>
     
    3424    </table>
    3525
    36     <h4><?php _e( 'Add new card', 'omise' ); ?></h4>
     26    <h4>Add new card</h4>
    3727    <form name="omise_cc_form" id="omise_cc_form">
    3828        <?php wp_nonce_field('omise_add_card','omise_add_card_nonce'); ?>
     
    4232        </fieldset>
    4333    </form>
    44     <button id="omise_add_new_card" class="button"><?php _e( 'Save card', 'omise' ); ?></button>
     34    <button id="omise_add_new_card" class="button">Save card</button>
    4535</div>
  • omise/trunk/templates/payment/form-fpx.php

    r2771968 r2777535  
    3333<script type="text/javascript">
    3434    var selectElem = document.getElementById("fpx-select-bank");
    35     if(selectElem) {
    36         selectElem.addEventListener('change', function(e) {
    37             selectElem.setAttribute("class", e.target.value);
    38         })
    39     }
     35    selectElem.addEventListener('change', function(e) {
     36         selectElem.setAttribute("class", e.target.value);
     37    })
    4038</script>
Note: See TracChangeset for help on using the changeset viewer.