Changeset 3216319
- Timestamp:
- 01/03/2025 08:52:08 AM (11 months ago)
- Location:
- wc-gmopg-gateway/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wc-gmopg-gateway.php (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-gmopg-gateway/trunk/readme.txt
r3201243 r3216319 5 5 Requires at least: 4.4 6 6 Tested up to: 6.7.1 7 Stable tag: 0.1. 37 Stable tag: 0.1.4 8 8 License: GPLv2 or later 9 9 … … 44 44 == Changelog == 45 45 46 = 0.1.4 = 47 * Recording the transaction ID. 48 * Bugfix: payment from the order history. 49 46 50 = 0.1.3 = 47 51 * Support for High-Performance Order Storage. -
wc-gmopg-gateway/trunk/wc-gmopg-gateway.php
r3201243 r3216319 6 6 * Author: Hiroaki Miyashita 7 7 * Author URI: https://www.wpmarket.jp/ 8 * Version: 0.1. 38 * Version: 0.1.4 9 9 * Requires at least: 4.4 10 10 * Tested up to: 6.7.1 11 11 * WC requires at least: 3.0 12 * WC tested up to: 9. 4.212 * WC tested up to: 9.5.1 13 13 * Text Domain: wc-gmopg-gateway 14 14 * Domain Path: / … … 224 224 $param['geturlparam']['ShopPass'] = $this->ShopPass; 225 225 226 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;226 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 227 227 $param['transaction']['Amount'] = $order->get_total(); 228 228 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 256 256 wc_gmopg_gateway_logging( $param_json, $this->logging ); 257 257 wc_gmopg_gateway_logging( $response_data, $this->logging ); 258 wc_gmopg_gateway_logging( $order->get_order_key(), $this->logging ); 258 259 $order->add_order_note( $err_msg ); 259 260 return; 260 261 endif; 261 262 262 263 return array( 263 264 'result' => 'success', … … 269 270 $order = wc_get_order( $order_id ); 270 271 if ( 'gmopg_credit' !== $order->get_payment_method() ) return; 271 272 272 273 if ( !empty($_POST['result']) ) : 273 274 if ( empty($this->status) ) $this->status = 'processing'; … … 285 286 exit; 286 287 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; 288 291 endif; 289 292 endif; … … 301 304 switch ( $order->get_payment_method() ) : 302 305 case 'gmopg_credit' : 306 add_post_meta( $order->id, '_transaction_id', $_POST['TranID'] ); 303 307 if ( empty($this->status) ) $this->status = 'processing'; 304 308 if ( isset($_POST['Amount']) && $_POST['Amount'] == $order->get_total() ) : … … 311 315 if ( empty($this->status) ) $this->status = 'processing'; 312 316 if ( $_POST['Status'] == 'REQSUCCESS' ) : 317 add_post_meta( $order->id, '_transaction_id', $_POST['TranID'] ); 313 318 $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'] ) ); 314 319 elseif ( $_POST['Status'] == 'PAYSUCCESS' ) : … … 323 328 if ( empty($this->status) ) $this->status = 'processing'; 324 329 if ( $_POST['Status'] == 'REQSUCCESS' ) : 330 add_post_meta( $order->id, '_transaction_id', $_POST['TranID'] ); 325 331 $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'] ) ); 326 332 elseif ( $_POST['Status'] == 'PAYSUCCESS' ) : … … 531 537 $param['geturlparam']['ShopPass'] = $this->ShopPass; 532 538 533 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;539 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 534 540 $param['transaction']['Amount'] = $order->get_total(); 535 541 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 589 595 elseif ( !empty($result['transactionresult']['ErrCode']) && !empty($result['transactionresult']['ErrInfo']) ) : 590 596 $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; 591 599 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; 593 603 endif; 594 604 endif; … … 686 696 $param['geturlparam']['ShopPass'] = $this->ShopPass; 687 697 688 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;698 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 689 699 $param['transaction']['Amount'] = $order->get_total(); 690 700 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 747 757 exit; 748 758 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; 750 762 endif; 751 763 endif; … … 854 866 $param['geturlparam']['ShopPass'] = $this->ShopPass; 855 867 856 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;868 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 857 869 $param['transaction']['Amount'] = $order->get_total(); 858 870 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 1024 1036 $param['geturlparam']['ShopPass'] = $this->ShopPass; 1025 1037 1026 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;1038 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 1027 1039 $param['transaction']['Amount'] = $order->get_total(); 1028 1040 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 1192 1204 $param['geturlparam']['ShopPass'] = $this->ShopPass; 1193 1205 1194 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;1206 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 1195 1207 $param['transaction']['Amount'] = $order->get_total(); 1196 1208 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 1350 1362 $param['geturlparam']['ShopPass'] = $this->ShopPass; 1351 1363 1352 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;1364 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 1353 1365 $param['transaction']['Amount'] = $order->get_total(); 1354 1366 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 1507 1519 $param['geturlparam']['ShopPass'] = $this->ShopPass; 1508 1520 1509 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;1521 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 1510 1522 $param['transaction']['Amount'] = $order->get_total(); 1511 1523 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 1673 1685 $param['geturlparam']['ShopPass'] = $this->ShopPass; 1674 1686 1675 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;1687 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 1676 1688 $param['transaction']['Amount'] = $order->get_total(); 1677 1689 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 1830 1842 $param['geturlparam']['ShopPass'] = $this->ShopPass; 1831 1843 1832 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;1844 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 1833 1845 $param['transaction']['Amount'] = $order->get_total(); 1834 1846 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 1996 2008 $param['geturlparam']['ShopPass'] = $this->ShopPass; 1997 2009 1998 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;2010 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 1999 2011 $param['transaction']['Amount'] = $order->get_total(); 2000 2012 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 2164 2176 $param['geturlparam']['ShopPass'] = $this->ShopPass; 2165 2177 2166 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;2178 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 2167 2179 $param['transaction']['Amount'] = $order->get_total(); 2168 2180 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 2332 2344 $param['geturlparam']['ShopPass'] = $this->ShopPass; 2333 2345 2334 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;2346 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 2335 2347 $param['transaction']['Amount'] = $order->get_total(); 2336 2348 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 2500 2512 $param['geturlparam']['ShopPass'] = $this->ShopPass; 2501 2513 2502 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;2514 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 2503 2515 $param['transaction']['Amount'] = $order->get_total(); 2504 2516 $param['transaction']['RetUrl'] = $this->get_return_url( $order ); … … 2668 2680 $param['geturlparam']['ShopPass'] = $this->ShopPass; 2669 2681 2670 $param['transaction']['OrderID'] = "wcgmopg" .$order_id;2682 $param['transaction']['OrderID'] = "wcgmopg" . $order_id . '-' . date_i18n('U'); 2671 2683 $param['transaction']['Amount'] = $order->get_total(); 2672 2684 $param['transaction']['RetUrl'] = $this->get_return_url( $order );
Note: See TracChangeset
for help on using the changeset viewer.