Plugin Directory

Changeset 3216319


Ignore:
Timestamp:
01/03/2025 08:52:08 AM (11 months ago)
Author:
Hiroaki Miyashita
Message:

Version 0.1.4

Location:
wc-gmopg-gateway/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wc-gmopg-gateway/trunk/readme.txt

    r3201243 r3216319  
    55Requires at least: 4.4
    66Tested up to: 6.7.1
    7 Stable tag: 0.1.3
     7Stable tag: 0.1.4
    88License: GPLv2 or later
    99
     
    4444== Changelog ==
    4545
     46= 0.1.4 =
     47* Recording the transaction ID.
     48* Bugfix: payment from the order history.
     49
    4650= 0.1.3 =
    4751* Support for High-Performance Order Storage.
  • wc-gmopg-gateway/trunk/wc-gmopg-gateway.php

    r3201243 r3216319  
    66 * Author: Hiroaki Miyashita
    77 * Author URI: https://www.wpmarket.jp/
    8  * Version: 0.1.3
     8 * Version: 0.1.4
    99 * Requires at least: 4.4
    1010 * Tested up to: 6.7.1
    1111 * WC requires at least: 3.0
    12  * WC tested up to: 9.4.2
     12 * WC tested up to: 9.5.1
    1313 * Text Domain: wc-gmopg-gateway
    1414 * Domain Path: /
     
    224224                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    225225               
    226                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     226                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    227227                $param['transaction']['Amount'] = $order->get_total();         
    228228                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    256256                    wc_gmopg_gateway_logging( $param_json, $this->logging );
    257257                    wc_gmopg_gateway_logging( $response_data, $this->logging );
     258                    wc_gmopg_gateway_logging( $order->get_order_key(), $this->logging );
    258259                    $order->add_order_note( $err_msg );
    259260                    return;
    260261                endif;
    261                                
     262           
    262263                return array(
    263264                    'result' => 'success',
     
    269270                $order = wc_get_order( $order_id );
    270271                if ( 'gmopg_credit' !== $order->get_payment_method() ) return;
    271                
     272           
    272273                if ( !empty($_POST['result']) ) :
    273274                    if ( empty($this->status) ) $this->status = 'processing';
     
    285286                        exit;
    286287                    else :
    287                         $order->update_status( $this->status, __( 'GMOPG settlement completed.', 'wc-gmopg-gateway' ) );               
     288                        $order->update_status( $this->status, __( 'GMOPG settlement completed.', 'wc-gmopg-gateway' ) );
     289                        wp_redirect( $this->get_return_url( $order ) );
     290                        exit;       
    288291                    endif;
    289292                endif;
     
    301304                        switch ( $order->get_payment_method() ) :
    302305                            case 'gmopg_credit' :
     306                                add_post_meta( $order->id, '_transaction_id', $_POST['TranID'] );
    303307                                if ( empty($this->status) ) $this->status = 'processing';
    304308                                if ( isset($_POST['Amount']) && $_POST['Amount'] == $order->get_total() ) :
     
    311315                                if ( empty($this->status) ) $this->status = 'processing';
    312316                                if ( $_POST['Status'] == 'REQSUCCESS' ) :
     317                                    add_post_meta( $order->id, '_transaction_id', $_POST['TranID'] );
    313318                                    $order->update_status( 'on-hold', sprintf( __( 'GMOPG settlement displayed (Transaction No: %s, Detail: %s).', 'wc-gmopg-gateway' ), $_POST['TranID'], $_POST['CvsCode']." ".$_POST['CvsConfNo']." ".$_POST['CvsReceiptNo'] ) );               
    314319                                elseif ( $_POST['Status'] == 'PAYSUCCESS' ) :
     
    323328                                if ( empty($this->status) ) $this->status = 'processing';
    324329                                if ( $_POST['Status'] == 'REQSUCCESS' ) :
     330                                    add_post_meta( $order->id, '_transaction_id', $_POST['TranID'] );
    325331                                    $order->update_status( 'on-hold', sprintf( __( 'GMOPG settlement displayed (Transaction No: %s, Detail: %s).', 'wc-gmopg-gateway' ), $_POST['TranID'], $_POST['CustID']." ".$_POST['BkCode']." ".$_POST['ConfNo'] ) );             
    326332                                elseif ( $_POST['Status'] == 'PAYSUCCESS' ) :
     
    531537                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    532538               
    533                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     539                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    534540                $param['transaction']['Amount'] = $order->get_total();         
    535541                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    589595                    elseif ( !empty($result['transactionresult']['ErrCode']) && !empty($result['transactionresult']['ErrInfo']) ) :
    590596                        $order->update_status( 'failed', "ErrCode=" . esc_attr($result['transactionresult']['ErrCode']) . "\n" . "ErrInfo=" . esc_attr($result['transactionresult']['ErrInfo']) );
     597                        wp_redirect(wc_get_checkout_url());
     598                        exit;
    591599                    else :
    592                         $order->update_status( 'on-hold', __( 'GMOPG settlement requested.', 'wc-gmopg-gateway' ) );               
     600                        $order->update_status( 'on-hold', __( 'GMOPG settlement requested.', 'wc-gmopg-gateway' ) );
     601                        wp_redirect( $this->get_return_url( $order ) );
     602                        exit;
    593603                    endif;
    594604                endif;
     
    686696                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    687697               
    688                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     698                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    689699                $param['transaction']['Amount'] = $order->get_total();         
    690700                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    747757                        exit;
    748758                    else :
    749                         $order->update_status( 'on-hold', __( 'GMOPG settlement requested.', 'wc-gmopg-gateway' ) );               
     759                        $order->update_status( 'on-hold', __( 'GMOPG settlement requested.', 'wc-gmopg-gateway' ) );
     760                        wp_redirect( $this->get_return_url( $order ) );
     761                        exit;   
    750762                    endif;
    751763                endif;
     
    854866                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    855867               
    856                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     868                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    857869                $param['transaction']['Amount'] = $order->get_total();         
    858870                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    10241036                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    10251037               
    1026                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     1038                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    10271039                $param['transaction']['Amount'] = $order->get_total();         
    10281040                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    11921204                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    11931205               
    1194                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     1206                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    11951207                $param['transaction']['Amount'] = $order->get_total();         
    11961208                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    13501362                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    13511363               
    1352                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     1364                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    13531365                $param['transaction']['Amount'] = $order->get_total();         
    13541366                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    15071519                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    15081520               
    1509                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     1521                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    15101522                $param['transaction']['Amount'] = $order->get_total();         
    15111523                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    16731685                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    16741686               
    1675                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     1687                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    16761688                $param['transaction']['Amount'] = $order->get_total();         
    16771689                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    18301842                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    18311843               
    1832                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     1844                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    18331845                $param['transaction']['Amount'] = $order->get_total();         
    18341846                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    19962008                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    19972009               
    1998                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     2010                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    19992011                $param['transaction']['Amount'] = $order->get_total();         
    20002012                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    21642176                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    21652177               
    2166                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     2178                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    21672179                $param['transaction']['Amount'] = $order->get_total();         
    21682180                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    23322344                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    23332345               
    2334                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     2346                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    23352347                $param['transaction']['Amount'] = $order->get_total();         
    23362348                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    25002512                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    25012513               
    2502                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     2514                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    25032515                $param['transaction']['Amount'] = $order->get_total();         
    25042516                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
     
    26682680                $param['geturlparam']['ShopPass'] = $this->ShopPass;
    26692681               
    2670                 $param['transaction']['OrderID'] = "wcgmopg".$order_id;
     2682                $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U');
    26712683                $param['transaction']['Amount'] = $order->get_total();         
    26722684                $param['transaction']['RetUrl'] = $this->get_return_url( $order );
Note: See TracChangeset for help on using the changeset viewer.