Making WordPress.org


Ignore:
Timestamp:
11/15/2017 12:07:46 AM (6 years ago)
Author:
iandunn
Message:

WordCamp Payments: Decrypt mailing addresses during JPM export.

These fields were encrypted in r6110, and the changes in this commit should have been made at that time. Because they weren't, imports to JPM are failing because of the import files contains the ciphertext, which aren't valid values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/payment-request.php

    r6106 r6122  
    14481448
    14491449                '24-id-type' => 'SWIFT',
    1450                 '25-id-value' => get_post_meta( $post->ID, '_camppayments_bank_bic', true ),
    1451                 '26-ben-bank-name' => substr( get_post_meta( $post->ID, '_camppayments_bank_name', true ), 0, 35 ),
    1452                 '27-ben-bank-address-1' => substr( get_post_meta( $post->ID, '_camppayments_bank_street_address', true ), 0, 35 ),
     1450                '25-id-value'           => WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_bank_bic', true ) ),
     1451                '26-ben-bank-name'      => substr( WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_bank_name',           true ) ), 0, 35 ),
     1452                '27-ben-bank-address-1' => substr( WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_bank_street_address', true ) ), 0, 35 ),
    14531453                '28-ben-bank-address-2' => '',
    14541454                '29-ben-bank-address-3' => substr( sprintf( '%s %s %s',
    1455                         get_post_meta( $post->ID, '_camppayments_bank_city', true ),
    1456                         get_post_meta( $post->ID, '_camppayments_bank_state', true ),
    1457                         get_post_meta( $post->ID, '_camppayments_bank_zip_code', true )
     1455                        WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_bank_city',     true ) ),
     1456                        WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_bank_state',    true ) ),
     1457                        WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_bank_zip_code', true ) )
    14581458                     ), 0, 32 ),
    1459                 '30-ben-bank-country' => get_post_meta( $post->ID, '_camppayments_bank_country_iso3166', true ),
     1459                '30-ben-bank-country' => WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_bank_country_iso3166', true ) ),
    14601460                '31-supl-id-type' => '',
    14611461                '32-supl-id-value' => '',
     
    15591559
    15601560            // If an intermediary bank is given.
    1561             $interm_swift = get_post_meta( $post->ID, '_camppayments_interm_bank_swift', true );
     1561            $interm_swift = WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_interm_bank_swift', true ) );
    15621562            if ( ! empty( $iterm_swift ) ) {
    15631563                $row['40-id-type'] = 'SWIFT';
    15641564                $row['41-id-value'] = $interm_swift;
    15651565
    1566                 $row['42-interm-bank-name'] = substr( get_post_meta( $post->ID, '_camppayments_interm_bank_name', true ), 0, 35 );
    1567                 $row['43-interm-bank-address-1'] = substr( get_post_meta( $post->ID, '_camppayments_interm_bank_street_address', true ), 0, 35 );
     1566                $row['42-interm-bank-name']      = substr( WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_interm_bank_name',           true ) ), 0, 35 );
     1567                $row['43-interm-bank-address-1'] = substr( WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_interm_bank_street_address', true ) ), 0, 35 );
    15681568
    15691569                $row['44-interm-bank-address-2'] = '';
    15701570                $row['45-interm-bank-address-3'] = substr( sprintf( '%s %s %s',
    1571                     get_post_meta( $post->ID, '_camppayments_interm_bank_city', true ),
    1572                     get_post_meta( $post->ID, '_camppayments_interm_bank_state', true ),
    1573                     get_post_meta( $post->ID, '_camppayments_interm_bank_zip_code', true )
     1571                    WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_interm_bank_city',     true ) ),
     1572                    WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_interm_bank_state',    true ) ),
     1573                    WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_interm_bank_zip_code', true ) )
    15741574                ), 0, 32 );
    15751575
    1576                 $row['46-interm-bank-country'] = get_post_meta( $post->ID, '_camppayments_interm_bank_country_iso3166', true );
     1576                $row['46-interm-bank-country'] = WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_interm_bank_country_iso3166', true ) );
    15771577
    15781578                $row['47-supl-id-type'] = 'ACCT';
    1579                 $row['48-supl-id-value'] = get_post_meta( $post->ID, '_camppayments_interm_bank_account', true );
     1579                $row['48-supl-id-value'] = WCP_Encryption::maybe_decrypt( get_post_meta( $post->ID, '_camppayments_interm_bank_account', true ) );
    15801580            }
    15811581
Note: See TracChangeset for help on using the changeset viewer.