Plugin Directory

Changeset 3095476


Ignore:
Timestamp:
05/31/2024 05:54:33 AM (22 months ago)
Author:
dashedslug
Message:

Adding version 6.3.0 of wallets

Location:
wallets/trunk
Files:
20 added
20 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • wallets/trunk/adapters/class-bank-fiat-adapter.php

    r3093019 r3095476  
    7171                'options' => [
    7272                    'iban'    => __( 'SWIFT/BIC and IBAN (World)', 'wallets' ),
     73                    'swacc'   => __( 'SWIFT/BIC and Account Number', 'wallets' ),
    7374                    'routing' => __( 'Routing Number and Account Number (USA/Americas)', 'wallets' ),
    7475                    'ifsc'    => __( 'IFSC and Account Number (India)', 'wallets' ),
     
    158159
    159160    public function get_wallet_version(): string {
    160         return '6.2.7';
     161        return '6.3.0';
    161162    }
    162163
     
    481482                            $label     = "{ \"iban\": \"$iban\", \"swiftBic\": \"$swift_bic\" }";
    482483
     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
    483490                        } elseif ( 'routing' == $addressing_method ) {
    484491
     
    683690                    get_asset_path( 'wallets-admin-deposit-tool' ),
    684691                    [ 'jquery' ],
    685                     '6.2.7',
     692                    '6.3.0',
    686693                    true
    687694                );
     
    882889                                                        name="wallets_bankaddressingmethod"
    883890                                                        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"
    884906                                                        value="routing">
    885907
     
    916938                                                    <span
    917939                                                        class="iban">
     940                                                        <?php _e( 'SWIFT-<abbr title="Business Identifier Code">BIC</abbr>', 'wallets' ); ?>
     941                                                    </span>
     942                                                    <span
     943                                                        class="swacc">
    918944                                                        <?php _e( 'SWIFT-<abbr title="Business Identifier Code">BIC</abbr>', 'wallets' ); ?>
    919945                                                    </span>
     
    944970                                                        class="iban">
    945971                                                        <?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' ); ?>
    946976                                                    </span>
    947977                                                    <span
     
    11311161                            if ( 'iban' == $addressing_method ) {
    11321162                                $label = "{ \"iban\": \"$bank_account\", \"swiftBic\": \"$bank_branch\" }";
     1163
     1164                            } elseif ( 'swacc' == $addressing_method ) {
     1165                                $label = "{ \"swiftBic\": \"$bank_branch\", \"accountNumber\": \"$bank_account\"}";
    11331166
    11341167                            } elseif ( 'routing' == $addressing_method ) {
     
    14531486                                $addressing_method = '';
    14541487                                $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                                    }
    14611498                                }
    14621499
     
    15421579                                                    <?php
    15431580                                                    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;
    15451583                                                        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;
    15471585                                                        default:
    15481586                                                            printf(
     
    15561594                                                    <pre><?php
    15571595                                                    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;
    15591598                                                        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;
    15611600                                                        default:
    15621601                                                            printf(
     
    15731612                                                    <?php
    15741613                                                    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;
    15761616                                                        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;
    15781618                                                        default:
    15791619                                                            printf(
     
    15871627                                                    <pre><?php
    15881628                                                    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;
    15901631                                                        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;
    15921633                                                        default:
    15931634                                                            printf(
  • wallets/trunk/adapters/class-bitcoin-core-like-wallet-adapter.php

    r3093019 r3095476  
    738738                [
    739739                    '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',
    741741                    'headers'     => [
    742742                        'Accept-Encoding: gzip',
  • wallets/trunk/admin/assets.php

    r3093019 r3095476  
    2222                get_asset_path( 'wallets-admin', 'style' ),
    2323                [],
    24                 '6.2.7'
     24                '6.3.0'
    2525            );
    2626
     
    5252                get_asset_path( 'wallets-admin-menu-item' ),
    5353                [ 'jquery' ],
    54                 '6.2.7',
     54                '6.3.0',
    5555                true
    5656            );
     
    6060                get_asset_path( 'wallets-admin-cs-tool' ),
    6161                [ 'jquery-qrcode' ],
    62                 '6.2.7',
     62                '6.3.0',
    6363                true
    6464            );
     
    7575                get_asset_path( 'wallets-admin-capabilities' ),
    7676                [ 'jquery-ui-tabs' ],
    77                 '6.2.7',
     77                '6.3.0',
    7878                true
    7979            );
     
    8383                get_asset_path( 'wallets-admin-dashboard' ),
    8484                [ 'jquery-ui-tabs', 'jqcloud' ],
    85                 '6.2.7',
     85                '6.3.0',
    8686                true
    8787            );
     
    9191                get_asset_path( 'wallets-admin-docs' ),
    9292                [ 'jquery' ],
    93                 '6.2.7',
     93                '6.3.0',
    9494                true
    9595            );
     
    9999                get_asset_path( 'wallets-admin-editor' ),
    100100                [ 'suggest' ],
    101                 '6.2.7',
     101                '6.3.0',
    102102                true
    103103            );
  • wallets/trunk/admin/dashboard.php

    r3093019 r3095476  
    349349        global $wpdb;
    350350
    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';
    353353        $debug_data[ (string) __( 'Web Server', 'wallets' ) ]             = $_SERVER['SERVER_SOFTWARE'];
    354354        $debug_data[ (string) __( 'PHP version', 'wallets' ) ]            = PHP_VERSION;
  • wallets/trunk/admin/migration.php

    r2941101 r3095476  
    543543        // check if already in the tool page
    544544        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'] ) {
    546546            return;
    547547        }
     
    634634    }
    635635);
    636 
  • wallets/trunk/docs/glossary.md

    r2996338 r3095476  
    145145## CoinGecko ID {#coingecko-id}
    146146
    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. 
     147Each 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.
    148148
    149149To learn how you can set the CoinGecko ID on a currency easily, go to: _The Post Types_ &rarr; _Currencies_ &rarr; _Fields_ &rarr; _[Currency exchange rates][currency-exchange-rates]_.
     
    683683Replace the numbers in the JSON with the actual *SWIFT/BIC* and *Account number* of the wire transfer's destination.
    684684
     685## SWIFT-BIC and Account Number {#swift-bic-and-accnum}
     686
     687An 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
     689To 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
     693Replace the numbers in the JSON with the actual *SWIFT/BIC* and *Account number* of the wire transfer's destination.
    685694
    686695## Symbol {#symbol}
  • wallets/trunk/docs/tools.md

    r2857585 r3095476  
    3737- *[Adapter type][glossary-adapter-type]* - The type of wallet adapter used for this currency, such as Bitcoin-like, Monero-like, etc.
    3838- *[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.
    4040- *[User balances][glossary-user-balance]* - The total of all your users' balances.
    4141- *% 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.
     
    6868  - IFSC
    6969  - Account number
     70- Bank deposit details (for banks in Africa):
     71  - Bank name and address
     72  - SWIFT-BIC
     73  - Account Number
    7074- Bank deposit details (for banks in Europe):
    7175  - Bank name and address
  • wallets/trunk/frontend/assets.php

    r3093019 r3095476  
    2323            get_asset_path( 'wallets', 'style' ),
    2424            [],
    25             '6.2.7'
     25            '6.3.0'
    2626        );
    2727
     
    8686            get_asset_path( 'jsqrcode' ),
    8787            [ 'jquery' ],
    88             '6.2.7',
     88            '6.3.0',
    8989            true
    9090        );
     
    128128            get_asset_path( 'wallets-front' ),
    129129            [ 'knockout', 'jquery', 'style-scoped', 'sprintf.js' ],
    130             '6.2.7',
     130            '6.3.0',
    131131            true
    132132        );
  • wallets/trunk/post-types/class-address.php

    r3089855 r3095476  
    227227            'post_type'   => 'wallets_address',
    228228            '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             ],
    236229        ];
    237230
     
    241234        $result = wp_insert_post( $postarr );
    242235        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
    243300        add_action( 'save_post', [ __CLASS__, 'save_post' ], 10, 3 );
    244301
  • wallets/trunk/post-types/class-transaction.php

    r3093019 r3095476  
    464464        }
    465465
     466        $user_id = $this->user ? $this->user->ID : 0;
     467
    466468        $postarr = [
    467469            'ID'          => $this->post_id ?? null,
     
    470472            'post_type'   => 'wallets_tx',
    471473            '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             ],
    486474        ];
    487475
     
    490478        $result = wp_insert_post( $postarr );
    491479        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        }
    492572
    493573        if ( ! $this->post_id && $result && is_integer( $result ) ) {
     
    495575
    496576        } elseif ( $result instanceof \WP_Error ) {
    497             maybe_restore_blog();
    498577
    499578            throw new \Exception(
     
    508587        $this->dirty = false;
    509588
    510         maybe_restore_blog();
    511589    }
    512590
     
    562640        } elseif ( 'address' == $name ) {
    563641            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 );
    565643                $this->address = $value;
    566644            } else {
     
    570648        } elseif ( 'currency' == $name ) {
    571649            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 );
    573651                $this->currency = $value;
    574652            } else {
  • wallets/trunk/readme.txt

    r3093019 r3095476  
    66Tested up to: 6.5.3
    77Requires PHP: 7.0
    8 Stable tag: 6.2.7
     8Stable tag: 6.3.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    337337
    338338== 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.
    339344
    340345= 6.2.7 =
     
    496501== Upgrade Notice ==
    497502
    498 Version `6.2.7` fixes a few issues introduced in `6.2.6`.
     503Version `6.3.0` adds a requested feature, fixes a UI defect and improves performance.
    499504
    500505== Donating ==
  • wallets/trunk/templates/email-fiat_deposit_cancelled_admins.php

    r2973854 r3095476  
    3232
    3333$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';
     34if ( $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    }
    4044}
    4145
     
    124128        </tr>
    125129
     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
    126142        <?php elseif ( 'routing' == $addressing_method ): ?>
    127143
  • wallets/trunk/templates/email-fiat_deposit_cancelled_sender.php

    r2973854 r3095476  
    3232
    3333$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';
     34if ( $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    }
    4044}
    4145
     
    102106        </tr>
    103107
     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
    104120        <?php elseif ( 'routing' == $addressing_method ): ?>
    105121
  • wallets/trunk/templates/email-fiat_deposit_done_admins.php

    r2973854 r3095476  
    3030
    3131$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';
     32if ( $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    }
    3842}
    3943
     
    122126        </tr>
    123127
     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
    124140        <?php elseif ( 'routing' == $addressing_method ): ?>
    125141
  • wallets/trunk/templates/email-fiat_deposit_done_sender.php

    r2973854 r3095476  
    3232
    3333$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';
     34if ( $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    }
    4044}
    4145
     
    100104        </tr>
    101105
     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
    102118        <?php elseif ( 'routing' == $addressing_method ): ?>
    103119
  • wallets/trunk/templates/email-fiat_deposit_failed_admins.php

    r2973854 r3095476  
    122122        </tr>
    123123
     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
    124136        <?php elseif ( 'routing' == $addressing_method ): ?>
    125137
  • wallets/trunk/templates/email-fiat_deposit_failed_sender.php

    r2973854 r3095476  
    3232
    3333$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';
     34if ( $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    }
    4044}
    4145
     
    103107        </tr>
    104108
     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
    105121        <?php elseif ( 'routing' == $addressing_method ): ?>
    106122
  • wallets/trunk/templates/email-fiat_deposit_pending_admins.php

    r2973854 r3095476  
    3232
    3333$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';
     34if ( $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    }
    4044}
     45
    4146
    4247$url = sprintf(
     
    124129        </tr>
    125130
     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
    126143        <?php elseif ( 'routing' == $addressing_method ): ?>
    127144
  • wallets/trunk/templates/email-fiat_deposit_pending_sender.php

    r2973854 r3095476  
    3333
    3434$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';
     35if ( $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    }
    4145}
    4246
     
    103107        </tr>
    104108
     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
    105121        <?php elseif ( 'routing' == $addressing_method ): ?>
    106122
  • wallets/trunk/templates/email-fiat_withdrawal_pending_admins.php

    r2973854 r3095476  
    3333
    3434$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';
     35if ( $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    }
    4145}
    4246
     
    118122        </tr>
    119123
     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
    120136        <?php elseif ( 'routing' == $addressing_method ): ?>
    121137
  • wallets/trunk/templates/email-fiat_withdrawal_pending_sender.php

    r2973854 r3095476  
    3333
    3434$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';
     35if ( $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    }
    4145}
    4246
     
    123127        </tr>
    124128
     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
    125141        <?php elseif ( 'routing' == $addressing_method ): ?>
    126142
  • wallets/trunk/templates/fiat_deposit.php

    r2973854 r3095476  
    149149                <td>
    150150                    <label
    151                         data-bind="visible: 'iban' == selectedCurrency().bankaddressingmethod"
     151                        data-bind="visible: 'iban' == selectedCurrency().bankaddressingmethod || 'swacc' == selectedCurrency().bankaddressingmethod"
    152152                        class="bank-bic">
    153153                        <?php
     
    215215
    216216                    <label
    217                         data-bind="visible: 'routing' == selectedCurrency().bankaddressingmethod"
     217                        data-bind="visible: 'routing' == selectedCurrency().bankaddressingmethod || 'swacc' == selectedCurrency().bankaddressingmethod"
    218218                        class="bank-acc-accnum">
    219219                        <?php
  • wallets/trunk/templates/fiat_withdraw.php

    r2973854 r3095476  
    7272                <tr>
    7373                    <td
    74                         colspan="6">
     74                        colspan="8">
    7575                        <label
    7676                            class="coin currency">
     
    201201                <tr>
    202202                    <td
    203                         colspan="6">
     203                        colspan="8">
    204204                        <label
    205205                            class="recipientNameAddress recipient-name-address">
     
    224224                <tr>
    225225                    <td
    226                         colspan="6">
     226                        colspan="8">
    227227                        <label
    228228                            class="bankNameAddress bank-name-address">
     
    245245                </tr>
    246246
    247                 <tr>
     247                <tr style="vertical-align: top">
    248248                    <td
    249249                        colspan="2">
     
    274274
    275275                        <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
    276300                            class="bankWithdrawMethod addressing-method routing">
    277301
     
    286310                                    'wallets_fiat_ui_text_routingaccnum',
    287311                                    esc_html__(
    288                                         'Routing & Account numbers',
     312                                        'Routing & Account number',
    289313                                        'wallets'
    290314                                    )
     
    323347
    324348                    <td
    325                         colspan="2">
     349                        colspan="3">
    326350                        <label
    327351                            class="swiftbic swift-bic">
     
    345369
    346370                    <td
    347                         colspan="4">
     371                        colspan="5">
    348372
    349373                        <label
     
    363387                                data-bind="value: iban, valueUpdate: ['afterkeydown', 'input']" /></label>
    364388                    </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
    365439                </tr>
    366440
     
    370444
    371445                    <td
    372                         colspan="6">
     446                        colspan="8">
    373447
    374448                        <p
    375449                            class="validationMessage"
    376450                            data-bind="text: swiftBic.validationMessage, visible: swiftBic.hasError"></p>
     451
    377452                        <p
    378453                            class="validationMessage"
     
    380455                    </td>
    381456                </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>
    382473                <?php endif; ?>
    383474
     
    386477
    387478                    <td
    388                         colspan="3">
     479                        colspan="4">
    389480
    390481                        <label
     
    409500
    410501                    <td
    411                         colspan="3">
     502                        colspan="4">
    412503
    413504                        <label
     
    436527                    data-bind="if: 'routing' == addressingMethod()">
    437528                    <td
    438                         colspan="6">
     529                        colspan="8">
    439530
    440531                        <p
     
    454545
    455546                    <td
    456                         colspan="3">
     547                        colspan="4">
    457548
    458549                        <label
     
    476567
    477568                    <td
    478                         colspan="3">
     569                        colspan="4">
    479570
    480571                        <label
     
    501592                    data-bind="if: 'ifsc' == addressingMethod()">
    502593                    <td
    503                         colspan="6">
     594                        colspan="8">
    504595
    505596                        <p
     
    517608                <tr>
    518609                    <td
    519                         colspan="6">
     610                        colspan="8">
    520611                        <label
    521612                            class="comment">
     
    539630                    class="buttons-row">
    540631                    <td
    541                         colspan="3">
     632                        colspan="4">
    542633                        <input
    543634                            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 }"
    545636                            value="<?php
    546637                                echo apply_filters(
     
    552643
    553644                    <td
    554                         colspan="3">
     645                        colspan="4">
    555646                        <input
    556647                            type="button"
    557648                            class="button"
    558                             data-bind="click: reset"
     649                            data-bind="click: reset, disable: submitActive"
    559650                            value="<?php
    560651                                echo apply_filters(
     
    9201011                    if ( $payment_details['iban'] && $payment_details['swiftBic'] ) {
    9211012                        $addressing_method = 'iban';
     1013                    } elseif ( $payment_details['swiftBic'] && $payment_details['accountNumber'] ) {
     1014                        $addressing_method = 'swacc';
    9221015                    } elseif ( $payment_details['routingNumber'] && $payment_details['accountNumber'] ) {
    9231016                        $addressing_method = 'routing';
     
    9341027
    9351028            <?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'        ] ?? '' ); ?>' );
    9381031            self.routingNumber = ko.observable( '<?php echo esc_js( $payment_details['routingNumberic'] ?? '' ); ?>' );
    9391032            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'        ] ?? '' ); ?>' );
    9411034            self.indianAccNum  = ko.observable( '<?php echo esc_js( $payment_details['indianAccNum'   ] ?? '' ); ?>' );
    9421035            <?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:       '' } );
    9451038            self.routingNumber = ko.observable( '<?php echo esc_js( $payment_details['routingNumberic'] ?? '' ); ?>' ).extend( { validateRoutingNumber: '' } );
    9461039            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:       '' } );
    9481041            self.indianAccNum  = ko.observable( '<?php echo esc_js( $payment_details['indianAccNum'   ] ?? '' ); ?>' ).extend( { validateIndianAccNum:  '' } );
    9491042
     
    10671160
    10681161            self.send = function() {
     1162
    10691163                let sc = self.selectedCurrency();
    10701164
     
    10771171                };
    10781172
    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;
    10811179                }
    10821180
    10831181                if ( 'iban' == self.addressingMethod() ) {
    10841182                    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
    10861189                } else if ( 'routing' == self.addressingMethod() ) {
    10871190                    data.routingNumber = self.routingNumber();
    10881191                    data.accountNumber = self.accountNumber();
     1192
    10891193                } else if ( 'ifsc' == self.addressingMethod() ) {
    10901194                    data.ifsc = self.ifsc();
  • wallets/trunk/wallets.php

    r3093019 r3095476  
    33 * Plugin Name:         Bitcoin and Altcoin Wallets
    44 * Description:         Custodial cryptocurrency wallets.
    5  * Version:             6.2.7
     5 * Version:             6.3.0
    66 * Plugin URI:          https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin
    77 * Requires at least:   6.0
Note: See TracChangeset for help on using the changeset viewer.