Changeset 1801300
- Timestamp:
- 01/11/2018 05:00:53 PM (8 years ago)
- Location:
- iugu-woocommerce
- Files:
-
- 43 added
- 10 deleted
- 11 edited
-
tags/1.0.10 (deleted)
-
tags/1.0.2 (deleted)
-
tags/1.0.3 (deleted)
-
tags/1.0.4 (deleted)
-
tags/1.0.5 (deleted)
-
tags/1.0.6 (deleted)
-
tags/1.0.7 (deleted)
-
tags/1.0.8 (deleted)
-
tags/1.0.9 (deleted)
-
tags/2.0.0 (added)
-
tags/2.0.0/assets (added)
-
tags/2.0.0/assets/css (added)
-
tags/2.0.0/assets/css/credit-card.css (added)
-
tags/2.0.0/assets/css/credit-card.min.css (added)
-
tags/2.0.0/assets/js (added)
-
tags/2.0.0/assets/js/admin-credit-card.js (added)
-
tags/2.0.0/assets/js/admin-credit-card.min.js (added)
-
tags/2.0.0/assets/js/credit-card.js (added)
-
tags/2.0.0/assets/js/credit-card.min.js (added)
-
tags/2.0.0/includes (added)
-
tags/2.0.0/includes/class-wc-iugu-api.php (added)
-
tags/2.0.0/includes/class-wc-iugu-bank-slip-addons-gateway-deprecated.php (added)
-
tags/2.0.0/includes/class-wc-iugu-bank-slip-addons-gateway.php (added)
-
tags/2.0.0/includes/class-wc-iugu-bank-slip-gateway.php (added)
-
tags/2.0.0/includes/class-wc-iugu-credit-card-addons-gateway-deprecated.php (added)
-
tags/2.0.0/includes/class-wc-iugu-credit-card-addons-gateway.php (added)
-
tags/2.0.0/includes/class-wc-iugu-credit-card-gateway.php (added)
-
tags/2.0.0/includes/class-wc-iugu-my-account.php (added)
-
tags/2.0.0/includes/views (added)
-
tags/2.0.0/includes/views/html-admin-page.php (added)
-
tags/2.0.0/includes/views/html-notice-account-id-missing.php (added)
-
tags/2.0.0/includes/views/html-notice-api-token-missing.php (added)
-
tags/2.0.0/includes/views/html-notice-currency-not-supported.php (added)
-
tags/2.0.0/includes/views/html-notice-ecfb-missing.php (added)
-
tags/2.0.0/includes/views/html-notice-woocommerce-missing.php (added)
-
tags/2.0.0/iugu-woocommerce.php (added)
-
tags/2.0.0/languages (added)
-
tags/2.0.0/languages/iugu-woocommerce.pot (added)
-
tags/2.0.0/readme.txt (added)
-
tags/2.0.0/templates (added)
-
tags/2.0.0/templates/bank-slip (added)
-
tags/2.0.0/templates/bank-slip/checkout-instructions.php (added)
-
tags/2.0.0/templates/bank-slip/emails (added)
-
tags/2.0.0/templates/bank-slip/emails/html-instructions.php (added)
-
tags/2.0.0/templates/bank-slip/emails/plain-instructions.php (added)
-
tags/2.0.0/templates/bank-slip/payment-instructions.php (added)
-
tags/2.0.0/templates/credit-card (added)
-
tags/2.0.0/templates/credit-card/emails (added)
-
tags/2.0.0/templates/credit-card/emails/html-instructions.php (added)
-
tags/2.0.0/templates/credit-card/emails/plain-instructions.php (added)
-
tags/2.0.0/templates/credit-card/payment-form.php (added)
-
tags/2.0.0/templates/credit-card/payment-instructions.php (added)
-
trunk/includes/class-wc-iugu-api.php (modified) (11 diffs)
-
trunk/includes/class-wc-iugu-bank-slip-addons-gateway-deprecated.php (modified) (2 diffs)
-
trunk/includes/class-wc-iugu-bank-slip-addons-gateway.php (modified) (2 diffs)
-
trunk/includes/class-wc-iugu-bank-slip-gateway.php (modified) (4 diffs)
-
trunk/includes/class-wc-iugu-credit-card-addons-gateway-deprecated.php (modified) (8 diffs)
-
trunk/includes/class-wc-iugu-credit-card-addons-gateway.php (modified) (11 diffs)
-
trunk/includes/class-wc-iugu-credit-card-gateway.php (modified) (1 diff)
-
trunk/includes/class-wc-iugu-my-account.php (modified) (2 diffs)
-
trunk/includes/utils (deleted)
-
trunk/iugu-woocommerce.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/templates/credit-card/payment-form.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
iugu-woocommerce/trunk/includes/class-wc-iugu-api.php
r1787546 r1801300 120 120 $rate = isset( $this->gateway->transaction_rate ) ? $this->gateway->transaction_rate : 7; 121 121 122 return w oocommerce_format_decimal( $rate );122 return wc_format_decimal( $rate ); 123 123 } 124 124 … … 349 349 */ 350 350 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() ); 352 352 353 353 return array( … … 369 369 370 370 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' ) ); 377 377 } 378 378 } … … 390 390 protected function is_a_company( $order ) { 391 391 $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 ) { 394 395 return true; 395 396 } … … 420 421 $phone_number = $this->get_phone_number( $order ); 421 422 $data = array( 422 'email' => $order-> billing_email,423 'email' => $order->get_billing_email(), 423 424 'due_date' => $this->get_invoice_due_date(), 424 425 'return_url' => $this->gateway->get_return_url( $order ), … … 430 431 array( 431 432 'name' => 'order_id', 432 'value' => $order-> id433 'value' => $order->get_id() 433 434 ) 434 435 ), 435 436 'payer' => array( 436 'name' => $order-> billing_first_name . ' ' . $order->billing_last_name,437 'name' => $order->get_formatted_billing_full_name(), 437 438 'phone_prefix' => $phone_number['area_code'], 438 439 'phone' => $phone_number['number'], 439 'email' => $order-> billing_email,440 'email' => $order->get_billing_email(), 440 441 '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() ) 447 448 ) 448 449 ), … … 454 455 455 456 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' ); 461 462 } 462 463 … … 480 481 481 482 $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() ){ 485 486 $item_name .= ' - ' . $meta; 486 487 } … … 755 756 756 757 $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() ), 759 760 'set_as_default' => true 760 761 ); … … 909 910 ); 910 911 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'] ); 912 913 } else { 913 914 $payment_data = array_map( … … 919 920 } 920 921 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'] ) ); 923 924 924 925 // Save only in old versions. 925 926 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'] ) ); 927 928 } 928 929 -
iugu-woocommerce/trunk/includes/class-wc-iugu-bank-slip-addons-gateway-deprecated.php
r1778472 r1801300 162 162 ) 163 163 ); 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'] ) ); 167 167 168 168 // Save only in old versions. 169 169 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'] ) ); 171 171 } 172 172 … … 223 223 ) 224 224 ); 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'] ) ); 228 228 229 229 // Save only in old versions. 230 230 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'] ) ); 232 232 } 233 233 -
iugu-woocommerce/trunk/includes/class-wc-iugu-bank-slip-addons-gateway.php
r1778472 r1801300 166 166 ) 167 167 ); 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'] ) ); 171 171 172 172 // Save only in old versions. 173 173 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'] ) ); 175 175 } 176 176 … … 224 224 ) 225 225 ); 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'] ) ); 229 229 230 230 // Save only in old versions. 231 231 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'] ) ); 233 233 } 234 234 -
iugu-woocommerce/trunk/includes/class-wc-iugu-bank-slip-gateway.php
r1778472 r1801300 199 199 } 200 200 201 w oocommerce_get_template(201 wc_get_template( 202 202 'bank-slip/checkout-instructions.php', 203 203 array(), … … 229 229 230 230 if ( isset( $data['pdf'] ) ) { 231 w oocommerce_get_template(231 wc_get_template( 232 232 'bank-slip/payment-instructions.php', 233 233 array( … … 250 250 */ 251 251 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() ) { 253 253 return; 254 254 } 255 255 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 ); 257 257 258 258 if ( isset( $data['pdf'] ) ) { 259 259 if ( $plain_text ) { 260 w oocommerce_get_template(260 wc_get_template( 261 261 'bank-slip/emails/plain-instructions.php', 262 262 array( … … 267 267 ); 268 268 } else { 269 w oocommerce_get_template(269 wc_get_template( 270 270 'bank-slip/emails/html-instructions.php', 271 271 array( -
iugu-woocommerce/trunk/includes/class-wc-iugu-credit-card-addons-gateway-deprecated.php
r1438809 r1801300 69 69 70 70 // 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 ); 72 72 73 73 // Try to do an initial payment. … … 134 134 135 135 // 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 ); 137 137 138 138 // Reduce stock levels … … 200 200 } 201 201 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 ); 203 203 204 204 // TODO: It's a workaround. … … 209 209 210 210 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 ); 212 212 } 213 213 } … … 229 229 } 230 230 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'] ) ); 232 232 233 233 // Save only in old versions. 234 234 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'] ) ); 236 236 } 237 237 … … 306 306 307 307 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 ); 309 309 310 310 if ( ! $payment_method_id ) { … … 324 324 } 325 325 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'] ) ); 327 327 328 328 // Save only in old versions. 329 329 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'] ) ); 331 331 } 332 332 … … 383 383 } 384 384 385 w oocommerce_get_template(385 wc_get_template( 386 386 'credit-card/payment-form.php', 387 387 array( -
iugu-woocommerce/trunk/includes/class-wc-iugu-credit-card-addons-gateway.php
r1446221 r1801300 66 66 } 67 67 68 $this->save_subscription_meta( $order-> id, $payment_method_id );68 $this->save_subscription_meta( $order->get_id(), $payment_method_id ); 69 69 70 70 $payment_response = $this->process_subscription_payment( $order, $order->get_total() ); … … 128 128 129 129 // 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 ); 131 131 132 132 // Reduce stock levels … … 193 193 // Also store it on the subscriptions being purchased in the order. 194 194 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 ); 196 196 } 197 197 } … … 217 217 } 218 218 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 ); 220 220 221 221 if ( ! $payment_method_id ) { … … 223 223 224 224 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 ); 226 226 } 227 227 } … … 243 243 } 244 244 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'] ) ); 246 246 247 247 // Save only in old versions. 248 248 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'] ) ); 250 250 } 251 251 … … 282 282 */ 283 283 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 ) ); 285 285 } 286 286 … … 297 297 'post_meta' => array( 298 298 '_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 ), 300 300 'label' => 'Iugu Payment Method ID', 301 301 ), … … 343 343 344 344 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 ); 346 346 347 347 if ( ! $payment_method_id ) { … … 361 361 } 362 362 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'] ) ); 364 364 365 365 // Save only in old versions. 366 366 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'] ) ); 368 368 } 369 369 … … 420 420 } 421 421 422 w oocommerce_get_template(422 wc_get_template( 423 423 'credit-card/payment-form.php', 424 424 array( -
iugu-woocommerce/trunk/includes/class-wc-iugu-credit-card-gateway.php
r1781523 r1801300 369 369 $data = $order->get_meta( '_iugu_wc_transaction_data' ); 370 370 } 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() ) { 372 372 return; 373 373 } 374 374 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 ); 376 376 } 377 377 -
iugu-woocommerce/trunk/includes/class-wc-iugu-my-account.php
r1778845 r1801300 27 27 */ 28 28 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() ) { 30 30 return $actions; 31 31 } … … 35 35 } 36 36 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 ); 38 38 if ( ! empty( $data['pdf'] ) ) { 39 39 $actions[] = array( -
iugu-woocommerce/trunk/iugu-woocommerce.php
r1787546 r1801300 6 6 * Author: iugu 7 7 * Author URI: https://iugu.com/ 8 * Version: 1.0.148 * Version: 2.0.0 9 9 * License: GPLv2 or later 10 10 * Text Domain: iugu-woocommerce … … 29 29 */ 30 30 const CLIENT_NAME = 'plugin-iugu-woocommerce'; 31 const CLIENT_VERSION = ' 1.0.14';31 const CLIENT_VERSION = '2.0.0'; 32 32 33 33 /** … … 91 91 */ 92 92 private function includes() { 93 include_once 'includes/utils/chromephp.php';94 93 include_once 'includes/class-wc-iugu-api.php'; 95 94 include_once 'includes/class-wc-iugu-bank-slip-gateway.php'; -
iugu-woocommerce/trunk/readme.txt
r1787546 r1801300 4 4 Requires at least: 3.9 5 5 Tested up to: 4.9 6 Stable tag: 1.0.146 Stable tag: 2.0.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 18 18 O **WooCommerce iugu** é compatível com: 19 19 20 * [WooCommerce 2.1+](https://wordpress.org/plugins/woocommerce/)20 * [WooCommerce 3.0+](https://wordpress.org/plugins/woocommerce/) 21 21 * [WooCommerce Subscriptions](http://www.woothemes.com/products/woocommerce-subscriptions/): para pagamentos recorrentes/assinaturas. 22 22 * [WooCommerce Pre-orders](http://www.woothemes.com/products/woocommerce-pre-orders/): para pré-venda de produtos. … … 26 26 27 27 * [Wordpress v3.9 ou superior](https://wordpress.org). 28 * [WooCommerce v 2.1ou superior](https://br.wordpress.org/plugins/woocommerce/).28 * [WooCommerce v3.0 ou superior](https://br.wordpress.org/plugins/woocommerce/). 29 29 * [WooCommerce Extra Checkout Fields for Brazil](https://br.wordpress.org/plugins/woocommerce-extra-checkout-fields-for-brazil/). 30 30 * 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). … … 89 89 == Changelog == 90 90 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. 93 94 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. 95 Veja o [changelog completo no Github](https://github.com/iugu/iugu-woocommerce/wiki). 147 96 148 97 149 98 == Upgrade Notice == 150 99 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 = 101 Removemos 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. 154 102 155 103 == Suporte == -
iugu-woocommerce/trunk/templates/credit-card/payment-form.php
r1438809 r1801300 53 53 } 54 54 ?> 55 <option value="<?php echo $i; ?>"><?php echo esc_attr( sprintf( __( '%dx of %s %s (Total: %s)', 'iugu-woocommerce' ), $i, sanitize_text_field( w oocommerce_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> 56 56 <?php endfor; ?> 57 57 </select>
Note: See TracChangeset
for help on using the changeset viewer.