Changeset 3095476
- Timestamp:
- 05/31/2024 05:54:33 AM (22 months ago)
- Location:
- wallets/trunk
- Files:
-
- 20 added
- 20 deleted
- 24 edited
-
adapters/class-bank-fiat-adapter.php (modified) (13 diffs)
-
adapters/class-bitcoin-core-like-wallet-adapter.php (modified) (1 diff)
-
admin/assets.php (modified) (7 diffs)
-
admin/dashboard.php (modified) (1 diff)
-
admin/migration.php (modified) (2 diffs)
-
assets/scripts/bs58check-6.2.7.min.js (deleted)
-
assets/scripts/bs58check-6.2.7.min.js.map (deleted)
-
assets/scripts/bs58check-6.3.0.min.js (added)
-
assets/scripts/bs58check-6.3.0.min.js.map (added)
-
assets/scripts/wallets-admin-capabilities-6.2.7.min.js (deleted)
-
assets/scripts/wallets-admin-capabilities-6.2.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-capabilities-6.3.0.min.js (added)
-
assets/scripts/wallets-admin-capabilities-6.3.0.min.js.map (added)
-
assets/scripts/wallets-admin-cs-tool-6.2.7.min.js (deleted)
-
assets/scripts/wallets-admin-cs-tool-6.2.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-cs-tool-6.3.0.min.js (added)
-
assets/scripts/wallets-admin-cs-tool-6.3.0.min.js.map (added)
-
assets/scripts/wallets-admin-dashboard-6.2.7.min.js (deleted)
-
assets/scripts/wallets-admin-dashboard-6.2.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-dashboard-6.3.0.min.js (added)
-
assets/scripts/wallets-admin-dashboard-6.3.0.min.js.map (added)
-
assets/scripts/wallets-admin-deposit-tool-6.2.7.min.js (deleted)
-
assets/scripts/wallets-admin-deposit-tool-6.2.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-deposit-tool-6.3.0.min.js (added)
-
assets/scripts/wallets-admin-deposit-tool-6.3.0.min.js.map (added)
-
assets/scripts/wallets-admin-docs-6.2.7.min.js (deleted)
-
assets/scripts/wallets-admin-docs-6.2.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-docs-6.3.0.min.js (added)
-
assets/scripts/wallets-admin-docs-6.3.0.min.js.map (added)
-
assets/scripts/wallets-admin-editor-6.2.7.min.js (deleted)
-
assets/scripts/wallets-admin-editor-6.2.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-editor-6.3.0.min.js (added)
-
assets/scripts/wallets-admin-editor-6.3.0.min.js.map (added)
-
assets/scripts/wallets-admin-menu-item-6.2.7.min.js (deleted)
-
assets/scripts/wallets-admin-menu-item-6.2.7.min.js.map (deleted)
-
assets/scripts/wallets-admin-menu-item-6.3.0.min.js (added)
-
assets/scripts/wallets-admin-menu-item-6.3.0.min.js.map (added)
-
assets/scripts/wallets-front-6.2.7.min.js (deleted)
-
assets/scripts/wallets-front-6.2.7.min.js.map (deleted)
-
assets/scripts/wallets-front-6.3.0.min.js (added)
-
assets/scripts/wallets-front-6.3.0.min.js.map (added)
-
assets/styles/wallets-6.2.7.min.css (deleted)
-
assets/styles/wallets-6.3.0.min.css (added)
-
assets/styles/wallets-admin-6.2.7.min.css (deleted)
-
assets/styles/wallets-admin-6.3.0.min.css (added)
-
docs/glossary.md (modified) (2 diffs)
-
docs/tools.md (modified) (2 diffs)
-
frontend/assets.php (modified) (3 diffs)
-
post-types/class-address.php (modified) (2 diffs)
-
post-types/class-transaction.php (modified) (7 diffs)
-
readme.txt (modified) (3 diffs)
-
templates/email-fiat_deposit_cancelled_admins.php (modified) (2 diffs)
-
templates/email-fiat_deposit_cancelled_sender.php (modified) (2 diffs)
-
templates/email-fiat_deposit_done_admins.php (modified) (2 diffs)
-
templates/email-fiat_deposit_done_sender.php (modified) (2 diffs)
-
templates/email-fiat_deposit_failed_admins.php (modified) (1 diff)
-
templates/email-fiat_deposit_failed_sender.php (modified) (2 diffs)
-
templates/email-fiat_deposit_pending_admins.php (modified) (2 diffs)
-
templates/email-fiat_deposit_pending_sender.php (modified) (2 diffs)
-
templates/email-fiat_withdrawal_pending_admins.php (modified) (2 diffs)
-
templates/email-fiat_withdrawal_pending_sender.php (modified) (2 diffs)
-
templates/fiat_deposit.php (modified) (2 diffs)
-
templates/fiat_withdraw.php (modified) (24 diffs)
-
wallets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wallets/trunk/adapters/class-bank-fiat-adapter.php
r3093019 r3095476 71 71 'options' => [ 72 72 'iban' => __( 'SWIFT/BIC and IBAN (World)', 'wallets' ), 73 'swacc' => __( 'SWIFT/BIC and Account Number', 'wallets' ), 73 74 'routing' => __( 'Routing Number and Account Number (USA/Americas)', 'wallets' ), 74 75 'ifsc' => __( 'IFSC and Account Number (India)', 'wallets' ), … … 158 159 159 160 public function get_wallet_version(): string { 160 return '6. 2.7';161 return '6.3.0'; 161 162 } 162 163 … … 481 482 $label = "{ \"iban\": \"$iban\", \"swiftBic\": \"$swift_bic\" }"; 482 483 484 } elseif ( 'swacc' == $addressing_method ) { 485 486 $swift_bic = $body_params['swiftBic']; 487 $account_number = $body_params['accountNumber']; 488 $label = "{ \"swiftBic\": \"$swift_bic\", \"accountNumber\": \"$account_number\"}"; 489 483 490 } elseif ( 'routing' == $addressing_method ) { 484 491 … … 683 690 get_asset_path( 'wallets-admin-deposit-tool' ), 684 691 [ 'jquery' ], 685 '6. 2.7',692 '6.3.0', 686 693 true 687 694 ); … … 882 889 name="wallets_bankaddressingmethod" 883 890 required="required" 891 value="swacc"> 892 893 <?php 894 _e( 895 'SWIFT-<abbr title="Business Identifier Code">BIC</abbr> and Account Number', 896 'wallets' 897 ); 898 ?> 899 </p> 900 901 <p> 902 <input 903 type="radio" 904 name="wallets_bankaddressingmethod" 905 required="required" 884 906 value="routing"> 885 907 … … 916 938 <span 917 939 class="iban"> 940 <?php _e( 'SWIFT-<abbr title="Business Identifier Code">BIC</abbr>', 'wallets' ); ?> 941 </span> 942 <span 943 class="swacc"> 918 944 <?php _e( 'SWIFT-<abbr title="Business Identifier Code">BIC</abbr>', 'wallets' ); ?> 919 945 </span> … … 944 970 class="iban"> 945 971 <?php _e( 'Account <abbr title="International Bank Account Number">IBAN</abbr>', 'wallets' ); ?> 972 </span> 973 <span 974 class="swacc"> 975 <?php _e( 'Account Number', 'wallets' ); ?> 946 976 </span> 947 977 <span … … 1131 1161 if ( 'iban' == $addressing_method ) { 1132 1162 $label = "{ \"iban\": \"$bank_account\", \"swiftBic\": \"$bank_branch\" }"; 1163 1164 } elseif ( 'swacc' == $addressing_method ) { 1165 $label = "{ \"swiftBic\": \"$bank_branch\", \"accountNumber\": \"$bank_account\"}"; 1133 1166 1134 1167 } elseif ( 'routing' == $addressing_method ) { … … 1453 1486 $addressing_method = ''; 1454 1487 $payment_details = json_decode( $wd->address->label ); 1455 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 1456 $addressing_method = 'iban'; 1457 } elseif ( $payment_details && isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 1458 $addressing_method = 'routing'; 1459 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 1460 $addressing_method = 'ifsc'; 1488 if ( $payment_details ) { 1489 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 1490 $addressing_method = 'iban'; 1491 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 1492 $addressing_method = 'swacc'; 1493 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 1494 $addressing_method = 'routing'; 1495 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 1496 $addressing_method = 'ifsc'; 1497 } 1461 1498 } 1462 1499 … … 1542 1579 <?php 1543 1580 switch( $addressing_method ) { 1544 case 'iban': esc_html_e( 'SWIIFT/BIC', 'wallets' ); break; 1581 case 'iban': esc_html_e( 'SWIIFT/BIC', 'wallets' ); break; 1582 case 'swacc': esc_html_e( 'SWIIFT/BIC', 'wallets' ); break; 1545 1583 case 'routing': esc_html_e( 'Routing number', 'wallets' ); break; 1546 case 'ifsc': esc_html_e( 'IFSC','wallets' ); break;1584 case 'ifsc': esc_html_e( 'IFSC', 'wallets' ); break; 1547 1585 default: 1548 1586 printf( … … 1556 1594 <pre><?php 1557 1595 switch( $addressing_method ) { 1558 case 'iban': esc_html_e( $payment_details->swiftBic ); break; 1596 case 'iban': esc_html_e( $payment_details->swiftBic ); break; 1597 case 'swacc': esc_html_e( $payment_details->swiftBic ); break; 1559 1598 case 'routing': esc_html_e( $payment_details->routingNumber ); break; 1560 case 'ifsc': esc_html_e( $payment_details->ifsc );break;1599 case 'ifsc': esc_html_e( $payment_details->ifsc ); break; 1561 1600 default: 1562 1601 printf( … … 1573 1612 <?php 1574 1613 switch( $addressing_method ) { 1575 case 'iban': esc_html_e( 'IBAN', 'wallets' ); break; 1614 case 'iban': esc_html_e( 'IBAN', 'wallets' ); break; 1615 case 'swacc': esc_html_e( 'Account number', 'wallets' ); break; 1576 1616 case 'routing': esc_html_e( 'Account number', 'wallets' ); break; 1577 case 'ifsc': esc_html_e( 'Account number', 'wallets' ); break;1617 case 'ifsc': esc_html_e( 'Account number', 'wallets' ); break; 1578 1618 default: 1579 1619 printf( … … 1587 1627 <pre><?php 1588 1628 switch( $addressing_method ) { 1589 case 'iban': esc_html_e( $payment_details->iban ); break; 1629 case 'iban': esc_html_e( $payment_details->iban ); break; 1630 case 'swacc': esc_html_e( $payment_details->accountNumber ); break; 1590 1631 case 'routing': esc_html_e( $payment_details->accountNumber ); break; 1591 case 'ifsc': esc_html_e( $payment_details->indianAccNum ); break;1632 case 'ifsc': esc_html_e( $payment_details->indianAccNum ); break; 1592 1633 default: 1593 1634 printf( -
wallets/trunk/adapters/class-bitcoin-core-like-wallet-adapter.php
r3093019 r3095476 738 738 [ 739 739 'timeout' => absint( get_ds_option( 'wallets_http_timeout', 5 ) ), 740 'user-agent' => 'Bitcoin and Altcoin Wallets version 6. 2.7',740 'user-agent' => 'Bitcoin and Altcoin Wallets version 6.3.0', 741 741 'headers' => [ 742 742 'Accept-Encoding: gzip', -
wallets/trunk/admin/assets.php
r3093019 r3095476 22 22 get_asset_path( 'wallets-admin', 'style' ), 23 23 [], 24 '6. 2.7'24 '6.3.0' 25 25 ); 26 26 … … 52 52 get_asset_path( 'wallets-admin-menu-item' ), 53 53 [ 'jquery' ], 54 '6. 2.7',54 '6.3.0', 55 55 true 56 56 ); … … 60 60 get_asset_path( 'wallets-admin-cs-tool' ), 61 61 [ 'jquery-qrcode' ], 62 '6. 2.7',62 '6.3.0', 63 63 true 64 64 ); … … 75 75 get_asset_path( 'wallets-admin-capabilities' ), 76 76 [ 'jquery-ui-tabs' ], 77 '6. 2.7',77 '6.3.0', 78 78 true 79 79 ); … … 83 83 get_asset_path( 'wallets-admin-dashboard' ), 84 84 [ 'jquery-ui-tabs', 'jqcloud' ], 85 '6. 2.7',85 '6.3.0', 86 86 true 87 87 ); … … 91 91 get_asset_path( 'wallets-admin-docs' ), 92 92 [ 'jquery' ], 93 '6. 2.7',93 '6.3.0', 94 94 true 95 95 ); … … 99 99 get_asset_path( 'wallets-admin-editor' ), 100 100 [ 'suggest' ], 101 '6. 2.7',101 '6.3.0', 102 102 true 103 103 ); -
wallets/trunk/admin/dashboard.php
r3093019 r3095476 349 349 global $wpdb; 350 350 351 $debug_data[ (string) __( 'Plugin version', 'wallets' ) ] = '6. 2.7';352 $debug_data[ (string) __( 'Git SHA', 'wallets' ) ] = ' 52a5a16e';351 $debug_data[ (string) __( 'Plugin version', 'wallets' ) ] = '6.3.0'; 352 $debug_data[ (string) __( 'Git SHA', 'wallets' ) ] = '36654111'; 353 353 $debug_data[ (string) __( 'Web Server', 'wallets' ) ] = $_SERVER['SERVER_SOFTWARE']; 354 354 $debug_data[ (string) __( 'PHP version', 'wallets' ) ] = PHP_VERSION; -
wallets/trunk/admin/migration.php
r2941101 r3095476 543 543 // check if already in the tool page 544 544 global $pagenow; 545 if ( 'tools.php' == $pagenow && 'wallets_migration'== $_GET['page'] ) {545 if ( 'tools.php' == $pagenow && array_key_exists( 'page', $_GET ) && 'wallets_migration' === $_GET['page'] ) { 546 546 return; 547 547 } … … 634 634 } 635 635 ); 636 -
wallets/trunk/docs/glossary.md
r2996338 r3095476 145 145 ## CoinGecko ID {#coingecko-id} 146 146 147 Each cryptocurrency can receive exchange rates data from CoinGecko. To do this, you can specify the cryptocurrency's unique ID on CoinGecko. This allows the plugin to query the CoinGecko API for [exchange rates](#exchange-rates) for this currency. 147 Each cryptocurrency can receive exchange rates data from CoinGecko. To do this, you can specify the cryptocurrency's unique ID on CoinGecko. This allows the plugin to query the CoinGecko API for [exchange rates](#exchange-rates) for this currency. 148 148 149 149 To learn how you can set the CoinGecko ID on a currency easily, go to: _The Post Types_ → _Currencies_ → _Fields_ → _[Currency exchange rates][currency-exchange-rates]_. … … 683 683 Replace the numbers in the JSON with the actual *SWIFT/BIC* and *Account number* of the wire transfer's destination. 684 684 685 ## SWIFT-BIC and Account Number {#swift-bic-and-accnum} 686 687 An SWIFT-BIC number and an account number are the details needed to perform a bank transaction in Africa. When performing fiat deposits/withdrawals, this is one of the options for bank addressing method. 688 689 To create an *[Address post type][post-type-address]* with such details, enter the following JSON data in the address's Title: 690 691 { "swiftBic": "123456789", "accountNumber": "1234567"} 692 693 Replace the numbers in the JSON with the actual *SWIFT/BIC* and *Account number* of the wire transfer's destination. 685 694 686 695 ## Symbol {#symbol} -
wallets/trunk/docs/tools.md
r2857585 r3095476 37 37 - *[Adapter type][glossary-adapter-type]* - The type of wallet adapter used for this currency, such as Bitcoin-like, Monero-like, etc. 38 38 - *[Currency][glossary-currency]* - The currency, duh! 39 - *[Hot Wallet balance][glossary-hot-wallet-balance]* - How many coins you have in your hot wallet. 39 - *[Hot Wallet balance][glossary-hot-wallet-balance]* - How many coins you have in your hot wallet. 40 40 - *[User balances][glossary-user-balance]* - The total of all your users' balances. 41 41 - *% of user balances backed by hot wallet* - Horizontal bar showing the percentage of the *[Sum of User Balances][glossary-sum-of-user-balances]* that is currently backed by the hot wallet balance. 100% means that all the user funds are in the hot wallet. … … 68 68 - IFSC 69 69 - Account number 70 - Bank deposit details (for banks in Africa): 71 - Bank name and address 72 - SWIFT-BIC 73 - Account Number 70 74 - Bank deposit details (for banks in Europe): 71 75 - Bank name and address -
wallets/trunk/frontend/assets.php
r3093019 r3095476 23 23 get_asset_path( 'wallets', 'style' ), 24 24 [], 25 '6. 2.7'25 '6.3.0' 26 26 ); 27 27 … … 86 86 get_asset_path( 'jsqrcode' ), 87 87 [ 'jquery' ], 88 '6. 2.7',88 '6.3.0', 89 89 true 90 90 ); … … 128 128 get_asset_path( 'wallets-front' ), 129 129 [ 'knockout', 'jquery', 'style-scoped', 'sprintf.js' ], 130 '6. 2.7',130 '6.3.0', 131 131 true 132 132 ); -
wallets/trunk/post-types/class-address.php
r3089855 r3095476 227 227 'post_type' => 'wallets_address', 228 228 'post_status' => 'publish', 229 'meta_input' => [230 'wallets_user' => $user_id,231 'wallets_address' => $this->address,232 'wallets_extra' => $this->extra,233 'wallets_type' => $this->type,234 'wallets_currency_id' => $this->currency->post_id ?? null,235 ],236 229 ]; 237 230 … … 241 234 $result = wp_insert_post( $postarr ); 242 235 maybe_restore_blog(); 236 237 global $wpdb; 238 239 if ( $this->post_id ) { 240 // If the post already exists in the DB, 241 // then we update all the post meta in one go, 242 // which is much faster than wp_insert_post which 243 // loops over each meta and does a separate update. 244 245 $meta_query = $wpdb->prepare( 246 "UPDATE 247 {$wpdb->postmeta} 248 SET 249 meta_value = 250 CASE 251 WHEN meta_key = 'wallets_user' THEN %d 252 WHEN meta_key = 'wallets_address' THEN %s 253 WHEN meta_key = 'wallets_extra' THEN %s 254 WHEN meta_key = 'wallets_type' THEN %s 255 WHEN meta_key = 'wallets_currency_id' THEN %d 256 END 257 WHERE post_id = %d; 258 ", 259 $user_id, 260 $this->address, 261 $this->extra, 262 $this->type, 263 $this->currency->post_id ?? null, 264 $this->post_id 265 ); 266 } else { 267 $meta_query = $wpdb->prepare( 268 "INSERT INTO 269 {$wpdb->postmeta}(post_id,meta_key,meta_value) 270 VALUES 271 (%d,'wallets_user',%d), 272 (%d,'wallets_address',%s), 273 (%d,'wallets_extra',%s), 274 (%d,'wallets_type',%s), 275 (%d,'wallets_currency_id',%d) 276 ;", 277 $result, $user_id, 278 $result, $this->address, 279 $result, $this->extra, 280 $result, $this->type, 281 $result, $this->currency->post_id ?? 0, 282 $result, $this->post_id 283 ); 284 } 285 286 $wpdb->flush(); 287 288 $meta_result = $wpdb->query( $meta_query ); 289 290 if ( false === $meta_result ) { 291 throw new \Exception( 292 sprintf( 293 '%s: Failed saving address with: %s', 294 __FUNCTION__, 295 $wpdb->last_error 296 ) 297 ); 298 } 299 243 300 add_action( 'save_post', [ __CLASS__, 'save_post' ], 10, 3 ); 244 301 -
wallets/trunk/post-types/class-transaction.php
r3093019 r3095476 464 464 } 465 465 466 $user_id = $this->user ? $this->user->ID : 0; 467 466 468 $postarr = [ 467 469 'ID' => $this->post_id ?? null, … … 470 472 'post_type' => 'wallets_tx', 471 473 'post_parent' => $this->parent_id, 472 'meta_input' => [473 'wallets_user' => $this->user ? $this->user->ID : 0,474 'wallets_category' => $this->category,475 'wallets_txid' => $this->txid,476 'wallets_address_id' => $this->address->post_id ?? null,477 'wallets_currency_id' => $this->currency->post_id ?? null,478 'wallets_amount' => $this->amount,479 'wallets_fee' => $this->fee,480 'wallets_chain_fee' => $this->chain_fee,481 'wallets_block' => $this->block,482 'wallets_timestamp' => $this->timestamp,483 'wallets_nonce' => $this->nonce ?? null,484 'wallets_error' => $this->error ?? null,485 ],486 474 ]; 487 475 … … 490 478 $result = wp_insert_post( $postarr ); 491 479 add_action( 'save_post', [ __CLASS__, 'save_post' ], 10, 3 ); 480 maybe_restore_blog(); 481 482 global $wpdb; 483 484 if ( $this->post_id ) { 485 // If the post already exists in the DB, 486 // then we update all the post meta in one go, 487 // which is much faster than wp_insert_post which 488 // loops over each meta and does a separate update. 489 490 $meta_query = $wpdb->prepare( 491 "UPDATE 492 {$wpdb->postmeta} 493 SET 494 meta_value = 495 CASE 496 WHEN meta_key = 'wallets_user' THEN %d 497 WHEN meta_key = 'wallets_category' THEN %s 498 WHEN meta_key = 'wallets_txid' THEN %s 499 WHEN meta_key = 'wallets_address_id' THEN %d 500 WHEN meta_key = 'wallets_currency_id' THEN %d 501 WHEN meta_key = 'wallets_amount' THEN %d 502 WHEN meta_key = 'wallets_fee' THEN %d 503 WHEN meta_key = 'wallets_chain_fee' THEN %d 504 WHEN meta_key = 'wallets_block' THEN %d 505 WHEN meta_key = 'wallets_timestamp' THEN %d 506 WHEN meta_key = 'wallets_nonce' THEN %s 507 WHEN meta_key = 'wallets_error' THEN %s 508 END 509 WHERE post_id = %d; 510 ", 511 $user_id, 512 $this->category, 513 $this->txid, 514 $this->address->post_id ?? 0, 515 $this->currency->post_id ?? 0, 516 $this->amount, 517 $this->fee, 518 $this->chain_fee, 519 $this->block, 520 $this->timestamp, 521 $this->nonce, 522 $this->error, 523 $this->post_id 524 ); 525 } else { 526 $meta_query = $wpdb->prepare( 527 "INSERT INTO 528 {$wpdb->postmeta}(post_id,meta_key,meta_value) 529 VALUES 530 (%d,'wallets_user',%d), 531 (%d,'wallets_category',%s), 532 (%d,'wallets_txid',%s), 533 (%d,'wallets_address_id',%d), 534 (%d,'wallets_currency_id',%d), 535 (%d,'wallets_amount',%d), 536 (%d,'wallets_fee',%d), 537 (%d,'wallets_chain_fee',%d), 538 (%d,'wallets_block',%d), 539 (%d,'wallets_timestamp',%d), 540 (%d,'wallets_nonce',%s), 541 (%d,'wallets_error',%s) 542 ;", 543 $result, $user_id, 544 $result, $this->category, 545 $result, $this->txid, 546 $result, $this->address->post_id ?? 0, 547 $result, $this->currency->post_id ?? 0, 548 $result, $this->amount, 549 $result, $this->fee, 550 $result, $this->chain_fee, 551 $result, $this->block, 552 $result, $this->timestamp, 553 $result, $this->nonce, 554 $result, $this->error 555 ); 556 } 557 558 $wpdb->flush(); 559 560 $meta_result = $wpdb->query( $meta_query ); 561 562 if ( false === $meta_result ) { 563 564 throw new \Exception( 565 sprintf( 566 '%s: Failed saving transaction with: %s', 567 __FUNCTION__, 568 $wpdb->last_error 569 ) 570 ); 571 } 492 572 493 573 if ( ! $this->post_id && $result && is_integer( $result ) ) { … … 495 575 496 576 } elseif ( $result instanceof \WP_Error ) { 497 maybe_restore_blog();498 577 499 578 throw new \Exception( … … 508 587 $this->dirty = false; 509 588 510 maybe_restore_blog();511 589 } 512 590 … … 562 640 } elseif ( 'address' == $name ) { 563 641 if ( ( $value && $value instanceof Address ) || is_null( $value ) ) { 564 $this->dirty = $this->dirty || ( $this->address->post_id!= $value->post_id );642 $this->dirty = $this->dirty || ( ( $this->address->post_id ?? null ) != $value->post_id ); 565 643 $this->address = $value; 566 644 } else { … … 570 648 } elseif ( 'currency' == $name ) { 571 649 if ( ( $value && $value instanceof Currency ) || is_null( $value ) ) { 572 $this->dirty = $this->dirty || ( $this->currency->post_id!= $value->post_id );650 $this->dirty = $this->dirty || ( ( $this->currency->post_id ?? null ) != $value->post_id ); 573 651 $this->currency = $value; 574 652 } else { -
wallets/trunk/readme.txt
r3093019 r3095476 6 6 Tested up to: 6.5.3 7 7 Requires PHP: 7.0 8 Stable tag: 6. 2.78 Stable tag: 6.3.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 337 337 338 338 == Changelog == 339 340 = 6.3.0 = 341 - Add: It is now possible to submit bank transfer requests with a combination of SWIFT/BIC and Account Number. This will be useful for African countries. 342 - Improve: Saving transactions and addresses to the DB is now much faster. This should improve the UI experience when submitting transactions. 343 - Fix: When submitting a bank transfer request, it is no longer possible to click the submit button again while another request is underway. 339 344 340 345 = 6.2.7 = … … 496 501 == Upgrade Notice == 497 502 498 Version `6. 2.7` fixes a few issues introduced in `6.2.6`.503 Version `6.3.0` adds a requested feature, fixes a UI defect and improves performance. 499 504 500 505 == Donating == -
wallets/trunk/templates/email-fiat_deposit_cancelled_admins.php
r2973854 r3095476 32 32 33 33 $payment_details = json_decode( $tx->address->label ); 34 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 35 $addressing_method = 'iban'; 36 } elseif ( $payment_details && isset( $payment_details->routingNumber )&& isset( $payment_details->accountNumber ) ) { 37 $addressing_method = 'routing'; 38 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 39 $addressing_method = 'ifsc'; 34 if ( $payment_details ) { 35 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 36 $addressing_method = 'iban'; 37 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 38 $addressing_method = 'swacc'; 39 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 40 $addressing_method = 'routing'; 41 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 42 $addressing_method = 'ifsc'; 43 } 40 44 } 41 45 … … 124 128 </tr> 125 129 130 <?php elseif ( 'swacc' == $addressing_method ): ?> 131 132 <tr> 133 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 134 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 135 </tr> 136 137 <tr> 138 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 139 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 140 </tr> 141 126 142 <?php elseif ( 'routing' == $addressing_method ): ?> 127 143 -
wallets/trunk/templates/email-fiat_deposit_cancelled_sender.php
r2973854 r3095476 32 32 33 33 $payment_details = json_decode( $tx->address->label ); 34 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 35 $addressing_method = 'iban'; 36 } elseif ( $payment_details && isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 37 $addressing_method = 'routing'; 38 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 39 $addressing_method = 'ifsc'; 34 if ( $payment_details ) { 35 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 36 $addressing_method = 'iban'; 37 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 38 $addressing_method = 'swacc'; 39 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 40 $addressing_method = 'routing'; 41 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 42 $addressing_method = 'ifsc'; 43 } 40 44 } 41 45 … … 102 106 </tr> 103 107 108 <?php elseif ( 'swacc' == $addressing_method ): ?> 109 110 <tr> 111 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 112 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 113 </tr> 114 115 <tr> 116 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 117 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 118 </tr> 119 104 120 <?php elseif ( 'routing' == $addressing_method ): ?> 105 121 -
wallets/trunk/templates/email-fiat_deposit_done_admins.php
r2973854 r3095476 30 30 31 31 $payment_details = json_decode( $tx->address->label ); 32 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 33 $addressing_method = 'iban'; 34 } elseif ( $payment_details && isset( $payment_details->routingNumber )&& isset( $payment_details->accountNumber ) ) { 35 $addressing_method = 'routing'; 36 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 37 $addressing_method = 'ifsc'; 32 if ( $payment_details ) { 33 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 34 $addressing_method = 'iban'; 35 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 36 $addressing_method = 'swacc'; 37 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 38 $addressing_method = 'routing'; 39 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 40 $addressing_method = 'ifsc'; 41 } 38 42 } 39 43 … … 122 126 </tr> 123 127 128 <?php elseif ( 'swacc' == $addressing_method ): ?> 129 130 <tr> 131 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 132 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 133 </tr> 134 135 <tr> 136 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 137 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 138 </tr> 139 124 140 <?php elseif ( 'routing' == $addressing_method ): ?> 125 141 -
wallets/trunk/templates/email-fiat_deposit_done_sender.php
r2973854 r3095476 32 32 33 33 $payment_details = json_decode( $tx->address->label ); 34 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 35 $addressing_method = 'iban'; 36 } elseif ( $payment_details && isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 37 $addressing_method = 'routing'; 38 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 39 $addressing_method = 'ifsc'; 34 if ( $payment_details ) { 35 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 36 $addressing_method = 'iban'; 37 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 38 $addressing_method = 'swacc'; 39 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 40 $addressing_method = 'routing'; 41 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 42 $addressing_method = 'ifsc'; 43 } 40 44 } 41 45 … … 100 104 </tr> 101 105 106 <?php elseif ( 'swacc' == $addressing_method ): ?> 107 108 <tr> 109 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 110 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 111 </tr> 112 113 <tr> 114 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 115 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 116 </tr> 117 102 118 <?php elseif ( 'routing' == $addressing_method ): ?> 103 119 -
wallets/trunk/templates/email-fiat_deposit_failed_admins.php
r2973854 r3095476 122 122 </tr> 123 123 124 <?php elseif ( 'swacc' == $addressing_method ): ?> 125 126 <tr> 127 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 128 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 129 </tr> 130 131 <tr> 132 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 133 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 134 </tr> 135 124 136 <?php elseif ( 'routing' == $addressing_method ): ?> 125 137 -
wallets/trunk/templates/email-fiat_deposit_failed_sender.php
r2973854 r3095476 32 32 33 33 $payment_details = json_decode( $tx->address->label ); 34 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 35 $addressing_method = 'iban'; 36 } elseif ( $payment_details && isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 37 $addressing_method = 'routing'; 38 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 39 $addressing_method = 'ifsc'; 34 if ( $payment_details ) { 35 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 36 $addressing_method = 'iban'; 37 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 38 $addressing_method = 'swacc'; 39 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 40 $addressing_method = 'routing'; 41 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 42 $addressing_method = 'ifsc'; 43 } 40 44 } 41 45 … … 103 107 </tr> 104 108 109 <?php elseif ( 'swacc' == $addressing_method ): ?> 110 111 <tr> 112 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 113 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 114 </tr> 115 116 <tr> 117 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 118 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 119 </tr> 120 105 121 <?php elseif ( 'routing' == $addressing_method ): ?> 106 122 -
wallets/trunk/templates/email-fiat_deposit_pending_admins.php
r2973854 r3095476 32 32 33 33 $payment_details = json_decode( $tx->address->label ); 34 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 35 $addressing_method = 'iban'; 36 } elseif ( $payment_details && isset( $payment_details->routingNumber )&& isset( $payment_details->accountNumber ) ) { 37 $addressing_method = 'routing'; 38 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 39 $addressing_method = 'ifsc'; 34 if ( $payment_details ) { 35 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 36 $addressing_method = 'iban'; 37 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 38 $addressing_method = 'swacc'; 39 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 40 $addressing_method = 'routing'; 41 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 42 $addressing_method = 'ifsc'; 43 } 40 44 } 45 41 46 42 47 $url = sprintf( … … 124 129 </tr> 125 130 131 <?php elseif ( 'swacc' == $addressing_method ): ?> 132 133 <tr> 134 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 135 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 136 </tr> 137 138 <tr> 139 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 140 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 141 </tr> 142 126 143 <?php elseif ( 'routing' == $addressing_method ): ?> 127 144 -
wallets/trunk/templates/email-fiat_deposit_pending_sender.php
r2973854 r3095476 33 33 34 34 $payment_details = json_decode( $tx->address->label ); 35 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 36 $addressing_method = 'iban'; 37 } elseif ( $payment_details && isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 38 $addressing_method = 'routing'; 39 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 40 $addressing_method = 'ifsc'; 35 if ( $payment_details ) { 36 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 37 $addressing_method = 'iban'; 38 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 39 $addressing_method = 'swacc'; 40 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 41 $addressing_method = 'routing'; 42 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 43 $addressing_method = 'ifsc'; 44 } 41 45 } 42 46 … … 103 107 </tr> 104 108 109 <?php elseif ( 'swacc' == $addressing_method ): ?> 110 111 <tr> 112 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 113 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 114 </tr> 115 116 <tr> 117 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 118 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 119 </tr> 120 105 121 <?php elseif ( 'routing' == $addressing_method ): ?> 106 122 -
wallets/trunk/templates/email-fiat_withdrawal_pending_admins.php
r2973854 r3095476 33 33 34 34 $payment_details = json_decode( $tx->address->label ); 35 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 36 $addressing_method = 'iban'; 37 } elseif ( $payment_details && isset( $payment_details->routingNumber )&& isset( $payment_details->accountNumber ) ) { 38 $addressing_method = 'routing'; 39 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 40 $addressing_method = 'ifsc'; 35 if ( $payment_details ) { 36 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 37 $addressing_method = 'iban'; 38 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 39 $addressing_method = 'swacc'; 40 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 41 $addressing_method = 'routing'; 42 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 43 $addressing_method = 'ifsc'; 44 } 41 45 } 42 46 … … 118 122 </tr> 119 123 124 <?php elseif ( 'swacc' == $addressing_method ): ?> 125 126 <tr> 127 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 128 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 129 </tr> 130 131 <tr> 132 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 133 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 134 </tr> 135 120 136 <?php elseif ( 'routing' == $addressing_method ): ?> 121 137 -
wallets/trunk/templates/email-fiat_withdrawal_pending_sender.php
r2973854 r3095476 33 33 34 34 $payment_details = json_decode( $tx->address->label ); 35 if ( $payment_details && isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 36 $addressing_method = 'iban'; 37 } elseif ( $payment_details && isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 38 $addressing_method = 'routing'; 39 } elseif ( $payment_details && isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 40 $addressing_method = 'ifsc'; 35 if ( $payment_details ) { 36 if ( isset( $payment_details->iban ) && isset( $payment_details->swiftBic ) ) { 37 $addressing_method = 'iban'; 38 } elseif ( isset( $payment_details->swiftBic) && isset( $payment_details->accountNumber ) ) { 39 $addressing_method = 'swacc'; 40 } elseif ( isset( $payment_details->routingNumber ) && isset( $payment_details->accountNumber ) ) { 41 $addressing_method = 'routing'; 42 } elseif ( isset( $payment_details->ifsc ) && isset( $payment_details->indianAccNum ) ) { 43 $addressing_method = 'ifsc'; 44 } 41 45 } 42 46 … … 123 127 </tr> 124 128 129 <?php elseif ( 'swacc' == $addressing_method ): ?> 130 131 <tr> 132 <th style="align: right;"><?php esc_html_e( 'SWIFT/BIC:', 'wallets' ); ?></th> 133 <td><code><?php esc_html_e( $payment_details->swiftBic ); ?></code></td> 134 </tr> 135 136 <tr> 137 <th style="align: right;"><?php esc_html_e( 'Account number:', 'wallets' ); ?></th> 138 <td><code><?php esc_html_e( $payment_details->accountNumber ); ?></code></td> 139 </tr> 140 125 141 <?php elseif ( 'routing' == $addressing_method ): ?> 126 142 -
wallets/trunk/templates/fiat_deposit.php
r2973854 r3095476 149 149 <td> 150 150 <label 151 data-bind="visible: 'iban' == selectedCurrency().bankaddressingmethod "151 data-bind="visible: 'iban' == selectedCurrency().bankaddressingmethod || 'swacc' == selectedCurrency().bankaddressingmethod" 152 152 class="bank-bic"> 153 153 <?php … … 215 215 216 216 <label 217 data-bind="visible: 'routing' == selectedCurrency().bankaddressingmethod "217 data-bind="visible: 'routing' == selectedCurrency().bankaddressingmethod || 'swacc' == selectedCurrency().bankaddressingmethod" 218 218 class="bank-acc-accnum"> 219 219 <?php -
wallets/trunk/templates/fiat_withdraw.php
r2973854 r3095476 72 72 <tr> 73 73 <td 74 colspan=" 6">74 colspan="8"> 75 75 <label 76 76 class="coin currency"> … … 201 201 <tr> 202 202 <td 203 colspan=" 6">203 colspan="8"> 204 204 <label 205 205 class="recipientNameAddress recipient-name-address"> … … 224 224 <tr> 225 225 <td 226 colspan=" 6">226 colspan="8"> 227 227 <label 228 228 class="bankNameAddress bank-name-address"> … … 245 245 </tr> 246 246 247 <tr >247 <tr style="vertical-align: top"> 248 248 <td 249 249 colspan="2"> … … 274 274 275 275 <label 276 class="bankWithdrawMethod addressing-method swacc"> 277 278 <input 279 type="radio" 280 name="bankWithdrawMethod" 281 value="swacc" 282 data-bind="checked: addressingMethod"> 283 284 <?php 285 echo apply_filters( 286 'wallets_fiat_ui_text_routingaccnum', 287 esc_html__( 288 'SWIFT/BIC & Account number', 289 'wallets' 290 ) 291 ); 292 ?> 293 </label> 294 </td> 295 296 <td 297 colspan="2"> 298 299 <label 276 300 class="bankWithdrawMethod addressing-method routing"> 277 301 … … 286 310 'wallets_fiat_ui_text_routingaccnum', 287 311 esc_html__( 288 'Routing & Account number s',312 'Routing & Account number', 289 313 'wallets' 290 314 ) … … 323 347 324 348 <td 325 colspan=" 2">349 colspan="3"> 326 350 <label 327 351 class="swiftbic swift-bic"> … … 345 369 346 370 <td 347 colspan=" 4">371 colspan="5"> 348 372 349 373 <label … … 363 387 data-bind="value: iban, valueUpdate: ['afterkeydown', 'input']" /></label> 364 388 </td> 389 </tr> 390 391 <tr 392 data-bind="if: 'swacc' == addressingMethod()"> 393 394 <td 395 colspan="3"> 396 <label 397 class="swacc swift-bic"> 398 <?php 399 echo apply_filters( 400 'wallets_fiat_ui_text_swiftbic', 401 esc_html__( 402 'SWIFT/BIC', 403 'wallets' 404 ) 405 ); 406 ?>: 407 408 <input 409 type="text" 410 <?php if ( 'off' != $atts['validation'] ): ?>pattern="[a-zA-Z0-9]{8,11}"<?php endif; ?> 411 data-bind="value: swiftBic, valueUpdate: ['afterkeydown', 'input']" /> 412 413 </label> 414 </td> 415 416 <td 417 colspan="5"> 418 419 <label 420 class="accountnum account-number"> 421 <?php 422 echo apply_filters( 423 'wallets_fiat_ui_text_accountnum', 424 esc_html__( 425 'Account number', 426 'wallets' 427 ) 428 ); 429 ?>: 430 431 <input 432 type="number" 433 min="100000" 434 max="99999999999999" 435 data-bind="value: accountNumber, valueUpdate: ['afterkeydown', 'input']" /> 436 </label> 437 </td> 438 365 439 </tr> 366 440 … … 370 444 371 445 <td 372 colspan=" 6">446 colspan="8"> 373 447 374 448 <p 375 449 class="validationMessage" 376 450 data-bind="text: swiftBic.validationMessage, visible: swiftBic.hasError"></p> 451 377 452 <p 378 453 class="validationMessage" … … 380 455 </td> 381 456 </tr> 457 <tr 458 data-bind="if: 'swacc' == addressingMethod()"> 459 460 <td 461 colspan="8"> 462 463 <p 464 class="validationMessage" 465 data-bind="text: swiftBic.validationMessage, visible: swiftBic.hasError"></p> 466 467 <p 468 class="validationMessage" 469 data-bind="text: accountNumber.validationMessage, visible: accountNumber.hasError"></p> 470 471 </td> 472 </tr> 382 473 <?php endif; ?> 383 474 … … 386 477 387 478 <td 388 colspan=" 3">479 colspan="4"> 389 480 390 481 <label … … 409 500 410 501 <td 411 colspan=" 3">502 colspan="4"> 412 503 413 504 <label … … 436 527 data-bind="if: 'routing' == addressingMethod()"> 437 528 <td 438 colspan=" 6">529 colspan="8"> 439 530 440 531 <p … … 454 545 455 546 <td 456 colspan=" 3">547 colspan="4"> 457 548 458 549 <label … … 476 567 477 568 <td 478 colspan=" 3">569 colspan="4"> 479 570 480 571 <label … … 501 592 data-bind="if: 'ifsc' == addressingMethod()"> 502 593 <td 503 colspan=" 6">594 colspan="8"> 504 595 505 596 <p … … 517 608 <tr> 518 609 <td 519 colspan=" 6">610 colspan="8"> 520 611 <label 521 612 class="comment"> … … 539 630 class="buttons-row"> 540 631 <td 541 colspan=" 3">632 colspan="4"> 542 633 <input 543 634 type="submit" 544 data-bind=" enabled: amount() > 0 && amount() <= self.maxAmount(), css: { 'wallets-submit-active': submitActive()}"635 data-bind="disable: submitActive, css: { 'wallets-submit-active': submitActive }" 545 636 value="<?php 546 637 echo apply_filters( … … 552 643 553 644 <td 554 colspan=" 3">645 colspan="4"> 555 646 <input 556 647 type="button" 557 648 class="button" 558 data-bind="click: reset "649 data-bind="click: reset, disable: submitActive" 559 650 value="<?php 560 651 echo apply_filters( … … 920 1011 if ( $payment_details['iban'] && $payment_details['swiftBic'] ) { 921 1012 $addressing_method = 'iban'; 1013 } elseif ( $payment_details['swiftBic'] && $payment_details['accountNumber'] ) { 1014 $addressing_method = 'swacc'; 922 1015 } elseif ( $payment_details['routingNumber'] && $payment_details['accountNumber'] ) { 923 1016 $addressing_method = 'routing'; … … 934 1027 935 1028 <?php if ( 'off' == $atts['validation'] ): ?> 936 self.swiftBic = ko.observable( '<?php echo esc_js( $payment_details['swiftBic' ] ?? '' ); ?>' );937 self.iban = ko.observable( '<?php echo esc_js( $payment_details['iban' ] ?? '' ); ?>' );1029 self.swiftBic = ko.observable( '<?php echo esc_js( $payment_details['swiftBic' ] ?? '' ); ?>' ); 1030 self.iban = ko.observable( '<?php echo esc_js( $payment_details['iban' ] ?? '' ); ?>' ); 938 1031 self.routingNumber = ko.observable( '<?php echo esc_js( $payment_details['routingNumberic'] ?? '' ); ?>' ); 939 1032 self.accountNumber = ko.observable( '<?php echo esc_js( $payment_details['accountNumber' ] ?? '' ); ?>' ); 940 self.ifsc = ko.observable( '<?php echo esc_js( $payment_details['ifsc' ] ?? '' ); ?>' );1033 self.ifsc = ko.observable( '<?php echo esc_js( $payment_details['ifsc' ] ?? '' ); ?>' ); 941 1034 self.indianAccNum = ko.observable( '<?php echo esc_js( $payment_details['indianAccNum' ] ?? '' ); ?>' ); 942 1035 <?php else: ?> 943 self.swiftBic = ko.observable( '<?php echo esc_js( $payment_details['swiftBic' ] ?? '' ); ?>' ).extend( { validateSwiftBic: '' } );944 self.iban = ko.observable( '<?php echo esc_js( $payment_details['iban' ] ?? '' ); ?>' ).extend( { validateIban: '' } );1036 self.swiftBic = ko.observable( '<?php echo esc_js( $payment_details['swiftBic' ] ?? '' ); ?>' ).extend( { validateSwiftBic: '' } ); 1037 self.iban = ko.observable( '<?php echo esc_js( $payment_details['iban' ] ?? '' ); ?>' ).extend( { validateIban: '' } ); 945 1038 self.routingNumber = ko.observable( '<?php echo esc_js( $payment_details['routingNumberic'] ?? '' ); ?>' ).extend( { validateRoutingNumber: '' } ); 946 1039 self.accountNumber = ko.observable( '<?php echo esc_js( $payment_details['accountNumber' ] ?? '' ); ?>' ).extend( { validateAccountNumber: '' } ); 947 self.ifsc = ko.observable( '<?php echo esc_js( $payment_details['ifsc' ] ?? '' ); ?>' ).extend( { validateIfsc: '' } );1040 self.ifsc = ko.observable( '<?php echo esc_js( $payment_details['ifsc' ] ?? '' ); ?>' ).extend( { validateIfsc: '' } ); 948 1041 self.indianAccNum = ko.observable( '<?php echo esc_js( $payment_details['indianAccNum' ] ?? '' ); ?>' ).extend( { validateIndianAccNum: '' } ); 949 1042 … … 1067 1160 1068 1161 self.send = function() { 1162 1069 1163 let sc = self.selectedCurrency(); 1070 1164 … … 1077 1171 }; 1078 1172 1079 if ( ! data.amount || ( data.amount < sc.min_withdraw * Math.pow( 10, -sc.decimals ) ) || ( data.amount > self.maxAmount() ) ) { 1080 return; 1173 if ( data.amount === undefined || 1174 data.amount <= 0 || 1175 data.amount < sc.min_withdraw * Math.pow( 10, -sc.decimals ) || 1176 data.amount > self.maxAmount() 1177 ) { 1178 return; 1081 1179 } 1082 1180 1083 1181 if ( 'iban' == self.addressingMethod() ) { 1084 1182 data.swiftBic = self.swiftBic(); 1085 data.iban = self.iban(); 1183 data.iban = self.iban(); 1184 1185 } else if ( 'swacc' == self.addressingMethod() ) { 1186 data.swiftBic = self.swiftBic(); 1187 data.accountNumber = self.accountNumber(); 1188 1086 1189 } else if ( 'routing' == self.addressingMethod() ) { 1087 1190 data.routingNumber = self.routingNumber(); 1088 1191 data.accountNumber = self.accountNumber(); 1192 1089 1193 } else if ( 'ifsc' == self.addressingMethod() ) { 1090 1194 data.ifsc = self.ifsc(); -
wallets/trunk/wallets.php
r3093019 r3095476 3 3 * Plugin Name: Bitcoin and Altcoin Wallets 4 4 * Description: Custodial cryptocurrency wallets. 5 * Version: 6. 2.75 * Version: 6.3.0 6 6 * Plugin URI: https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin 7 7 * Requires at least: 6.0
Note: See TracChangeset
for help on using the changeset viewer.