Plugin Directory

Changeset 1801300


Ignore:
Timestamp:
01/11/2018 05:00:53 PM (8 years ago)
Author:
andsnleo
Message:

Launch v2.0.0

Location:
iugu-woocommerce
Files:
43 added
10 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • iugu-woocommerce/trunk/includes/class-wc-iugu-api.php

    r1787546 r1801300  
    120120        $rate = isset( $this->gateway->transaction_rate ) ? $this->gateway->transaction_rate : 7;
    121121
    122         return woocommerce_format_decimal( $rate );
     122        return wc_format_decimal( $rate );
    123123    }
    124124
     
    349349     */
    350350    protected function get_phone_number( $order ) {
    351         $phone_number = $this->only_numbers( $order->billing_phone );
     351        $phone_number = $this->only_numbers( $order->get_billing_phone() );
    352352
    353353        return array(
     
    369369
    370370        if ( 0 !== $person_type ) {
    371             if ( ( 1 === $person_type && 1 === intval( $order->billing_persontype ) ) || 2 === $person_type ) {
    372                 return $this->only_numbers( $order->billing_cpf );
    373             }
    374 
    375             if ( ( 1 === $person_type && 2 === intval( $order->billing_persontype ) ) || 3 === $person_type ) {
    376                 return $this->only_numbers( $order->billing_cnpj );
     371            if ( ( 1 === $person_type && 1 === intval( $order->get_meta( '_billing_persontype' ) ) ) || 2 === $person_type ) {
     372                return $this->only_numbers( $order->get_meta( '_billing_cpf' ) );
     373            }
     374
     375            if ( ( 1 === $person_type && 2 === intval( $order->get_meta( '_billing_persontype' ) ) ) || 3 === $person_type ) {
     376                return $this->only_numbers( $order->get_meta( '_billing_cnpj' ) );
    377377            }
    378378        }
     
    390390    protected function is_a_company( $order ) {
    391391        $wcbcf_settings = get_option( 'wcbcf_settings' );
    392 
    393         if ( ( '1' === $wcbcf_settings['person_type'] && '2' === $order->billing_persontype ) || '3' === $wcbcf_settings['person_type'] ) {
     392        $person_type = intval( $wcbcf_settings['person_type'] );
     393
     394        if ( ( $person_type === 1 && intval( $order->get_meta( '_billing_persontype' ) ) === 2 ) || $person_type === 3 ) {
    394395            return true;
    395396        }
     
    420421        $phone_number = $this->get_phone_number( $order );
    421422        $data         = array(
    422             'email'            => $order->billing_email,
     423            'email'            => $order->get_billing_email(),
    423424            'due_date'         => $this->get_invoice_due_date(),
    424425            'return_url'       => $this->gateway->get_return_url( $order ),
     
    430431                array(
    431432                    'name'  => 'order_id',
    432                     'value' => $order->id
     433                    'value' => $order->get_id()
    433434                )
    434435            ),
    435436            'payer'      => array(
    436                 'name'         => $order->billing_first_name . ' ' . $order->billing_last_name,
     437                'name'         => $order->get_formatted_billing_full_name(),
    437438                'phone_prefix' => $phone_number['area_code'],
    438439                'phone'        => $phone_number['number'],
    439                 'email'        => $order->billing_email,
     440                'email'        => $order->get_billing_email(),
    440441                'address'      => array(
    441                     'street'   => $order->billing_address_1,
    442                     'number'   => $order->billing_number,
    443                     'city'     => $order->billing_city,
    444                     'state'    => $order->billing_state,
    445                     'country'  => isset( WC()->countries->countries[ $order->billing_country ] ) ? WC()->countries->countries[ $order->billing_country ] : $order->billing_country,
    446                     'zip_code' => $this->only_numbers( $order->billing_postcode )
     442                    'street'   => $order->get_billing_address_1(),
     443                    'number'   => $order->get_meta( '_billing_number' ),
     444                    'city'     => $order->get_billing_city(),
     445                    'state'    => $order->get_billing_state(),
     446                    'country'  => isset( WC()->countries->countries[ $order->get_billing_country() ] ) ? WC()->countries->countries[ $order->get_billing_country() ] : $order->get_billing_country(),
     447                    'zip_code' => $this->only_numbers( $order->get_billing_postcode() )
    447448                )
    448449            ),
     
    454455
    455456        if ( $this->is_a_company( $order ) ) {
    456             $data['payer']['name'] = $order->billing_company;
    457         }
    458 
    459         if ( ! empty( $order->billing_neighborhood ) ) {
    460             $data['payer']['address']['district'] = $order->billing_neighborhood;
     457            $data['payer']['name'] = $order->get_billing_company();
     458        }
     459
     460        if ( ! empty( $order->get_meta( '_billing_neighborhood' ) ) ) {
     461            $data['payer']['address']['district'] = $order->get_meta( '_billing_neighborhood' );
    461462        }
    462463
     
    480481
    481482                        $item_name = $order_item['name'];
    482                         $item_meta = new WC_Order_Item_Meta( $order_item['item_meta'] );
    483 
    484                         if ( $meta = $item_meta->display( true, true ) ) {
     483                        $item_meta = new WC_Order_Item_Product( $order_item['item_meta'] );
     484
     485                        if ( $meta = $item_meta->get_formatted_meta_data() ){
    485486                            $item_name .= ' - ' . $meta;
    486487                        }
     
    755756
    756757        $data = array(
    757             'email'          => $order->billing_email,
    758             'name'           => trim( $order->billing_first_name . ' ' . $order->billing_last_name ),
     758            'email'          => $order->get_billing_email(),
     759            'name'           => trim( $order->get_formatted_billing_full_name() ),
    759760            'set_as_default' => true
    760761        );
     
    909910            );
    910911
    911             update_post_meta( $order->id, __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
     912            update_post_meta( $order->get_id(), __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
    912913        } else {
    913914            $payment_data = array_map(
     
    919920        }
    920921
    921         update_post_meta( $order->id, '_iugu_wc_transaction_data', $payment_data );
    922         update_post_meta( $order->id, '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
     922        update_post_meta( $order->get_id(), '_iugu_wc_transaction_data', $payment_data );
     923        update_post_meta( $order->get_id(), '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
    923924
    924925        // Save only in old versions.
    925926        if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.1.12', '<=' ) ) {
    926             update_post_meta( $order->id, __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
     927            update_post_meta( $order->get_id(), __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
    927928        }
    928929
  • iugu-woocommerce/trunk/includes/class-wc-iugu-bank-slip-addons-gateway-deprecated.php

    r1778472 r1801300  
    162162            )
    163163        );
    164         update_post_meta( $order->id, '_iugu_wc_transaction_data', $payment_data );
    165         update_post_meta( $order->id, __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
    166         update_post_meta( $order->id, '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
     164        update_post_meta( $order->get_id(), '_iugu_wc_transaction_data', $payment_data );
     165        update_post_meta( $order->get_id(), __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
     166        update_post_meta( $order->get_id(), '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
    167167
    168168        // Save only in old versions.
    169169        if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.1.12', '<=' ) ) {
    170             update_post_meta( $order->id, __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
     170            update_post_meta( $order->get_id(), __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
    171171        }
    172172
     
    223223                )
    224224            );
    225             update_post_meta( $order->id, '_iugu_wc_transaction_data', $payment_data );
    226             update_post_meta( $order->id, __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
    227             update_post_meta( $order->id, '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
     225            update_post_meta( $order->get_id(), '_iugu_wc_transaction_data', $payment_data );
     226            update_post_meta( $order->get_id(), __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
     227            update_post_meta( $order->get_id(), '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
    228228
    229229            // Save only in old versions.
    230230            if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.1.12', '<=' ) ) {
    231                 update_post_meta( $order->id, __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
     231                update_post_meta( $order->get_id(), __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
    232232            }
    233233
  • iugu-woocommerce/trunk/includes/class-wc-iugu-bank-slip-addons-gateway.php

    r1778472 r1801300  
    166166            )
    167167        );
    168         update_post_meta( $order->id, '_iugu_wc_transaction_data', $payment_data );
    169         update_post_meta( $order->id, __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
    170         update_post_meta( $order->id, '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
     168        update_post_meta( $order->get_id(), '_iugu_wc_transaction_data', $payment_data );
     169        update_post_meta( $order->get_id(), __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
     170        update_post_meta( $order->get_id(), '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
    171171
    172172        // Save only in old versions.
    173173        if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.1.12', '<=' ) ) {
    174             update_post_meta( $order->id, __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
     174            update_post_meta( $order->get_id(), __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
    175175        }
    176176
     
    224224                )
    225225            );
    226             update_post_meta( $order->id, '_iugu_wc_transaction_data', $payment_data );
    227             update_post_meta( $order->id, __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
    228             update_post_meta( $order->id, '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
     226            update_post_meta( $order->get_id(), '_iugu_wc_transaction_data', $payment_data );
     227            update_post_meta( $order->get_id(), __( 'Iugu Bank Slip URL', 'iugu-woocommerce' ), $payment_data['pdf'] );
     228            update_post_meta( $order->get_id(), '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
    229229
    230230            // Save only in old versions.
    231231            if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.1.12', '<=' ) ) {
    232                 update_post_meta( $order->id, __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
     232                update_post_meta( $order->get_id(), __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
    233233            }
    234234
  • iugu-woocommerce/trunk/includes/class-wc-iugu-bank-slip-gateway.php

    r1778472 r1801300  
    199199        }
    200200
    201         woocommerce_get_template(
     201        wc_get_template(
    202202            'bank-slip/checkout-instructions.php',
    203203            array(),
     
    229229
    230230        if ( isset( $data['pdf'] ) ) {
    231             woocommerce_get_template(
     231            wc_get_template(
    232232                'bank-slip/payment-instructions.php',
    233233                array(
     
    250250     */
    251251    public function email_instructions( $order, $sent_to_admin, $plain_text = false ) {
    252         if ( $sent_to_admin || ! in_array( $order->status, array( 'processing', 'on-hold' ) ) || $this->id !== $order->payment_method ) {
     252        if ( $sent_to_admin || ! in_array( $order->get_status(), array( 'processing', 'on-hold' ) ) || $this->id !== $order->get_payment_method() ) {
    253253            return;
    254254        }
    255255
    256         $data = get_post_meta( $order->id, '_iugu_wc_transaction_data', true );
     256        $data = get_post_meta( $order->get_id(), '_iugu_wc_transaction_data', true );
    257257
    258258        if ( isset( $data['pdf'] ) ) {
    259259            if ( $plain_text ) {
    260                 woocommerce_get_template(
     260                wc_get_template(
    261261                    'bank-slip/emails/plain-instructions.php',
    262262                    array(
     
    267267                );
    268268            } else {
    269                 woocommerce_get_template(
     269                wc_get_template(
    270270                    'bank-slip/emails/html-instructions.php',
    271271                    array(
  • iugu-woocommerce/trunk/includes/class-wc-iugu-credit-card-addons-gateway-deprecated.php

    r1438809 r1801300  
    6969
    7070            // Save the payment method ID in order data.
    71             update_post_meta( $order->id, '_iugu_customer_payment_method_id', $payment_method_id );
     71            update_post_meta( $order->get_id(), '_iugu_customer_payment_method_id', $payment_method_id );
    7272
    7373            // Try to do an initial payment.
     
    134134
    135135                // Save the payment method ID in order data.
    136                 update_post_meta( $order->id, '_iugu_customer_payment_method_id', $payment_method_id );
     136                update_post_meta( $order->get_id(), '_iugu_customer_payment_method_id', $payment_method_id );
    137137
    138138                // Reduce stock levels
     
    200200        }
    201201
    202         $payment_method_id = get_post_meta( $order->id, '_iugu_customer_payment_method_id', true );
     202        $payment_method_id = get_post_meta( $order->get_id(), '_iugu_customer_payment_method_id', true );
    203203
    204204        // TODO: It's a workaround.
     
    209209
    210210            if ( ! empty( $payment_method_id ) ) {
    211                 update_post_meta( $order->id, '_iugu_customer_payment_method_id', $payment_method_id );
     211                update_post_meta( $order->get_id(), '_iugu_customer_payment_method_id', $payment_method_id );
    212212            }
    213213        }
     
    229229        }
    230230
    231         update_post_meta( $order->id, '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
     231        update_post_meta( $order->get_id(), '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
    232232
    233233        // Save only in old versions.
    234234        if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.1.12', '<=' ) ) {
    235             update_post_meta( $order->id, __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
     235            update_post_meta( $order->get_id(), __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
    236236        }
    237237
     
    306306
    307307        try {
    308             $payment_method_id = get_post_meta( $order->id, '_iugu_customer_payment_method_id', true );
     308            $payment_method_id = get_post_meta( $order->get_id(), '_iugu_customer_payment_method_id', true );
    309309
    310310            if ( ! $payment_method_id ) {
     
    324324            }
    325325
    326             update_post_meta( $order->id, '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
     326            update_post_meta( $order->get_id(), '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
    327327
    328328            // Save only in old versions.
    329329            if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.1.12', '<=' ) ) {
    330                 update_post_meta( $order->id, __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
     330                update_post_meta( $order->get_id(), __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
    331331            }
    332332
     
    383383            }
    384384
    385             woocommerce_get_template(
     385            wc_get_template(
    386386                'credit-card/payment-form.php',
    387387                array(
  • iugu-woocommerce/trunk/includes/class-wc-iugu-credit-card-addons-gateway.php

    r1446221 r1801300  
    6666            }
    6767
    68             $this->save_subscription_meta( $order->id, $payment_method_id );
     68            $this->save_subscription_meta( $order->get_id(), $payment_method_id );
    6969
    7070            $payment_response = $this->process_subscription_payment( $order, $order->get_total() );
     
    128128
    129129                // Save the payment method ID in order data.
    130                 update_post_meta( $order->id, '_iugu_customer_payment_method_id', $payment_method_id );
     130                update_post_meta( $order->get_id(), '_iugu_customer_payment_method_id', $payment_method_id );
    131131
    132132                // Reduce stock levels
     
    193193        // Also store it on the subscriptions being purchased in the order.
    194194        foreach( wcs_get_subscriptions_for_order( $order_id ) as $subscription ) {
    195             update_post_meta( $subscription->id, '_iugu_customer_payment_method_id', $payment_method_id );
     195            update_post_meta( $subscription->get_id(), '_iugu_customer_payment_method_id', $payment_method_id );
    196196        }
    197197    }
     
    217217        }
    218218
    219         $payment_method_id = get_post_meta( $order->id, '_iugu_customer_payment_method_id', true );
     219        $payment_method_id = get_post_meta( $order->get_id(), '_iugu_customer_payment_method_id', true );
    220220
    221221        if ( ! $payment_method_id ) {
     
    223223
    224224            if ( ! empty( $payment_method_id ) ) {
    225                 update_post_meta( $order->id, '_iugu_customer_payment_method_id', $payment_method_id );
     225                update_post_meta( $order->get_id(), '_iugu_customer_payment_method_id', $payment_method_id );
    226226            }
    227227        }
     
    243243        }
    244244
    245         update_post_meta( $order->id, '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
     245        update_post_meta( $order->get_id(), '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
    246246
    247247        // Save only in old versions.
    248248        if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.1.12', '<=' ) ) {
    249             update_post_meta( $order->id, __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
     249            update_post_meta( $order->get_id(), __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
    250250        }
    251251
     
    282282     */
    283283    public function update_failing_payment_method( $subscription, $renewal_order ) {
    284         update_post_meta( $subscription->id, '_iugu_customer_payment_method_id', get_post_meta( $renewal_order->id, '_iugu_customer_payment_method_id', true ) );
     284        update_post_meta( $subscription->get_id(), '_iugu_customer_payment_method_id', get_post_meta( $renewal_order->id, '_iugu_customer_payment_method_id', true ) );
    285285    }
    286286
     
    297297            'post_meta' => array(
    298298                '_iugu_customer_payment_method_id' => array(
    299                     'value' => get_post_meta( $subscription->id, '_iugu_customer_payment_method_id', true ),
     299                    'value' => get_post_meta( $subscription->get_id(), '_iugu_customer_payment_method_id', true ),
    300300                    'label' => 'Iugu Payment Method ID',
    301301                ),
     
    343343
    344344        try {
    345             $payment_method_id = get_post_meta( $order->id, '_iugu_customer_payment_method_id', true );
     345            $payment_method_id = get_post_meta( $order->get_id(), '_iugu_customer_payment_method_id', true );
    346346
    347347            if ( ! $payment_method_id ) {
     
    361361            }
    362362
    363             update_post_meta( $order->id, '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
     363            update_post_meta( $order->get_id(), '_transaction_id', sanitize_text_field( $charge['invoice_id'] ) );
    364364
    365365            // Save only in old versions.
    366366            if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.1.12', '<=' ) ) {
    367                 update_post_meta( $order->id, __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
     367                update_post_meta( $order->get_id(), __( 'Iugu Transaction details', 'iugu-woocommerce' ), 'https://iugu.com/a/invoices/' . sanitize_text_field( $charge['invoice_id'] ) );
    368368            }
    369369
     
    420420            }
    421421
    422             woocommerce_get_template(
     422            wc_get_template(
    423423                'credit-card/payment-form.php',
    424424                array(
  • iugu-woocommerce/trunk/includes/class-wc-iugu-credit-card-gateway.php

    r1781523 r1801300  
    369369            $data = $order->get_meta( '_iugu_wc_transaction_data' );
    370370        } else {
    371             if ( $sent_to_admin || ! $order->has_status( array( 'processing', 'on-hold' ) ) || $this->id !== $order->payment_method ) {
     371            if ( $sent_to_admin || ! $order->has_status( array( 'processing', 'on-hold' ) ) || $this->id !== $order->get_payment_method() ) {
    372372                return;
    373373            }
    374374
    375             $data = get_post_meta( $order->id, '_iugu_wc_transaction_data', true );
     375            $data = get_post_meta( $order->get_id(), '_iugu_wc_transaction_data', true );
    376376        }
    377377
  • iugu-woocommerce/trunk/includes/class-wc-iugu-my-account.php

    r1778845 r1801300  
    2727     */
    2828    public function legacy_my_orders_bank_slip_link( $actions, $order ) {
    29         if ( 'iugu-bank-slip' !== $order->payment_method ) {
     29        if ( 'iugu-bank-slip' !== $order->get_payment_method() ) {
    3030            return $actions;
    3131        }
     
    3535        }
    3636
    37         $data = get_post_meta( $order->id, '_iugu_wc_transaction_data', true );
     37        $data = get_post_meta( $order->get_id(), '_iugu_wc_transaction_data', true );
    3838        if ( ! empty( $data['pdf'] ) ) {
    3939            $actions[] = array(
  • iugu-woocommerce/trunk/iugu-woocommerce.php

    r1787546 r1801300  
    66 * Author: iugu
    77 * Author URI: https://iugu.com/
    8  * Version: 1.0.14
     8 * Version: 2.0.0
    99 * License: GPLv2 or later
    1010 * Text Domain: iugu-woocommerce
     
    2929     */
    3030    const CLIENT_NAME = 'plugin-iugu-woocommerce';
    31     const CLIENT_VERSION = '1.0.14';
     31    const CLIENT_VERSION = '2.0.0';
    3232
    3333    /**
     
    9191     */
    9292    private function includes() {
    93         include_once 'includes/utils/chromephp.php';
    9493        include_once 'includes/class-wc-iugu-api.php';
    9594        include_once 'includes/class-wc-iugu-bank-slip-gateway.php';
  • iugu-woocommerce/trunk/readme.txt

    r1787546 r1801300  
    44Requires at least: 3.9
    55Tested up to: 4.9
    6 Stable tag: 1.0.14
     6Stable tag: 2.0.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1818O **WooCommerce iugu** é compatível com:
    1919
    20 * [WooCommerce 2.1+](https://wordpress.org/plugins/woocommerce/)
     20* [WooCommerce 3.0+](https://wordpress.org/plugins/woocommerce/)
    2121* [WooCommerce Subscriptions](http://www.woothemes.com/products/woocommerce-subscriptions/): para pagamentos recorrentes/assinaturas.
    2222* [WooCommerce Pre-orders](http://www.woothemes.com/products/woocommerce-pre-orders/): para pré-venda de produtos.
     
    2626
    2727* [Wordpress v3.9 ou superior](https://wordpress.org).
    28 * [WooCommerce v2.1 ou superior](https://br.wordpress.org/plugins/woocommerce/).
     28* [WooCommerce v3.0 ou superior](https://br.wordpress.org/plugins/woocommerce/).
    2929* [WooCommerce Extra Checkout Fields for Brazil](https://br.wordpress.org/plugins/woocommerce-extra-checkout-fields-for-brazil/).
    3030* Conta ativa na [iugu](https://iugu.com/) com boleto bancário e/ou cartão de crédito habilitados como métodos de pagamento. Entenda [*O que é necessário para começar a usar iugu?*](https://support.iugu.com/hc/pt-br/articles/201531709).
     
    8989== Changelog ==
    9090
    91 = 1.0.14 =
    92 * **Melhoria**: Erros da API da iugu mais claros na página de checkout.
     91= 2.0.0 =
     92* Melhoria: Removidas as funções deprecadas do WooCommerce.
     93* Correção: Função responsável por identificar se o cliente é uma empresa não funcionava apropriadamente.
    9394
    94 = 1.0.13 - 2017/12/4 =
    95 * **Adição**: As chamadas de API da iugu agora recebem a versão do plugin utilizada para facilitar o debugging e o suporte.
    96 
    97 = 1.0.12 - 2017/11/30 =
    98 * **Correção**: Incluída dependência do plugin que estava em falta na versão 1.0.11. Obrigado, @diasnt!
    99 
    100 = 1.0.11 - 2017/11/29 =
    101 * **Melhoria**: Erros da API da iugu agora são exibidos na página do checkout em vez do antigo erro padrão de pagamento, que dizia muito sem dizer nada.
    102 * **Correção**: Plugin não enviava o *Bairro* do cliente, informação obrigatória para a criação de boletos registrados, impedindo a compra.
    103 
    104 = 1.0.10 - 2016/06/30 =
    105 * **Correção**: ID de pagamento das assinaturas de cartão de crédito.
    106 * **Melhoria**: Funcionamento para pessoa jurídica, enviando o nome da empresa.
    107 
    108 = 1.0.9 - 2016/06/18 =
    109 * **Correção**: Campo de número de telefone.
    110 
    111 = 1.0.8 - 2016/06/17 =
    112 * **Correção**: Suporte para WooCommerce 2.6+.
    113 * **Novidade**: Suporte para WooCommerce Subscriptions 2.0+.
    114 * **Correção**: Suporte para assinaturas.
    115 * **Correção** Exibição de CPF/CPNJ em boletos.
    116 
    117 = 1.0.7 - 2016/02/09 =
    118 * **Melhoria**: Geração das faturas, garantindo que sejam papgas apenas com cartão de crédito ou boleto, sem poder mudar a forma de pagamento.
    119 
    120 = 1.0.6 - 2015/05/01 =
    121 * **Melhoria**: Conversão de valores para centavos antes de enviá-los para a API da iugu.
    122 * **Melhoria**: Campo de "Nome impresso no cartão" do formulário de cartão de crédito.
    123 * **Correção**: Carregamento do JavaScript das opções de cartão de crédito quando instalado o WooCommerce Subscriptions.
    124 * **Correção**: HTML das instruções do cartão de crédito após o pagamento.
    125 
    126 = 1.0.5 - 2015/04/09 =
    127 * **Correção**: Opção de repasse de juros quando desativada.
    128 
    129 = 1.0.4 - 2015/03/25 =
    130 * **Correção**: Parcelas exibidas na versões 2.1.x do WooCommerce.
    131 
    132 = 1.0.3 - 2015/03/24 =
    133 * **Melhoria**: Fluxo de pagamento com cartão de crédito.
    134 * **Correção**: Mudança de status quando o cartão é recusado.
    135 * **Melhoria**: Opções padrões do plugin.
    136 * **Correção**: URLs das notificações.
    137 * **Melhoria**: Link de *Configurações* na página de plugins.
    138 
    139 = 1.0.2 - 2015/03/12 =
    140 * **Melhoria**: Renovação de assinaturas no WooCommerce Subscription.
    141 
    142 = 1.0.1 - 2015/03/08 =
    143 * **Adição**: Opção para configurar a taxa de transação que é utilizada no repasse de juros do parcelamento.
    144 
    145 = 1.0.0 - 2015/03/08 =
    146 * Lançamento da versão inicial.
     95Veja o [changelog completo no Github](https://github.com/iugu/iugu-woocommerce/wiki).
    14796
    14897
    14998== Upgrade Notice ==
    15099
    151 = 1.0.14 =
    152 Pequena atualização para melhorar o texto dos erros da API da iugu que podem surgir na página de checkout.
    153 
     100= 2.0.0 =
     101Removemos as funções obsoletas do WooCommerce para lançar uma versão _major_ (2.0.0) compatível apenas com o WooCommerce 3.0 ou superior. Portanto, atualize o seu plugin do WC se necessário.
    154102
    155103== Suporte ==
  • iugu-woocommerce/trunk/templates/credit-card/payment-form.php

    r1438809 r1801300  
    5353                    }
    5454                    ?>
    55                     <option value="<?php echo $i; ?>"><?php echo esc_attr( sprintf( __( '%dx of %s %s (Total: %s)', 'iugu-woocommerce' ), $i, sanitize_text_field( woocommerce_price( $installment_total ) ), $interest_text, sanitize_text_field( woocommerce_price( $total_to_pay ) ) ) ); ?></option>
     55                    <option value="<?php echo $i; ?>"><?php echo esc_attr( sprintf( __( '%dx of %s %s (Total: %s)', 'iugu-woocommerce' ), $i, sanitize_text_field( wc_price( $installment_total ) ), $interest_text, sanitize_text_field( wc_price( $total_to_pay ) ) ) ); ?></option>
    5656                <?php endfor; ?>
    5757            </select>
Note: See TracChangeset for help on using the changeset viewer.