WordPress.org

Making WordPress.org

Changeset 3760


Ignore:
Timestamp:
08/01/2016 09:35:00 PM (2 years ago)
Author:
iandunn
Message:

WordCamp QBO: Add WPSC's Tax ID and the sponsor's VAT ID to invoices.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php

    r3392 r3760  
    343343                'email-address' => is_email(            $sponsor_meta['_wcpt_sponsor_email_address'][0] ),
    344344                'phone-number'  => sanitize_text_field( $sponsor_meta['_wcpt_sponsor_phone_number' ][0] ),
     345                'vat-number'    => sanitize_text_field( $sponsor_meta['_wcpt_sponsor_vat_number'   ][0] ),
    345346
    346347                'address1' => sanitize_text_field( $sponsor_meta['_wcpt_sponsor_street_address1'][0] ),
     
    377378    /**
    378379     * Get the sponsorship level name assigned to a sponsor
    379      * 
     380     *
    380381     * @param int $sponsor_id
    381382     *
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo/wordcamp-qbo.php

    r3600 r3760  
    411411        $statement_memo    = sanitize_text_field( $statement_memo    );
    412412
     413        $sponsor = array_map( 'sanitize_text_field', $sponsor );
     414
    413415        $line_description = $wordcamp_name;
    414416        if ( $sponsorship_level ) {
     
    465467        $payload = array(
    466468            'PrivateNote' => $statement_memo,
     469
     470            'CustomField' => array(
     471                // WPCS Tax ID
     472                array(
     473                    'DefinitionId' => '1',
     474                    'Type'         => 'StringType',
     475                    'StringValue'  => '81-0896291',
     476                ),
     477
     478                // Sponsor VAT ID
     479                array(
     480                    'DefinitionId' => '2',
     481                    'Type'         => 'StringType',
     482                    'StringValue'  => $sponsor['vat-number'],
     483                ),
     484            ),
    467485
    468486            'Line' => array(
     
    12661284            </form>
    12671285        </div>
    1268        
     1286
    12691287        <script>
    12701288            (function($){
Note: See TracChangeset for help on using the changeset viewer.