Changeset 3373384
- Timestamp:
- 10/06/2025 05:44:12 AM (6 months ago)
- Location:
- simple-payment
- Files:
-
- 16 edited
- 1 copied
-
tags/2.4.7 (copied) (copied from simple-payment/trunk)
-
tags/2.4.7/addons/woocommerce/init.php (modified) (1 diff)
-
tags/2.4.7/admin/transaction-list-table.php (modified) (1 diff)
-
tags/2.4.7/curl.log (modified) (1 diff)
-
tags/2.4.7/languages/simple-payment.pot (modified) (11 diffs)
-
tags/2.4.7/readme.txt (modified) (1 diff)
-
tags/2.4.7/simple-payment-plugin.php (modified) (10 diffs)
-
tags/2.4.7/vendor/yalla-ya/simple-payment/Engines/Cardcom.php (modified) (1 diff)
-
tags/2.4.7/vendor/yalla-ya/simple-payment/Engines/Engine.php (modified) (1 diff)
-
trunk/addons/woocommerce/init.php (modified) (1 diff)
-
trunk/admin/transaction-list-table.php (modified) (1 diff)
-
trunk/curl.log (modified) (1 diff)
-
trunk/languages/simple-payment.pot (modified) (11 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/simple-payment-plugin.php (modified) (10 diffs)
-
trunk/vendor/yalla-ya/simple-payment/Engines/Cardcom.php (modified) (1 diff)
-
trunk/vendor/yalla-ya/simple-payment/Engines/Engine.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
simple-payment/tags/2.4.7/addons/woocommerce/init.php
r3332473 r3373384 692 692 try { 693 693 //get_checkout_order_received_url, get_cancel_order_url_raw 694 694 $settings = $this->get_option( 'settings' ) ? json_decode( $this->get_option( 'settings' ), true, 512, JSON_OBJECT_AS_ARRAY ) : []; 695 if ( $settings ) $params = array_merge( $settings, $params ); 696 695 697 $params[ 'redirect_url' ] = WC()->api_request_url( "{$this}" ); 696 698 -
simple-payment/tags/2.4.7/admin/transaction-list-table.php
r3338694 r3373384 60 60 echo '<select id="engine" class="sp-filter-engine" name="engine"><option value="">' . __( 'All Engines', 'simple-payment' ) . '</option>'; 61 61 foreach ($options as $option) { 62 if ( $option[ 'title' ] ) echo '<option value="' . esc_attr( $option[ 'title' ] ) . '"' . ( $engine == $option[ 'title' ] ? ' selected' : '' ) . '>' . esc_html( $option[ 'title' ] ) . '</option>'; 62 if ( $option[ 'title' ] ) 63 echo '<option value="' . esc_attr( $option[ 'title' ] ) . '"' . ( $engine == $option[ 'title' ] ? ' selected' : '' ) . '>' 64 . esc_html( $option[ 'title' ] ) . '</option>'; 63 65 } 64 66 echo "</select>"; 65 67 } 66 echo '<label for="from-date">Date Range:</label><input type="date" name="created_from" id="from-date" value="' . ( isset( $_REQUEST[ 'created_from' ] ) ? $_REQUEST[ 'created_from' ] : '' ) . '" /><input type="date" name="created_to" id="to-date" value="' . ( isset( $_REQUEST[ 'created_to' ] ) ? $_REQUEST[ 'created_to' ]: '' ) . '" />';68 echo '<label for="from-date">Date Range:</label><input type="date" name="created_from" id="from-date" value="' . ( isset( $_REQUEST[ 'created_from' ] ) ? sanitize_text_field( $_REQUEST[ 'created_from' ] ) : '' ) . '" /><input type="date" name="created_to" id="to-date" value="' . ( isset( $_REQUEST[ 'created_to' ] ) ? sanitize_text_field( $_REQUEST[ 'created_to' ] ) : '' ) . '" />'; 67 69 echo '<input type="submit" name="filter_action" id="transaction-query-submit" class="button" value="' . __( 'Filter', 'simple-payment' ) . '">'; 68 70 echo '</div>'; -
simple-payment/tags/2.4.7/curl.log
r3332473 r3373384 657 657 < 658 658 * Connection #0 to host licensing.yalla-ya.com left intact 659 * Host licensing.yalla-ya.com:443 was resolved. 660 * IPv6: 2607:f8b0:4012:808::2013 661 * IPv4: 172.217.3.147 662 * Trying [2607:f8b0:4012:808::2013]:443... 663 * ALPN: curl offers h2,http/1.1 664 * CAfile: /usr/local/etc/openssl@3/cert.pem 665 * CApath: none 666 * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / x25519 / RSASSA-PSS 667 * ALPN: server accepted h2 668 * Server certificate: 669 * subject: CN=licensing.yalla-ya.com 670 * start date: Aug 9 05:17:41 2025 GMT 671 * expire date: Nov 7 06:04:50 2025 GMT 672 * subjectAltName: host "licensing.yalla-ya.com" matched cert's "licensing.yalla-ya.com" 673 * issuer: C=US; O=Google Trust Services; CN=WR3 674 * SSL certificate verify ok. 675 * Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption 676 * Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption 677 * Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha384WithRSAEncryption 678 * Connected to licensing.yalla-ya.com (2607:f8b0:4012:808::2013) port 443 679 * using HTTP/2 680 * [HTTP/2] [1] OPENED stream for https://licensing.yalla-ya.com/validate 681 * [HTTP/2] [1] [:method: POST] 682 * [HTTP/2] [1] [:scheme: https] 683 * [HTTP/2] [1] [:authority: licensing.yalla-ya.com] 684 * [HTTP/2] [1] [:path: /validate] 685 * [HTTP/2] [1] [accept: */*] 686 * [HTTP/2] [1] [content-length: 5] 687 * [HTTP/2] [1] [content-type: application/x-www-form-urlencoded] 688 > POST /validate HTTP/2 689 Host: licensing.yalla-ya.com 690 Accept: */* 691 Content-Length: 5 692 Content-Type: application/x-www-form-urlencoded 693 694 * upload completely sent off: 5 bytes 695 < HTTP/2 200 696 < x-powered-by: Express 697 < content-type: application/json; charset=utf-8 698 < etag: W/"b5-ksg7nPT+IdK8wH8TvJQvncgMyDw" 699 < vary: Accept-Encoding 700 < x-cloud-trace-context: dee11b461b9238b47bc2823bbeea064b;o=1 701 < date: Thu, 02 Oct 2025 01:12:13 GMT 702 < server: Google Frontend 703 < content-length: 181 704 < 705 * Connection #0 to host licensing.yalla-ya.com left intact 706 * Host licensing.yalla-ya.com:443 was resolved. 707 * IPv6: 2607:f8b0:4012:808::2013 708 * IPv4: 172.217.3.147 709 * Trying [2607:f8b0:4012:808::2013]:443... 710 * ALPN: curl offers h2,http/1.1 711 * CAfile: /usr/local/etc/openssl@3/cert.pem 712 * CApath: none 713 * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / x25519 / RSASSA-PSS 714 * ALPN: server accepted h2 715 * Server certificate: 716 * subject: CN=licensing.yalla-ya.com 717 * start date: Aug 9 05:17:41 2025 GMT 718 * expire date: Nov 7 06:04:50 2025 GMT 719 * subjectAltName: host "licensing.yalla-ya.com" matched cert's "licensing.yalla-ya.com" 720 * issuer: C=US; O=Google Trust Services; CN=WR3 721 * SSL certificate verify ok. 722 * Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption 723 * Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption 724 * Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha384WithRSAEncryption 725 * Connected to licensing.yalla-ya.com (2607:f8b0:4012:808::2013) port 443 726 * using HTTP/2 727 * [HTTP/2] [1] OPENED stream for https://licensing.yalla-ya.com/validate 728 * [HTTP/2] [1] [:method: POST] 729 * [HTTP/2] [1] [:scheme: https] 730 * [HTTP/2] [1] [:authority: licensing.yalla-ya.com] 731 * [HTTP/2] [1] [:path: /validate] 732 * [HTTP/2] [1] [accept: */*] 733 * [HTTP/2] [1] [content-length: 5] 734 * [HTTP/2] [1] [content-type: application/x-www-form-urlencoded] 735 > POST /validate HTTP/2 736 Host: licensing.yalla-ya.com 737 Accept: */* 738 Content-Length: 5 739 Content-Type: application/x-www-form-urlencoded 740 741 * upload completely sent off: 5 bytes 742 < HTTP/2 200 743 < x-powered-by: Express 744 < content-type: application/json; charset=utf-8 745 < etag: W/"b5-KIAY0Qta3YH+dNXP3Fnhv/lO+Zw" 746 < vary: Accept-Encoding 747 < x-cloud-trace-context: 8fafc6f3dee85d9ba599f71d1deb6c75;o=1 748 < date: Thu, 02 Oct 2025 14:22:04 GMT 749 < server: Google Frontend 750 < content-length: 181 751 < 752 * Connection #0 to host licensing.yalla-ya.com left intact -
simple-payment/tags/2.4.7/languages/simple-payment.pot
r3338694 r3373384 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Simple Payment 2.4. 5\n"5 "Project-Id-Version: Simple Payment 2.4.6\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/simple-payment\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025- 08-04T04:57:57+00:00\n"12 "POT-Creation-Date: 2025-10-06T05:41:34+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.10.0\n" … … 86 86 87 87 #: addons/elementor/widget.php:103 88 #: admin/transaction-list-table.php:23 688 #: admin/transaction-list-table.php:238 89 89 msgid "Amount" 90 90 msgstr "" … … 202 202 #: addons/wpjobboard/config.php:12 203 203 #: admin/settings.php:111 204 #: admin/transaction-list-table.php:23 7204 #: admin/transaction-list-table.php:239 205 205 #: settings.php:110 206 206 msgid "Engine" … … 581 581 msgstr "" 582 582 583 #: addons/woocommerce/init.php:73 4583 #: addons/woocommerce/init.php:736 584 584 msgid "Payment error [ SP ID: %s ]: %s" 585 585 msgstr "" 586 586 587 #: addons/woocommerce/init.php:76 1587 #: addons/woocommerce/init.php:763 588 588 msgid "Payment error[ SP ID: %s ]: unkown." 589 589 msgstr "" 590 590 591 #: addons/woocommerce/init.php:81 3591 #: addons/woocommerce/init.php:815 592 592 msgid "Pay for order" 593 593 msgstr "" 594 594 595 #: addons/woocommerce/init.php:83 7595 #: addons/woocommerce/init.php:839 596 596 msgid "Visa" 597 597 msgstr "" 598 598 599 #: addons/woocommerce/init.php:8 38599 #: addons/woocommerce/init.php:840 600 600 msgid "Mastercard" 601 601 msgstr "" 602 602 603 #: addons/woocommerce/init.php:8 39603 #: addons/woocommerce/init.php:841 604 604 msgid "American Express" 605 605 msgstr "" … … 717 717 #: admin/admin.php:190 718 718 #: admin/admin.php:191 719 #: admin/transaction-list-table.php:2 39719 #: admin/transaction-list-table.php:241 720 720 msgid "Payments" 721 721 msgstr "" … … 1157 1157 1158 1158 #: admin/settings.php:117 1159 #: admin/transaction-list-table.php:2 491159 #: admin/transaction-list-table.php:251 1160 1160 #: settings.php:116 1161 1161 msgid "Sandbox" … … 1334 1334 1335 1335 #: admin/settings.php:168 1336 #: admin/transaction-list-table.php:15 51337 #: admin/transaction-list-table.php:17 61336 #: admin/transaction-list-table.php:157 1337 #: admin/transaction-list-table.php:178 1338 1338 #: settings.php:167 1339 1339 msgid "Archive" … … 1871 1871 1872 1872 #: admin/transaction-list-table.php:36 1873 #: admin/transaction-list-table.php:25 11873 #: admin/transaction-list-table.php:253 1874 1874 msgid "Created" 1875 1875 msgstr "" … … 1883 1883 msgstr "" 1884 1884 1885 #: admin/transaction-list-table.php:6 71885 #: admin/transaction-list-table.php:69 1886 1886 msgid "Filter" 1887 1887 msgstr "" 1888 1888 1889 #: admin/transaction-list-table.php:13 21889 #: admin/transaction-list-table.php:134 1890 1890 msgid "No transactions avaliable." 1891 1891 msgstr "" 1892 1892 1893 #: admin/transaction-list-table.php:14 51894 #: admin/transaction-list-table.php:17 11893 #: admin/transaction-list-table.php:147 1894 #: admin/transaction-list-table.php:173 1895 1895 msgid "Unarchive" 1896 1896 msgstr "" 1897 1897 1898 #: admin/transaction-list-table.php:16 01899 #: admin/transaction-list-table.php:17 51898 #: admin/transaction-list-table.php:162 1899 #: admin/transaction-list-table.php:177 1900 1900 msgid "Verify" 1901 1901 msgstr "" 1902 1902 1903 #: admin/transaction-list-table.php:16 31903 #: admin/transaction-list-table.php:165 1904 1904 msgid "Details" 1905 1905 msgstr "" 1906 1906 1907 #: admin/transaction-list-table.php:23 41907 #: admin/transaction-list-table.php:236 1908 1908 msgid "ID" 1909 1909 msgstr "" 1910 1910 1911 #: admin/transaction-list-table.php:23 51911 #: admin/transaction-list-table.php:237 1912 1912 msgid "Concept" 1913 1913 msgstr "" 1914 1914 1915 #: admin/transaction-list-table.php:2 381915 #: admin/transaction-list-table.php:240 1916 1916 msgid "Status" 1917 1917 msgstr "" 1918 1918 1919 #: admin/transaction-list-table.php:24 01919 #: admin/transaction-list-table.php:242 1920 1920 msgid "Transaction ID" 1921 1921 msgstr "" 1922 1922 1923 #: admin/transaction-list-table.php:24 11923 #: admin/transaction-list-table.php:243 1924 1924 msgid "Confirmation Code" 1925 1925 msgstr "" 1926 1926 1927 #: admin/transaction-list-table.php:24 21927 #: admin/transaction-list-table.php:244 1928 1928 msgid "User" 1929 1929 msgstr "" 1930 1930 1931 #: admin/transaction-list-table.php:24 31931 #: admin/transaction-list-table.php:245 1932 1932 msgid "URL" 1933 1933 msgstr "" 1934 1934 1935 #: admin/transaction-list-table.php:24 41935 #: admin/transaction-list-table.php:246 1936 1936 msgid "Parameters" 1937 1937 msgstr "" 1938 1938 1939 #: admin/transaction-list-table.php:24 51939 #: admin/transaction-list-table.php:247 1940 1940 msgid "IP Address" 1941 1941 msgstr "" 1942 1942 1943 #: admin/transaction-list-table.php:24 61943 #: admin/transaction-list-table.php:248 1944 1944 msgid "User Agent" 1945 1945 msgstr "" 1946 1946 1947 #: admin/transaction-list-table.php:24 71947 #: admin/transaction-list-table.php:249 1948 1948 msgid "Error" 1949 1949 msgstr "" 1950 1950 1951 #: admin/transaction-list-table.php:2 481951 #: admin/transaction-list-table.php:250 1952 1952 msgid "Token" 1953 1953 msgstr "" 1954 1954 1955 #: admin/transaction-list-table.php:25 01955 #: admin/transaction-list-table.php:252 1956 1956 msgid "Modified" 1957 1957 msgstr "" 1958 1958 1959 #: admin/transaction-list-table.php:2 791959 #: admin/transaction-list-table.php:281 1960 1960 msgid "Verification result for %s:<br />%s" 1961 1961 msgstr "" … … 1970 1970 msgstr "" 1971 1971 1972 #: simple-payment-plugin.php:14 41972 #: simple-payment-plugin.php:146 1973 1973 msgid "Simple Payment License Error: %s" 1974 1974 msgstr "" 1975 1975 1976 #: simple-payment-plugin.php:14 41976 #: simple-payment-plugin.php:146 1977 1977 msgid "License error, or no license." 1978 1978 msgstr "" 1979 1979 1980 #: simple-payment-plugin.php:19 01980 #: simple-payment-plugin.php:192 1981 1981 msgid "Every %s Minutes" 1982 1982 msgstr "" 1983 1983 1984 #: simple-payment-plugin.php:5 871984 #: simple-payment-plugin.php:599 1985 1985 msgid "Error payment recharge" 1986 1986 msgstr "" 1987 1987 1988 #: simple-payment-plugin.php:836 1988 #: simple-payment-plugin.php:832 1989 msgid "Couldn't register transaction: %s" 1990 msgstr "" 1991 1992 #: simple-payment-plugin.php:855 1989 1993 msgid "Couldn't update transaction: %s" 1990 1994 msgstr "" -
simple-payment/tags/2.4.7/readme.txt
r3338694 r3373384 5 5 Requires at least: 4.6 6 6 Tested up to: 6.8.2 7 Stable tag: 2.4. 67 Stable tag: 2.4.7 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later -
simple-payment/tags/2.4.7/simple-payment-plugin.php
r3338694 r3373384 4 4 * Plugin URI: https://simple-payment.yalla-ya.com 5 5 * Description: Simple Payment enables integration with multiple payment gateways, and customize multiple payment forms. 6 * Version: 2.4. 66 * Version: 2.4.7 7 7 * Author: Ido Kobelkowsky / yalla ya! 8 8 * Author URI: https://github.com/idokd … … 91 91 } 92 92 if ( $engine != 'Custom' && $this->engine && $this->engine::$name == $engine ) return; 93 if ( file_exists( SPWP_PLUGIN_DIR . '/engines/' . strtolower( $engine ) . '.php' ) ) require_once( SPWP_PLUGIN_DIR . '/engines/' . strtolower( $engine ) . '.php' ); 93 $filename = strtolower( sanitize_file_name( wp_basename( $engine, '.php' ) ) ); 94 if ( file_exists( SPWP_PLUGIN_DIR . '/engines/' . $filename . '.php' ) ) 95 require_once( SPWP_PLUGIN_DIR . '/engines/' . $filename . '.php' ); 94 96 parent::setEngine( $engine ); 95 97 $callback = $this->callback_url(); … … 299 301 'status' => self::TRANSACTION_SUCCESS 300 302 ]; 301 if ( $this->engine->confirmation_code) $args['confirmation_code'] = $this->engine->confirmation_code; 302 if ( $this->engine->payments) $args['payments'] = $this->engine->payments; 303 if ( $this->engine->amount) $args['amount'] = $this->engine->amount; 303 if ( $this->engine->confirmation_code) $args[ 'confirmation_code' ] = $this->engine->confirmation_code; 304 if ( $this->engine->payments) $args[ 'payments' ] = $this->engine->payments; 305 if ( $this->engine->amount) $args[ 'amount' ] = $this->engine->amount; 306 if ( $this->param( 'user_create' ) != 'disabled' && $this->param( 'user_create_step' ) == 'post' && !get_current_user_id() ) { 307 $user_id = $this->create_user( $params ); 308 if ( $user_id ) $args[ 'user_id' ] = $user_id; 309 } 304 310 self::update( $this->payment_id ? : $this->engine->transaction, $args , !$this->payment_id ); 305 if ( $this->param( 'user_create' ) != 'disabled' && $this->param( 'user_create_step' ) == 'post' && !get_current_user_id() ) $this->create_user( $params );306 311 do_action( 'sp_payment_post_process', $params, $this->engine ); 307 312 return( true ); … … 334 339 if (!isset($params[self::FULL_NAME]) && (isset($params[self::FIRST_NAME]) || isset($params[self::LAST_NAME]))) $params[self::FULL_NAME] = trim((isset($params[self::FIRST_NAME]) ? $params[self::FIRST_NAME] : '').' '.(isset($params[self::LAST_NAME]) ? $params[self::LAST_NAME] : '')); 335 340 if (!isset($params[self::CARD_OWNER]) && isset($params[self::FULL_NAME])) $params[self::CARD_OWNER] = $params[self::FULL_NAME]; 336 if (!isset($params['payment_id']) || !$params['payment_id']) $params['payment_id'] = $this->register($params); 337 $this->payment_id = $params['payment_id']; 341 //if ( !isset( $params[ 'payment_id' ] ) || !$params[ 'payment_id' ] ) $params[ 'payment_id' ] = 342 $params = apply_filters( 'sp_payment_pre_process_filter', $params, $this->engine ); 343 //if ( empty( $params[ 'payment_id' ] ) ) 344 $params[ 'payment_id' ] = $this->payment_id = $this->register( $params ); 338 345 try { 339 $params = apply_filters( 'sp_payment_pre_process_filter', $params, $this->engine );340 346 $process = parent::pre_process( $params ); 341 self::update( $params[ 'payment_id' ], [ 'status' => self::TRANSACTION_PENDING, 'transaction_id' => $this->engine->transaction ] ); 347 self::update( $params[ 'payment_id' ], [ 348 'status' => self::TRANSACTION_PENDING, 349 'transaction_id' => $this->engine->transaction 350 ] ); 342 351 } catch ( Exception $e ) { 343 self::update( $params[ 'payment_id' ], [344 'status' => self::TRANSACTION_FAILED, 352 self::update( $params[ 'payment_id' ], [ 353 'status' => self::TRANSACTION_FAILED, 345 354 'transaction_id' => $this->engine->transaction, 346 355 'error_code' => $e->getCode(), … … 349 358 throw $e; 350 359 } 351 if ( $this->param( 'user_create' ) != 'disabled' && $this->param( 'user_create_step' ) == 'pre' && !get_current_user_id()) $this->create_user( $params ); 360 if ( $this->param( 'user_create' ) != 'disabled' && $this->param( 'user_create_step' ) == 'pre' && !get_current_user_id() ) { 361 $user_id = $this->create_user( $params ); 362 $params[ 'user_id' ] = $user_id; 363 } 352 364 do_action( 'sp_payment_pre_process', $params, $this->engine ); 353 365 return( $process ); … … 366 378 $engine = $engine ? : $this->param( 'engine' ); 367 379 $this->setEngine( $engine ); 380 $params = apply_filters( 'sp_creditcard_token_params', $params, $this->engine ); 368 381 $params[ 'payment_id' ] = $this->register( $params ); 369 $params = apply_filters( 'sp_creditcard_token_params', $params, $this->engine );370 382 if ( $params = parent::store( $params ) ) { 371 383 if ( isset( $params[ 'token' ] ) ) { … … 662 674 $username = $this->generate_unique_username( strtolower( $username ) ); 663 675 if ( $this->param( 'user_create_step' ) == 'register' ) $user_id = register_new_user( $username, $email ); 664 else $user_id = wp_create_user( $username, wp_generate_password( 12, false ), $email );676 else $user_id = wp_create_user( $username, wp_generate_password( 12, false ), $email ); 665 677 do_action( 'sp_user_created', $user_id, $params, false ); 678 679 // TODO: allow ssetting for autologin, or not 666 680 wp_set_auth_cookie( $user_id ); 667 681 } 668 682 } 669 683 if ( $user_id ) { 670 // TODO: Login should be handled by developer, impl mention,684 // TODO: Login should be handled by developer, implementation, 671 685 // could be redirecting user to login screen, or validating 672 686 // other data field that comes in $params that indicates it the user. … … 676 690 return( $user_id ); 677 691 } 678 692 679 693 function generate_unique_username( $username ) { 680 694 $username = sanitize_user( $username ); 681 static $i; 682 if ( null === $i ) $i = 1; 683 else $i ++; 684 if (! username_exists( $username ) ) return( $username ); 685 $new_username = sprintf( '%s-%s', $username, $i ); 686 if ( !username_exists( $new_username ) ) return( $new_username ); 687 else return( $this->generate_unique_username( $username ) ); 695 $i = 1; 696 $new_username = $username; 697 while ( username_exists( $new_username ) ) { 698 $new_username = $username . '-' . $i++; 699 } 700 return( $new_username ); 688 701 } 689 702 … … 799 812 $values = [ 800 813 'engine' => $this->engine::$name, 801 'currency' => isset( $params[self::CURRENCY]) && $params[self::CURRENCY] ? $params[self::CURRENCY] : $this->param('currency'),802 'amount' => self::tofloat( $params[self::AMOUNT]),803 'concept' => $params[ 'product'],804 'payments' => isset( $params[self::PAYMENTS]) ? $params[self::PAYMENTS] : null,805 'parameters' => $this->sanitize_pci_dss( json_encode($params)),814 'currency' => isset( $params[ self::CURRENCY ] ) && $params[ self::CURRENCY ] ? $params[ self::CURRENCY ] : $this->param('currency' ), 815 'amount' => self::tofloat( $params[ self::AMOUNT ] ), 816 'concept' => $params[ 'product' ] ?? ( isset( $params[ self::PRODUCT ] ) ? $params[ self::PRODUCT ] : null ), 817 'payments' => isset( $params[ self::PAYMENTS ] ) ? $params[ self::PAYMENTS ] : null, 818 'parameters' => $this->sanitize_pci_dss( json_encode( $params ) ), 806 819 'url' => wp_get_referer() ? $this->sanitize_pci_dss(wp_get_referer()) : '', 807 820 'status' => self::TRANSACTION_NEW, 808 821 'sandbox' => $this->sandbox, 809 'user_id' => get_current_user_id() ? : null,810 'ip_address' => $_SERVER[ 'REMOTE_ADDR'],811 'user_agent' => $_SERVER[ 'HTTP_USER_AGENT'],812 'parent_id' => isset( $params['payment_id']) ? $params['payment_id'] : null,822 'user_id' => $params[ 'user_id' ] ?? get_current_user_id(), 823 'ip_address' => $_SERVER[ 'REMOTE_ADDR' ] ?? null, 824 'user_agent' => $_SERVER[ 'HTTP_USER_AGENT' ] ?? null, 825 'parent_id' => isset( $params[ 'payment_id' ] ) ? $params[ 'payment_id' ] : null, 813 826 'modified' => current_time( 'mysql' ), 814 827 'created' => current_time( 'mysql' ), 815 828 ]; 816 $result = $wpdb->insert( $wpdb->prefix.self::$table_name, $values ); 817 if ( $wpdb->insert_id ) { 818 $this->payment_id = $wpdb->insert_id; 819 return( $this->payment_id ); 820 } 821 return( false ); 829 $result = $wpdb->insert( $wpdb->prefix . self::$table_name, $values ); 830 if ( $result === false ) 831 throw new Exception( 832 sprintf( __( "Couldn't register transaction: %s", 'simple-payment' ), 833 $wpdb->last_error 834 ) ); 835 $this->payment_id = $wpdb->insert_id; 836 return( $this->payment_id ? : false ); 822 837 } 823 838 … … 833 848 //$user_id = get_current_user_id(); 834 849 //if ( $user_id ) $params[ 'user_id' ] = $user_id; 835 $result = $wpdb->update( $table_name, $params, [ ( $transaction_id ? 'transaction_id' : 'id' ) => $id ] ); 836 if ( $result === false ) throw new Exception( sprintf( __( "Couldn't update transaction: %s", 'simple-payment' ), $wpdb->last_error ) ); 850 $result = $wpdb->update( $table_name, $params, [ 851 ( $transaction_id ? 'transaction_id' : 'id' ) => $id 852 ] ); 853 if ( $result === false ) 854 throw new Exception( 855 sprintf( __( "Couldn't update transaction: %s", 'simple-payment' ), $wpdb->last_error ) 856 ); 837 857 if ( isset( $token ) && $token ) { 838 858 do_action( 'sp_creditcard_token', $token, ( $id ? $id : $transaction_id ), $params ); -
simple-payment/tags/2.4.7/vendor/yalla-ya/simple-payment/Engines/Cardcom.php
r3319619 r3373384 548 548 549 549 if ($refund) $post[ 'TokenToCharge.RefundInsteadOfCharge' ] = $refund; 550 if ($params[ ' PAYMENTS' ] == 'monthly' ) $post[ 'TokenToCharge.IsAutoRecurringPayment' ] = 'true';551 552 if ( isset($params[ 'approval_number' ]) && $params[ 'approval_number' ]) $post[ 'TokenToCharge.ApprovalNumber' ] = $params[ 'approval_number' ];550 if ($params[ 'payments' ] == 'monthly' ) $post[ 'TokenToCharge.IsAutoRecurringPayment' ] = 'true'; 551 552 if ( !$refund &&isset($params[ 'approval_number' ]) && $params[ 'approval_number' ]) $post[ 'TokenToCharge.ApprovalNumber' ] = $params[ 'approval_number' ]; 553 553 554 554 -
simple-payment/tags/2.4.7/vendor/yalla-ya/simple-payment/Engines/Engine.php
r3319619 r3373384 163 163 # some error , send email to developer // TODO: Handle Error 164 164 if ( !empty( $error ) ) { 165 throw new Exception( $error . ' ' . $response. ' - ' . $url . ' (' . print_r( $vars, true ) . ')', 500 );165 throw new Exception( $error . ' ' . $response. ' - ' . $url, 500 ); 166 166 } 167 167 curl_close( $curl ); -
simple-payment/trunk/addons/woocommerce/init.php
r3332473 r3373384 692 692 try { 693 693 //get_checkout_order_received_url, get_cancel_order_url_raw 694 694 $settings = $this->get_option( 'settings' ) ? json_decode( $this->get_option( 'settings' ), true, 512, JSON_OBJECT_AS_ARRAY ) : []; 695 if ( $settings ) $params = array_merge( $settings, $params ); 696 695 697 $params[ 'redirect_url' ] = WC()->api_request_url( "{$this}" ); 696 698 -
simple-payment/trunk/admin/transaction-list-table.php
r3338694 r3373384 60 60 echo '<select id="engine" class="sp-filter-engine" name="engine"><option value="">' . __( 'All Engines', 'simple-payment' ) . '</option>'; 61 61 foreach ($options as $option) { 62 if ( $option[ 'title' ] ) echo '<option value="' . esc_attr( $option[ 'title' ] ) . '"' . ( $engine == $option[ 'title' ] ? ' selected' : '' ) . '>' . esc_html( $option[ 'title' ] ) . '</option>'; 62 if ( $option[ 'title' ] ) 63 echo '<option value="' . esc_attr( $option[ 'title' ] ) . '"' . ( $engine == $option[ 'title' ] ? ' selected' : '' ) . '>' 64 . esc_html( $option[ 'title' ] ) . '</option>'; 63 65 } 64 66 echo "</select>"; 65 67 } 66 echo '<label for="from-date">Date Range:</label><input type="date" name="created_from" id="from-date" value="' . ( isset( $_REQUEST[ 'created_from' ] ) ? $_REQUEST[ 'created_from' ] : '' ) . '" /><input type="date" name="created_to" id="to-date" value="' . ( isset( $_REQUEST[ 'created_to' ] ) ? $_REQUEST[ 'created_to' ]: '' ) . '" />';68 echo '<label for="from-date">Date Range:</label><input type="date" name="created_from" id="from-date" value="' . ( isset( $_REQUEST[ 'created_from' ] ) ? sanitize_text_field( $_REQUEST[ 'created_from' ] ) : '' ) . '" /><input type="date" name="created_to" id="to-date" value="' . ( isset( $_REQUEST[ 'created_to' ] ) ? sanitize_text_field( $_REQUEST[ 'created_to' ] ) : '' ) . '" />'; 67 69 echo '<input type="submit" name="filter_action" id="transaction-query-submit" class="button" value="' . __( 'Filter', 'simple-payment' ) . '">'; 68 70 echo '</div>'; -
simple-payment/trunk/curl.log
r3332473 r3373384 657 657 < 658 658 * Connection #0 to host licensing.yalla-ya.com left intact 659 * Host licensing.yalla-ya.com:443 was resolved. 660 * IPv6: 2607:f8b0:4012:808::2013 661 * IPv4: 172.217.3.147 662 * Trying [2607:f8b0:4012:808::2013]:443... 663 * ALPN: curl offers h2,http/1.1 664 * CAfile: /usr/local/etc/openssl@3/cert.pem 665 * CApath: none 666 * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / x25519 / RSASSA-PSS 667 * ALPN: server accepted h2 668 * Server certificate: 669 * subject: CN=licensing.yalla-ya.com 670 * start date: Aug 9 05:17:41 2025 GMT 671 * expire date: Nov 7 06:04:50 2025 GMT 672 * subjectAltName: host "licensing.yalla-ya.com" matched cert's "licensing.yalla-ya.com" 673 * issuer: C=US; O=Google Trust Services; CN=WR3 674 * SSL certificate verify ok. 675 * Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption 676 * Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption 677 * Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha384WithRSAEncryption 678 * Connected to licensing.yalla-ya.com (2607:f8b0:4012:808::2013) port 443 679 * using HTTP/2 680 * [HTTP/2] [1] OPENED stream for https://licensing.yalla-ya.com/validate 681 * [HTTP/2] [1] [:method: POST] 682 * [HTTP/2] [1] [:scheme: https] 683 * [HTTP/2] [1] [:authority: licensing.yalla-ya.com] 684 * [HTTP/2] [1] [:path: /validate] 685 * [HTTP/2] [1] [accept: */*] 686 * [HTTP/2] [1] [content-length: 5] 687 * [HTTP/2] [1] [content-type: application/x-www-form-urlencoded] 688 > POST /validate HTTP/2 689 Host: licensing.yalla-ya.com 690 Accept: */* 691 Content-Length: 5 692 Content-Type: application/x-www-form-urlencoded 693 694 * upload completely sent off: 5 bytes 695 < HTTP/2 200 696 < x-powered-by: Express 697 < content-type: application/json; charset=utf-8 698 < etag: W/"b5-ksg7nPT+IdK8wH8TvJQvncgMyDw" 699 < vary: Accept-Encoding 700 < x-cloud-trace-context: dee11b461b9238b47bc2823bbeea064b;o=1 701 < date: Thu, 02 Oct 2025 01:12:13 GMT 702 < server: Google Frontend 703 < content-length: 181 704 < 705 * Connection #0 to host licensing.yalla-ya.com left intact 706 * Host licensing.yalla-ya.com:443 was resolved. 707 * IPv6: 2607:f8b0:4012:808::2013 708 * IPv4: 172.217.3.147 709 * Trying [2607:f8b0:4012:808::2013]:443... 710 * ALPN: curl offers h2,http/1.1 711 * CAfile: /usr/local/etc/openssl@3/cert.pem 712 * CApath: none 713 * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / x25519 / RSASSA-PSS 714 * ALPN: server accepted h2 715 * Server certificate: 716 * subject: CN=licensing.yalla-ya.com 717 * start date: Aug 9 05:17:41 2025 GMT 718 * expire date: Nov 7 06:04:50 2025 GMT 719 * subjectAltName: host "licensing.yalla-ya.com" matched cert's "licensing.yalla-ya.com" 720 * issuer: C=US; O=Google Trust Services; CN=WR3 721 * SSL certificate verify ok. 722 * Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption 723 * Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption 724 * Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha384WithRSAEncryption 725 * Connected to licensing.yalla-ya.com (2607:f8b0:4012:808::2013) port 443 726 * using HTTP/2 727 * [HTTP/2] [1] OPENED stream for https://licensing.yalla-ya.com/validate 728 * [HTTP/2] [1] [:method: POST] 729 * [HTTP/2] [1] [:scheme: https] 730 * [HTTP/2] [1] [:authority: licensing.yalla-ya.com] 731 * [HTTP/2] [1] [:path: /validate] 732 * [HTTP/2] [1] [accept: */*] 733 * [HTTP/2] [1] [content-length: 5] 734 * [HTTP/2] [1] [content-type: application/x-www-form-urlencoded] 735 > POST /validate HTTP/2 736 Host: licensing.yalla-ya.com 737 Accept: */* 738 Content-Length: 5 739 Content-Type: application/x-www-form-urlencoded 740 741 * upload completely sent off: 5 bytes 742 < HTTP/2 200 743 < x-powered-by: Express 744 < content-type: application/json; charset=utf-8 745 < etag: W/"b5-KIAY0Qta3YH+dNXP3Fnhv/lO+Zw" 746 < vary: Accept-Encoding 747 < x-cloud-trace-context: 8fafc6f3dee85d9ba599f71d1deb6c75;o=1 748 < date: Thu, 02 Oct 2025 14:22:04 GMT 749 < server: Google Frontend 750 < content-length: 181 751 < 752 * Connection #0 to host licensing.yalla-ya.com left intact -
simple-payment/trunk/languages/simple-payment.pot
r3338694 r3373384 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Simple Payment 2.4. 5\n"5 "Project-Id-Version: Simple Payment 2.4.6\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/simple-payment\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025- 08-04T04:57:57+00:00\n"12 "POT-Creation-Date: 2025-10-06T05:41:34+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.10.0\n" … … 86 86 87 87 #: addons/elementor/widget.php:103 88 #: admin/transaction-list-table.php:23 688 #: admin/transaction-list-table.php:238 89 89 msgid "Amount" 90 90 msgstr "" … … 202 202 #: addons/wpjobboard/config.php:12 203 203 #: admin/settings.php:111 204 #: admin/transaction-list-table.php:23 7204 #: admin/transaction-list-table.php:239 205 205 #: settings.php:110 206 206 msgid "Engine" … … 581 581 msgstr "" 582 582 583 #: addons/woocommerce/init.php:73 4583 #: addons/woocommerce/init.php:736 584 584 msgid "Payment error [ SP ID: %s ]: %s" 585 585 msgstr "" 586 586 587 #: addons/woocommerce/init.php:76 1587 #: addons/woocommerce/init.php:763 588 588 msgid "Payment error[ SP ID: %s ]: unkown." 589 589 msgstr "" 590 590 591 #: addons/woocommerce/init.php:81 3591 #: addons/woocommerce/init.php:815 592 592 msgid "Pay for order" 593 593 msgstr "" 594 594 595 #: addons/woocommerce/init.php:83 7595 #: addons/woocommerce/init.php:839 596 596 msgid "Visa" 597 597 msgstr "" 598 598 599 #: addons/woocommerce/init.php:8 38599 #: addons/woocommerce/init.php:840 600 600 msgid "Mastercard" 601 601 msgstr "" 602 602 603 #: addons/woocommerce/init.php:8 39603 #: addons/woocommerce/init.php:841 604 604 msgid "American Express" 605 605 msgstr "" … … 717 717 #: admin/admin.php:190 718 718 #: admin/admin.php:191 719 #: admin/transaction-list-table.php:2 39719 #: admin/transaction-list-table.php:241 720 720 msgid "Payments" 721 721 msgstr "" … … 1157 1157 1158 1158 #: admin/settings.php:117 1159 #: admin/transaction-list-table.php:2 491159 #: admin/transaction-list-table.php:251 1160 1160 #: settings.php:116 1161 1161 msgid "Sandbox" … … 1334 1334 1335 1335 #: admin/settings.php:168 1336 #: admin/transaction-list-table.php:15 51337 #: admin/transaction-list-table.php:17 61336 #: admin/transaction-list-table.php:157 1337 #: admin/transaction-list-table.php:178 1338 1338 #: settings.php:167 1339 1339 msgid "Archive" … … 1871 1871 1872 1872 #: admin/transaction-list-table.php:36 1873 #: admin/transaction-list-table.php:25 11873 #: admin/transaction-list-table.php:253 1874 1874 msgid "Created" 1875 1875 msgstr "" … … 1883 1883 msgstr "" 1884 1884 1885 #: admin/transaction-list-table.php:6 71885 #: admin/transaction-list-table.php:69 1886 1886 msgid "Filter" 1887 1887 msgstr "" 1888 1888 1889 #: admin/transaction-list-table.php:13 21889 #: admin/transaction-list-table.php:134 1890 1890 msgid "No transactions avaliable." 1891 1891 msgstr "" 1892 1892 1893 #: admin/transaction-list-table.php:14 51894 #: admin/transaction-list-table.php:17 11893 #: admin/transaction-list-table.php:147 1894 #: admin/transaction-list-table.php:173 1895 1895 msgid "Unarchive" 1896 1896 msgstr "" 1897 1897 1898 #: admin/transaction-list-table.php:16 01899 #: admin/transaction-list-table.php:17 51898 #: admin/transaction-list-table.php:162 1899 #: admin/transaction-list-table.php:177 1900 1900 msgid "Verify" 1901 1901 msgstr "" 1902 1902 1903 #: admin/transaction-list-table.php:16 31903 #: admin/transaction-list-table.php:165 1904 1904 msgid "Details" 1905 1905 msgstr "" 1906 1906 1907 #: admin/transaction-list-table.php:23 41907 #: admin/transaction-list-table.php:236 1908 1908 msgid "ID" 1909 1909 msgstr "" 1910 1910 1911 #: admin/transaction-list-table.php:23 51911 #: admin/transaction-list-table.php:237 1912 1912 msgid "Concept" 1913 1913 msgstr "" 1914 1914 1915 #: admin/transaction-list-table.php:2 381915 #: admin/transaction-list-table.php:240 1916 1916 msgid "Status" 1917 1917 msgstr "" 1918 1918 1919 #: admin/transaction-list-table.php:24 01919 #: admin/transaction-list-table.php:242 1920 1920 msgid "Transaction ID" 1921 1921 msgstr "" 1922 1922 1923 #: admin/transaction-list-table.php:24 11923 #: admin/transaction-list-table.php:243 1924 1924 msgid "Confirmation Code" 1925 1925 msgstr "" 1926 1926 1927 #: admin/transaction-list-table.php:24 21927 #: admin/transaction-list-table.php:244 1928 1928 msgid "User" 1929 1929 msgstr "" 1930 1930 1931 #: admin/transaction-list-table.php:24 31931 #: admin/transaction-list-table.php:245 1932 1932 msgid "URL" 1933 1933 msgstr "" 1934 1934 1935 #: admin/transaction-list-table.php:24 41935 #: admin/transaction-list-table.php:246 1936 1936 msgid "Parameters" 1937 1937 msgstr "" 1938 1938 1939 #: admin/transaction-list-table.php:24 51939 #: admin/transaction-list-table.php:247 1940 1940 msgid "IP Address" 1941 1941 msgstr "" 1942 1942 1943 #: admin/transaction-list-table.php:24 61943 #: admin/transaction-list-table.php:248 1944 1944 msgid "User Agent" 1945 1945 msgstr "" 1946 1946 1947 #: admin/transaction-list-table.php:24 71947 #: admin/transaction-list-table.php:249 1948 1948 msgid "Error" 1949 1949 msgstr "" 1950 1950 1951 #: admin/transaction-list-table.php:2 481951 #: admin/transaction-list-table.php:250 1952 1952 msgid "Token" 1953 1953 msgstr "" 1954 1954 1955 #: admin/transaction-list-table.php:25 01955 #: admin/transaction-list-table.php:252 1956 1956 msgid "Modified" 1957 1957 msgstr "" 1958 1958 1959 #: admin/transaction-list-table.php:2 791959 #: admin/transaction-list-table.php:281 1960 1960 msgid "Verification result for %s:<br />%s" 1961 1961 msgstr "" … … 1970 1970 msgstr "" 1971 1971 1972 #: simple-payment-plugin.php:14 41972 #: simple-payment-plugin.php:146 1973 1973 msgid "Simple Payment License Error: %s" 1974 1974 msgstr "" 1975 1975 1976 #: simple-payment-plugin.php:14 41976 #: simple-payment-plugin.php:146 1977 1977 msgid "License error, or no license." 1978 1978 msgstr "" 1979 1979 1980 #: simple-payment-plugin.php:19 01980 #: simple-payment-plugin.php:192 1981 1981 msgid "Every %s Minutes" 1982 1982 msgstr "" 1983 1983 1984 #: simple-payment-plugin.php:5 871984 #: simple-payment-plugin.php:599 1985 1985 msgid "Error payment recharge" 1986 1986 msgstr "" 1987 1987 1988 #: simple-payment-plugin.php:836 1988 #: simple-payment-plugin.php:832 1989 msgid "Couldn't register transaction: %s" 1990 msgstr "" 1991 1992 #: simple-payment-plugin.php:855 1989 1993 msgid "Couldn't update transaction: %s" 1990 1994 msgstr "" -
simple-payment/trunk/readme.txt
r3338694 r3373384 5 5 Requires at least: 4.6 6 6 Tested up to: 6.8.2 7 Stable tag: 2.4. 67 Stable tag: 2.4.7 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later -
simple-payment/trunk/simple-payment-plugin.php
r3338694 r3373384 4 4 * Plugin URI: https://simple-payment.yalla-ya.com 5 5 * Description: Simple Payment enables integration with multiple payment gateways, and customize multiple payment forms. 6 * Version: 2.4. 66 * Version: 2.4.7 7 7 * Author: Ido Kobelkowsky / yalla ya! 8 8 * Author URI: https://github.com/idokd … … 91 91 } 92 92 if ( $engine != 'Custom' && $this->engine && $this->engine::$name == $engine ) return; 93 if ( file_exists( SPWP_PLUGIN_DIR . '/engines/' . strtolower( $engine ) . '.php' ) ) require_once( SPWP_PLUGIN_DIR . '/engines/' . strtolower( $engine ) . '.php' ); 93 $filename = strtolower( sanitize_file_name( wp_basename( $engine, '.php' ) ) ); 94 if ( file_exists( SPWP_PLUGIN_DIR . '/engines/' . $filename . '.php' ) ) 95 require_once( SPWP_PLUGIN_DIR . '/engines/' . $filename . '.php' ); 94 96 parent::setEngine( $engine ); 95 97 $callback = $this->callback_url(); … … 299 301 'status' => self::TRANSACTION_SUCCESS 300 302 ]; 301 if ( $this->engine->confirmation_code) $args['confirmation_code'] = $this->engine->confirmation_code; 302 if ( $this->engine->payments) $args['payments'] = $this->engine->payments; 303 if ( $this->engine->amount) $args['amount'] = $this->engine->amount; 303 if ( $this->engine->confirmation_code) $args[ 'confirmation_code' ] = $this->engine->confirmation_code; 304 if ( $this->engine->payments) $args[ 'payments' ] = $this->engine->payments; 305 if ( $this->engine->amount) $args[ 'amount' ] = $this->engine->amount; 306 if ( $this->param( 'user_create' ) != 'disabled' && $this->param( 'user_create_step' ) == 'post' && !get_current_user_id() ) { 307 $user_id = $this->create_user( $params ); 308 if ( $user_id ) $args[ 'user_id' ] = $user_id; 309 } 304 310 self::update( $this->payment_id ? : $this->engine->transaction, $args , !$this->payment_id ); 305 if ( $this->param( 'user_create' ) != 'disabled' && $this->param( 'user_create_step' ) == 'post' && !get_current_user_id() ) $this->create_user( $params );306 311 do_action( 'sp_payment_post_process', $params, $this->engine ); 307 312 return( true ); … … 334 339 if (!isset($params[self::FULL_NAME]) && (isset($params[self::FIRST_NAME]) || isset($params[self::LAST_NAME]))) $params[self::FULL_NAME] = trim((isset($params[self::FIRST_NAME]) ? $params[self::FIRST_NAME] : '').' '.(isset($params[self::LAST_NAME]) ? $params[self::LAST_NAME] : '')); 335 340 if (!isset($params[self::CARD_OWNER]) && isset($params[self::FULL_NAME])) $params[self::CARD_OWNER] = $params[self::FULL_NAME]; 336 if (!isset($params['payment_id']) || !$params['payment_id']) $params['payment_id'] = $this->register($params); 337 $this->payment_id = $params['payment_id']; 341 //if ( !isset( $params[ 'payment_id' ] ) || !$params[ 'payment_id' ] ) $params[ 'payment_id' ] = 342 $params = apply_filters( 'sp_payment_pre_process_filter', $params, $this->engine ); 343 //if ( empty( $params[ 'payment_id' ] ) ) 344 $params[ 'payment_id' ] = $this->payment_id = $this->register( $params ); 338 345 try { 339 $params = apply_filters( 'sp_payment_pre_process_filter', $params, $this->engine );340 346 $process = parent::pre_process( $params ); 341 self::update( $params[ 'payment_id' ], [ 'status' => self::TRANSACTION_PENDING, 'transaction_id' => $this->engine->transaction ] ); 347 self::update( $params[ 'payment_id' ], [ 348 'status' => self::TRANSACTION_PENDING, 349 'transaction_id' => $this->engine->transaction 350 ] ); 342 351 } catch ( Exception $e ) { 343 self::update( $params[ 'payment_id' ], [344 'status' => self::TRANSACTION_FAILED, 352 self::update( $params[ 'payment_id' ], [ 353 'status' => self::TRANSACTION_FAILED, 345 354 'transaction_id' => $this->engine->transaction, 346 355 'error_code' => $e->getCode(), … … 349 358 throw $e; 350 359 } 351 if ( $this->param( 'user_create' ) != 'disabled' && $this->param( 'user_create_step' ) == 'pre' && !get_current_user_id()) $this->create_user( $params ); 360 if ( $this->param( 'user_create' ) != 'disabled' && $this->param( 'user_create_step' ) == 'pre' && !get_current_user_id() ) { 361 $user_id = $this->create_user( $params ); 362 $params[ 'user_id' ] = $user_id; 363 } 352 364 do_action( 'sp_payment_pre_process', $params, $this->engine ); 353 365 return( $process ); … … 366 378 $engine = $engine ? : $this->param( 'engine' ); 367 379 $this->setEngine( $engine ); 380 $params = apply_filters( 'sp_creditcard_token_params', $params, $this->engine ); 368 381 $params[ 'payment_id' ] = $this->register( $params ); 369 $params = apply_filters( 'sp_creditcard_token_params', $params, $this->engine );370 382 if ( $params = parent::store( $params ) ) { 371 383 if ( isset( $params[ 'token' ] ) ) { … … 662 674 $username = $this->generate_unique_username( strtolower( $username ) ); 663 675 if ( $this->param( 'user_create_step' ) == 'register' ) $user_id = register_new_user( $username, $email ); 664 else $user_id = wp_create_user( $username, wp_generate_password( 12, false ), $email );676 else $user_id = wp_create_user( $username, wp_generate_password( 12, false ), $email ); 665 677 do_action( 'sp_user_created', $user_id, $params, false ); 678 679 // TODO: allow ssetting for autologin, or not 666 680 wp_set_auth_cookie( $user_id ); 667 681 } 668 682 } 669 683 if ( $user_id ) { 670 // TODO: Login should be handled by developer, impl mention,684 // TODO: Login should be handled by developer, implementation, 671 685 // could be redirecting user to login screen, or validating 672 686 // other data field that comes in $params that indicates it the user. … … 676 690 return( $user_id ); 677 691 } 678 692 679 693 function generate_unique_username( $username ) { 680 694 $username = sanitize_user( $username ); 681 static $i; 682 if ( null === $i ) $i = 1; 683 else $i ++; 684 if (! username_exists( $username ) ) return( $username ); 685 $new_username = sprintf( '%s-%s', $username, $i ); 686 if ( !username_exists( $new_username ) ) return( $new_username ); 687 else return( $this->generate_unique_username( $username ) ); 695 $i = 1; 696 $new_username = $username; 697 while ( username_exists( $new_username ) ) { 698 $new_username = $username . '-' . $i++; 699 } 700 return( $new_username ); 688 701 } 689 702 … … 799 812 $values = [ 800 813 'engine' => $this->engine::$name, 801 'currency' => isset( $params[self::CURRENCY]) && $params[self::CURRENCY] ? $params[self::CURRENCY] : $this->param('currency'),802 'amount' => self::tofloat( $params[self::AMOUNT]),803 'concept' => $params[ 'product'],804 'payments' => isset( $params[self::PAYMENTS]) ? $params[self::PAYMENTS] : null,805 'parameters' => $this->sanitize_pci_dss( json_encode($params)),814 'currency' => isset( $params[ self::CURRENCY ] ) && $params[ self::CURRENCY ] ? $params[ self::CURRENCY ] : $this->param('currency' ), 815 'amount' => self::tofloat( $params[ self::AMOUNT ] ), 816 'concept' => $params[ 'product' ] ?? ( isset( $params[ self::PRODUCT ] ) ? $params[ self::PRODUCT ] : null ), 817 'payments' => isset( $params[ self::PAYMENTS ] ) ? $params[ self::PAYMENTS ] : null, 818 'parameters' => $this->sanitize_pci_dss( json_encode( $params ) ), 806 819 'url' => wp_get_referer() ? $this->sanitize_pci_dss(wp_get_referer()) : '', 807 820 'status' => self::TRANSACTION_NEW, 808 821 'sandbox' => $this->sandbox, 809 'user_id' => get_current_user_id() ? : null,810 'ip_address' => $_SERVER[ 'REMOTE_ADDR'],811 'user_agent' => $_SERVER[ 'HTTP_USER_AGENT'],812 'parent_id' => isset( $params['payment_id']) ? $params['payment_id'] : null,822 'user_id' => $params[ 'user_id' ] ?? get_current_user_id(), 823 'ip_address' => $_SERVER[ 'REMOTE_ADDR' ] ?? null, 824 'user_agent' => $_SERVER[ 'HTTP_USER_AGENT' ] ?? null, 825 'parent_id' => isset( $params[ 'payment_id' ] ) ? $params[ 'payment_id' ] : null, 813 826 'modified' => current_time( 'mysql' ), 814 827 'created' => current_time( 'mysql' ), 815 828 ]; 816 $result = $wpdb->insert( $wpdb->prefix.self::$table_name, $values ); 817 if ( $wpdb->insert_id ) { 818 $this->payment_id = $wpdb->insert_id; 819 return( $this->payment_id ); 820 } 821 return( false ); 829 $result = $wpdb->insert( $wpdb->prefix . self::$table_name, $values ); 830 if ( $result === false ) 831 throw new Exception( 832 sprintf( __( "Couldn't register transaction: %s", 'simple-payment' ), 833 $wpdb->last_error 834 ) ); 835 $this->payment_id = $wpdb->insert_id; 836 return( $this->payment_id ? : false ); 822 837 } 823 838 … … 833 848 //$user_id = get_current_user_id(); 834 849 //if ( $user_id ) $params[ 'user_id' ] = $user_id; 835 $result = $wpdb->update( $table_name, $params, [ ( $transaction_id ? 'transaction_id' : 'id' ) => $id ] ); 836 if ( $result === false ) throw new Exception( sprintf( __( "Couldn't update transaction: %s", 'simple-payment' ), $wpdb->last_error ) ); 850 $result = $wpdb->update( $table_name, $params, [ 851 ( $transaction_id ? 'transaction_id' : 'id' ) => $id 852 ] ); 853 if ( $result === false ) 854 throw new Exception( 855 sprintf( __( "Couldn't update transaction: %s", 'simple-payment' ), $wpdb->last_error ) 856 ); 837 857 if ( isset( $token ) && $token ) { 838 858 do_action( 'sp_creditcard_token', $token, ( $id ? $id : $transaction_id ), $params ); -
simple-payment/trunk/vendor/yalla-ya/simple-payment/Engines/Cardcom.php
r3319619 r3373384 548 548 549 549 if ($refund) $post[ 'TokenToCharge.RefundInsteadOfCharge' ] = $refund; 550 if ($params[ ' PAYMENTS' ] == 'monthly' ) $post[ 'TokenToCharge.IsAutoRecurringPayment' ] = 'true';551 552 if ( isset($params[ 'approval_number' ]) && $params[ 'approval_number' ]) $post[ 'TokenToCharge.ApprovalNumber' ] = $params[ 'approval_number' ];550 if ($params[ 'payments' ] == 'monthly' ) $post[ 'TokenToCharge.IsAutoRecurringPayment' ] = 'true'; 551 552 if ( !$refund &&isset($params[ 'approval_number' ]) && $params[ 'approval_number' ]) $post[ 'TokenToCharge.ApprovalNumber' ] = $params[ 'approval_number' ]; 553 553 554 554 -
simple-payment/trunk/vendor/yalla-ya/simple-payment/Engines/Engine.php
r3319619 r3373384 163 163 # some error , send email to developer // TODO: Handle Error 164 164 if ( !empty( $error ) ) { 165 throw new Exception( $error . ' ' . $response. ' - ' . $url . ' (' . print_r( $vars, true ) . ')', 500 );165 throw new Exception( $error . ' ' . $response. ' - ' . $url, 500 ); 166 166 } 167 167 curl_close( $curl );
Note: See TracChangeset
for help on using the changeset viewer.