Changeset 1977545
- Timestamp:
- 11/20/2018 04:26:22 PM (7 years ago)
- Location:
- woo-businesspay/trunk
- Files:
-
- 8 added
- 8 edited
-
assets/css/index.php (added)
-
assets/img/index.php (added)
-
assets/index.php (added)
-
assets/js/index.php (added)
-
includes/index.php (added)
-
includes/woocommerce-businesspay-gateway.php (modified) (43 diffs)
-
index.php (added)
-
languages/index.php (added)
-
languages/woocommerce-businesspay-pt_BR.mo (modified) (previous)
-
languages/woocommerce-businesspay-pt_BR.po (modified) (10 diffs)
-
languages/woocommerce-businesspay.pot (modified) (7 diffs)
-
readme.txt (modified) (4 diffs)
-
templates/businesspay-panel-antifraud.php (modified) (3 diffs)
-
templates/businesspay-panel-gateway.php (modified) (1 diff)
-
templates/index.php (added)
-
woocommerce-businesspay.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-businesspay/trunk/includes/woocommerce-businesspay-gateway.php
r1969509 r1977545 12 12 $installment_minimum_value, $billet_logo_url, $billet_number_days, $billet_instruction_1, $sandbox, $debug, 13 13 $authority, $auth_id, $auth_last, $auth_next, $auth_interval, $auth_vendor_id, $enable_client, $enable_install, 14 $antifraud_entity_code_demo, $antifraud_entity_code_live, $antifraud_app_id_demo, $antifraud_app_id_live, 15 $auth_api, $auth_scope, $auth_version, $auth_schema, $auth_gateway, $auth_validate, $auth_summary, 16 $default_session_interval, $default_billet_expiration_days, $logger; 14 $antifraud_product_id, $antifraud_login_demo, $antifraud_login_live, $antifraud_password_demo, 15 $antifraud_password_live, $antifraud_app_id_demo, $antifraud_app_id_live, $antifraud_auth_token, 16 $antifraud_auth_expiration, $auth_api, $auth_scope, $auth_version, $auth_schema, $auth_gateway, $auth_validate, 17 $auth_summary, $default_session_interval, $default_billet_expiration_days, $logger; 17 18 18 19 public … … 32 33 $this->gateway_live_version = 'v1'; 33 34 $this->antifraud_demo_url = 'https://homologacao.clearsale.com.br'; 34 $this->antifraud_live_url = 'https:// integracao.clearsale.com.br';35 $this->antifraud_demo_version = 'v 2';36 $this->antifraud_live_version = ' ';35 $this->antifraud_live_url = 'https://api.clearsale.com.br'; 36 $this->antifraud_demo_version = 'v1'; 37 $this->antifraud_live_version = 'v1'; 37 38 38 39 $this->init_form_fields(); … … 72 73 73 74 //Auth 74 $this->auth_id = get_option( 'businesspay_auth_id' ); 75 $this->auth_vendor_id = '1'; 76 $this->enable_client = get_option( 'businesspay_enable_client' ); 77 $this->enable_install = get_option( 'businesspay_enable_install' ); 78 $this->enable_antifraud = get_option( 'businesspay_enable_antifraud' ); 79 $this->antifraud_entity_code_demo = get_option( 'businesspay_antifraud_entity_code_demo' ); 80 $this->antifraud_entity_code_live = get_option( 'businesspay_antifraud_entity_code_live' ); 81 $this->antifraud_app_id_demo = get_option( 'businesspay_antifraud_app_id_demo' ); 82 $this->antifraud_app_id_live = get_option( 'businesspay_antifraud_app_id_live' ); 83 $this->default_session_interval = '12'; 75 $this->auth_id = get_option( 'businesspay_auth_id' ); 76 $this->auth_vendor_id = '1'; 77 $this->enable_client = get_option( 'businesspay_enable_client' ); 78 $this->enable_install = get_option( 'businesspay_enable_install' ); 79 $this->enable_antifraud = get_option( 'businesspay_enable_antifraud' ); 80 $this->antifraud_product_id = get_option( 'businesspay_antifraud_product_id' ); 81 $this->antifraud_login_demo = get_option( 'businesspay_antifraud_login_demo' ); 82 $this->antifraud_login_live = get_option( 'businesspay_antifraud_login_live' ); 83 $this->antifraud_password_demo = get_option( 'businesspay_antifraud_password_demo' ); 84 $this->antifraud_password_live = get_option( 'businesspay_antifraud_password_live' ); 85 $this->antifraud_app_id_demo = get_option( 'businesspay_antifraud_app_id_demo' ); 86 $this->antifraud_app_id_live = get_option( 'businesspay_antifraud_app_id_live' ); 87 $this->antifraud_auth_token = get_option( 'businesspay_antifraud_auth_token' ); 88 $this->antifraud_auth_expiration = get_option( 'businesspay_antifraud_auth_expiration' ); 89 $this->default_session_interval = '12'; 84 90 85 91 $this->auth_api = 'wp-json'; … … 93 99 94 100 //Actions 95 add_action( 'woocommerce_api_wc_' . $this->id, array( $this, ' gateway_callback' ) );101 add_action( 'woocommerce_api_wc_' . $this->id, array( $this, 'webhook_callback' ) ); 96 102 add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( 97 103 $this, … … 157 163 $install_str = ( $this->enable_install ) ? $icon_ok . esc_html__( 'Installation Enabled', 'woocommerce-businesspay' ) : $icon_nok . esc_html__( 'Installation Disabled', 'woocommerce-businesspay' ); 158 164 $antifraud_str = ( $this->enable_antifraud ) ? $icon_ok . esc_html__( 'Antifraud Enabled', 'woocommerce-businesspay' ) : $icon_nok . esc_html__( 'Antifraud Disabled', 'woocommerce-businesspay' ); 165 $product_str = ( ! empty( $this->antifraud_product_id ) ) ? $icon_ok . $this->get_antifraud_order_product_name() : $icon_nok . esc_html__( 'Product not configured', 'woocommerce-businesspay' ); 159 166 160 167 $client_title = esc_html__( 'Client Account:', 'woocommerce-businesspay' ); 161 168 $install_title = esc_html__( 'Client Installation:', 'woocommerce-businesspay' ); 162 169 $antifraud_title = esc_html__( 'Client Antifraud:', 'woocommerce-businesspay' ); 170 $product_title = esc_html__( 'Antifraud Product:', 'woocommerce-businesspay' ); 163 171 164 172 $html_row_str = sprintf( $html_row, $client_title, $client_str, $client_str ); 165 173 $html_row_str .= sprintf( $html_row, $install_title, $install_str, $install_str ); 166 174 $html_row_str .= sprintf( $html_row, $antifraud_title, $antifraud_str, $antifraud_str ); 175 176 if ( $this->enable_antifraud ) { 177 $html_row_str .= sprintf( $html_row, $product_title, $product_str, $product_str ); 178 } 167 179 168 180 echo $html_table_start . $html_row_str . $html_table_end; … … 212 224 'title' => esc_html__( 'Authentication API', 'woocommerce-businesspay' ), 213 225 'description' => esc_html__( 'Use your BusinessPay Authentication API', 'woocommerce-businesspay' ), 214 'default' => ' ',226 'default' => 'BUSINESSPAY', 215 227 'custom_attributes' => array( 'required' => 'required' ), 216 228 'desc_tip' => true, … … 220 232 'title' => esc_html__( 'Authentication Key', 'woocommerce-businesspay' ), 221 233 'description' => esc_html__( 'Use your BusinessPay Authentication Key', 'woocommerce-businesspay' ), 222 'default' => ' ',234 'default' => 'FECE839A97AFC57D88B2', 223 235 'custom_attributes' => array( 'required' => 'required' ), 224 236 'desc_tip' => true, … … 375 387 'description' => esc_html__( 'Enable BusinessPay Sandbox', 'woocommerce-businesspay' ), 376 388 'class' => 'wc-bp-sandbox', 377 'default' => ' no',389 'default' => 'yes', 378 390 'desc_tip' => true, 379 391 ), … … 406 418 case 'card': 407 419 //Number 408 $number = str_replace( ' ', '', $this->get_gateway_ card_number( $fields ) );420 $number = str_replace( ' ', '', $this->get_gateway_payment_card_info_number( $fields ) ); 409 421 if ( strlen( $number ) < 15 ) { 410 422 ++ $error_num; … … 419 431 420 432 //Name 421 $name = trim( $this->get_gateway_ card_holder_name( $fields ) );433 $name = trim( $this->get_gateway_payment_card_info_holder_name( $fields ) ); 422 434 if ( strlen( $name ) < 6 ) { 423 435 ++ $error_num; … … 432 444 433 445 //Expiry 434 $temp_date = explode( '/', $this->get_gateway_ card_expiry( $fields ) );446 $temp_date = explode( '/', $this->get_gateway_payment_card_info_expiry( $fields ) ); 435 447 $bp_expiry_month = trim( $temp_date[0] ); 436 448 $bp_expire_year = trim( $temp_date[1] ); … … 451 463 452 464 //CVC 453 $bp_cvc = $this->get_gateway_ card_cvv( $fields );465 $bp_cvc = $this->get_gateway_payment_card_info_cvv( $fields ); 454 466 if ( strlen( $bp_cvc ) < 3 ) { 455 467 ++ $error_num; … … 464 476 465 477 //Installments 466 $bp_installments = $this->get_gateway_ card_installments( $fields );478 $bp_installments = $this->get_gateway_payment_card_installments( $fields ); 467 479 if ( $bp_installments == '0' ) { 468 480 ++ $error_num; … … 471 483 472 484 //Document 473 $bp_doc = str_replace( array( '.', '-', '/' ), '', $this->get_gateway_card_document( $fields ) ); 485 $bp_doc = str_replace( array( 486 '.', 487 '-', 488 '/' 489 ), '', $this->get_gateway_payment_card_document( $fields ) ); 474 490 if ( strlen( $bp_doc ) != 11 && strlen( $bp_doc ) != 14 ) { 475 491 ++ $error_num; … … 488 504 break; 489 505 case 'transfer': 490 $bp_transf = $this->get_gateway_ transfer_bank( $fields );506 $bp_transf = $this->get_gateway_payment_transfer_provider( $fields ); 491 507 if ( $bp_transf == '' ) { 492 508 ++ $error_num; … … 501 517 break; 502 518 case 'billet': 503 $bp_billet = $this->get_gateway_ billet_bank( $fields );519 $bp_billet = $this->get_gateway_payment_billet_provider( $fields ); 504 520 if ( $bp_billet == '' ) { 505 521 ++ $error_num; … … 525 541 if ( $this->validate_fields() ) { 526 542 try { 527 $order = new WC_Order( $order_id ); 528 $payment_type = $this->get_gateway_selected_tab( $fields ); 529 switch ( $payment_type ) { 530 case 'card': 531 if ( $this->get_gateway_card_installments( $fields ) == 'debit' ) { 532 $order->set_payment_method_title( esc_html__( 'BusinessPay | Debit Card', 'woocommerce-businesspay' ) ); 533 $response = $this->gateway_authorization_debit( $order ); 534 } else { 535 $order->set_payment_method_title( esc_html__( 'BusinessPay | Credit Card', 'woocommerce-businesspay' ) ); 536 $response = $this->gateway_authorization_credit( $order ); 537 } 538 break; 539 case 'transfer': 540 $order->set_payment_method_title( esc_html__( 'BusinessPay | Bank Transfer', 'woocommerce-businesspay' ) ); 541 $response = $this->gateway_transaction_transfer( $order ); 542 break; 543 case 'billet': 544 $order->set_payment_method_title( esc_html__( 'BusinessPay | Billet', 'woocommerce-businesspay' ) ); 545 $response = $this->gateway_transaction_billet( $order ); 546 break; 547 default: 548 $response = $result; 549 break; 550 } 543 $order = new WC_Order( $order_id ); 544 $method = $this->get_gateway_selected_method( $fields ); 545 if ( $method == 'debit' ) { 546 $order->set_payment_method_title( esc_html__( 'BusinessPay | Debit Card', 'woocommerce-businesspay' ) ); 547 } elseif ( $method == 'credit' ) { 548 $order->set_payment_method_title( esc_html__( 'BusinessPay | Credit Card', 'woocommerce-businesspay' ) ); 549 } elseif ( $method == 'transfer' ) { 550 $order->set_payment_method_title( esc_html__( 'BusinessPay | Bank Transfer', 'woocommerce-businesspay' ) ); 551 } elseif ( $method == 'billet' ) { 552 $order->set_payment_method_title( esc_html__( 'BusinessPay | Billet', 'woocommerce-businesspay' ) ); 553 } 554 555 $response = $this->gateway_do_authorization( $order, $method ); 551 556 if ( $response['result'] == 'success' ) { 552 557 WC()->cart->empty_cart(); 553 558 $result = $response; 554 559 } else { 555 $ order->update_status('failed', $response['messages'] );560 $this->update_order_status( $order, 'failed', $response['messages'] ); 556 561 wc_add_notice( $response['messages'], 'error' ); 557 562 } … … 565 570 566 571 567 // TRANSACTIONS568 569 private function gateway_ transaction_transfer( $order) {572 //GATEWAY CALLS 573 574 private function gateway_do_authorization( $order, $method ) { 570 575 $result = array( 'result' => 'failure', 'messages' => '' ); 571 576 $fields = $_POST; 572 577 try { 573 $provider = $this->get_gateway_transfer_bank( $fields ); 574 $postback_url = $this->get_postback_url(); 575 576 $body = array( 577 'referenceId' => $this->get_order_id( $order ), 578 'amount' => str_replace( '.', '', $order->order_total ), 579 'description' => esc_html__( 'Woocommerce Order', 'woocommerce-businesspay' ), 580 'postBackUrl' => $postback_url, 581 'customer' => array( 582 'name' => $this->get_gateway_customer_name( $fields ), 583 'document' => $this->get_gateway_customer_document( $fields ), 584 'email' => $this->get_gateway_customer_email( $fields ), 585 'address' => array( 586 'address' => $this->get_gateway_customer_address( $fields ), 587 'number' => $this->get_gateway_customer_address_number( $fields ), 588 'complement' => $this->get_gateway_customer_address_complement( $fields ), 589 'district' => $this->get_gateway_customer_address_district( $fields ), 590 'zipcode' => $this->get_gateway_customer_address_zipcode( $fields ), 591 'city' => $this->get_gateway_customer_address_city( $fields ), 592 'state' => $this->get_gateway_customer_address_state( $fields ) 578 $body = ''; 579 if ( $method == 'debit' || $method == 'credit' ) { 580 $body = array( 581 'referenceId' => $this->get_gateway_order_reference_id( $order ), 582 'amount' => $this->get_gateway_order_amount( $order ), 583 'description' => $this->get_gateway_order_description(), 584 'postBackUrl' => $this->get_gateway_order_postback_url(), 585 'customer' => array( 586 'name' => $this->get_gateway_customer_name( $fields ), 587 'document' => $this->get_gateway_customer_document( $fields ), 588 ), 589 'payment' => array( 590 'card' => array( 591 'type' => $this->get_gateway_payment_type( $fields ), 592 'capture' => $this->get_gateway_payment_card_capture(), 593 'installments' => $this->get_gateway_payment_card_installments( $fields ), 594 'interestType' => $this->get_gateway_payment_card_interest_type(), 595 'authenticate' => $this->get_gateway_payment_card_authenticate(), 596 'saveCard' => $this->get_gateway_payment_card_save(), 597 'recurrent' => $this->get_gateway_payment_card_recurrent(), 598 'softDescriptor' => $this->get_gateway_payment_card_soft_descriptor(), 599 'cardInfo' => array( 600 'number' => $this->get_gateway_payment_card_info_number( $fields ), 601 'expirationMonth' => $this->get_gateway_payment_card_info_expiry_month( $fields ), 602 'expirationYear' => $this->get_gateway_payment_card_info_expiry_year( $fields ), 603 'cvv' => $this->get_gateway_payment_card_info_cvv( $fields ), 604 'brand' => $this->get_gateway_payment_card_info_brand( $fields ), 605 'holderName' => $this->get_gateway_payment_card_info_holder_name( $fields ), 606 ) 607 ) 593 608 ) 594 ), 595 'payment' => array( 596 'electronicTransfer' => array( 597 'provider' => $provider 609 ); 610 } elseif ( $method == 'transfer' ) { 611 $body = array( 612 'referenceId' => $this->get_gateway_order_reference_id( $order ), 613 'amount' => $this->get_gateway_order_amount( $order ), 614 'description' => $this->get_gateway_order_description(), 615 'postBackUrl' => $this->get_gateway_order_postback_url(), 616 'customer' => array( 617 'name' => $this->get_gateway_customer_name( $fields ), 618 'document' => $this->get_gateway_customer_document( $fields ), 619 'email' => $this->get_gateway_customer_email( $fields ), 620 'address' => array( 621 'address' => $this->get_gateway_customer_address( $fields ), 622 'number' => $this->get_gateway_customer_address_number( $fields ), 623 'complement' => $this->get_gateway_customer_address_complement( $fields ), 624 'district' => $this->get_gateway_customer_address_district( $fields ), 625 'zipcode' => $this->get_gateway_customer_address_zipcode( $fields ), 626 'city' => $this->get_gateway_customer_address_city( $fields ), 627 'state' => $this->get_gateway_customer_address_state( $fields ) 628 ) 629 ), 630 'payment' => array( 631 'electronicTransfer' => array( 632 'provider' => $this->get_gateway_payment_transfer_provider( $fields ) 633 ) 598 634 ) 599 ) 600 ); 635 ); 636 } elseif ( $method == 'billet' ) { 637 $body = array( 638 'referenceId' => $this->get_gateway_order_reference_id( $order ), 639 'amount' => $this->get_gateway_order_amount( $order ), 640 'description' => $this->get_gateway_order_description(), 641 'postBackUrl' => $this->get_gateway_order_postback_url(), 642 'customer' => array( 643 'name' => $this->get_gateway_customer_name( $fields ), 644 'document' => $this->get_gateway_customer_document( $fields ), 645 'email' => $this->get_gateway_customer_email( $fields ), 646 'address' => array( 647 'address' => $this->get_gateway_customer_address( $fields ), 648 'number' => $this->get_gateway_customer_address_number( $fields ), 649 'complement' => $this->get_gateway_customer_address_complement( $fields ), 650 'district' => $this->get_gateway_customer_address_district( $fields ), 651 'zipcode' => $this->get_gateway_customer_address_zipcode( $fields ), 652 'city' => $this->get_gateway_customer_address_city( $fields ), 653 'state' => $this->get_gateway_customer_address_state( $fields ) 654 ) 655 ), 656 'payment' => array( 657 'bankSlip' => array( 658 'expirationDate' => $this->get_gateway_payment_billet_expiration_date(), 659 'instructions' => $this->get_gateway_payment_billet_instruction(), 660 'guarantor' => $this->get_gateway_payment_billet_guarantor(), 661 'provider' => $this->get_gateway_payment_billet_provider( $fields ) 662 ) 663 ) 664 ); 665 } 666 601 667 $response = $this->gateway_api_request( 'POST', '/transactions', $body ); 602 668 669 if ( ! isset( $response->result ) ) { 670 $this->gateway_insert_order_metadata( $order, $response ); 671 $res_status = $this->gateway_insert_order_status( $order, $response ); 672 673 if ( $res_status['result'] == 'success' ) { 674 $this->antifraud_maybe_do_analysis( $order, $response ); 675 } 676 $result = $res_status; 677 } 678 } catch ( Exception $e ) { 679 $this->logger( 'Gateway Authorization Error', $e->getMessage() ); 680 } 681 682 return $result; 683 } 684 685 private function gateway_do_capture( $order ) { 686 $result = array( 'result' => 'failure', 'messages' => '' ); 687 try { 688 $order_id = $this->get_order_id( $order ); 689 $transaction_id = get_post_meta( $order_id, '_businesspay-transaction-id', true ); 690 $body = array( 'transactionId' => $transaction_id ); 691 692 $response = $this->gateway_api_request( 'PUT', '/transactions/' . $transaction_id . '/capture', $body ); 603 693 if ( ! isset( $response->result ) ) { 604 694 $this->gateway_insert_order_metadata( $order, $response ); … … 606 696 } 607 697 } catch ( Exception $e ) { 608 $this->logger( 'Gateway A uthorizationError', $e->getMessage() );698 $this->logger( 'Gateway API Consult Status Error', $e->getMessage() ); 609 699 } 610 700 611 701 return $result; 612 702 } 613 614 private function gateway_transaction_billet( $order ) {615 $result = array( 'result' => 'failure', 'messages' => '' );616 $fields = $_POST;617 try {618 $provider = $this->get_gateway_billet_bank( $fields );619 $postback_url = $this->get_postback_url();620 621 $expirate = $this->get_billet_expiration( $this->billet_number_days );622 623 $body = array(624 'referenceId' => $this->get_order_id( $order ),625 'amount' => str_replace( '.', '', $order->order_total ),626 'description' => esc_html__( 'Woocommerce Order', 'woocommerce-businesspay' ),627 'postBackUrl' => $postback_url,628 'customer' => array(629 'name' => $this->get_gateway_customer_name( $fields ),630 'document' => $this->get_gateway_customer_document( $fields ),631 'email' => $this->get_gateway_customer_email( $fields ),632 'address' => array(633 'address' => $this->get_gateway_customer_address( $fields ),634 'number' => $this->get_gateway_customer_address_number( $fields ),635 'complement' => $this->get_gateway_customer_address_complement( $fields ),636 'district' => $this->get_gateway_customer_address_district( $fields ),637 'zipcode' => $this->get_gateway_customer_address_zipcode( $fields ),638 'city' => $this->get_gateway_customer_address_city( $fields ),639 'state' => $this->get_gateway_customer_address_state( $fields )640 )641 ),642 'payment' => array(643 'bankSlip' => array(644 'expirationDate' => $expirate->format( 'Y-m-d' ),645 'instructions' => $this->billet_instruction_1,646 'guarantor' => 'Comprador',647 'provider' => $provider648 )649 )650 );651 652 $response = $this->gateway_api_request( 'POST', '/transactions', $body );653 654 if ( ! isset( $response->result ) ) {655 $this->gateway_insert_order_metadata( $order, $response );656 $result = $this->gateway_insert_order_status( $order, $response );657 }658 } catch ( Exception $e ) {659 $this->logger( 'Gateway Authorization Error', $e->getMessage() );660 }661 662 return $result;663 }664 665 666 //AUTHORIZATIONS667 668 private function gateway_authorization_debit( $order ) {669 $result = array( 'result' => 'failure', 'messages' => '' );670 $fields = $_POST;671 try {672 $body = array(673 'referenceId' => $this->get_order_id( $order ),674 'amount' => str_replace( '.', '', $order->order_total ),675 'description' => esc_html__( 'Woocommerce Order', 'woocommerce-businesspay' ),676 'postBackUrl' => $this->get_postback_url(),677 'customer' => array(678 'name' => $this->get_gateway_card_holder_name( $fields ),679 'document' => $this->get_gateway_card_document( $fields ),680 ),681 'payment' => array(682 'card' => array(683 'type' => 2,684 //1: Crédito. 2: Débito685 'capture' => $this->enable_antifraud ? 'false' : 'true',686 'installments' => 1,687 'interestType' => 3,688 //3: Parcelado loja. 4: Parcelado Administrador689 'authenticate' => 1,690 //1: Somente transações autenticadas. 2: Autenticadas e não autenticadas. 3: Autorizar sem autenticação.691 'saveCard' => 'false',692 'recurrent' => 'false',693 'softDescriptor' => $this->name_in_invoice,694 'cardInfo' => array(695 'number' => $this->get_gateway_card_number( $fields ),696 'expirationMonth' => $this->get_gateway_card_expiry_month( $fields ),697 'expirationYear' => $this->get_gateway_card_expiry_year( $fields ),698 'cvv' => $this->get_gateway_card_cvv( $fields ),699 'brand' => $this->get_brand_name( $this->get_gateway_card_brand( $fields ) ),700 'holderName' => $this->get_gateway_card_holder_name( $fields ),701 )702 )703 )704 );705 706 $response = $this->gateway_api_request( 'POST', '/transactions', $body );707 if ( ! isset( $response->result ) ) {708 $this->gateway_insert_order_metadata( $order, $response );709 $response = $this->gateway_insert_order_status( $order, $response );710 $this->logger( 'Gateway Authorization DEBIT | result', $response );711 712 if ( $this->enable_antifraud && $response['result'] == 'success' ) {713 $this->antifraud_authorization_card( $order );714 }715 $result = $response;716 }717 } catch ( Exception $e ) {718 $this->logger( 'Gateway Authorization Error', $e->getMessage() );719 }720 721 return $result;722 }723 724 private function gateway_authorization_credit( $order ) {725 $result = array( 'result' => 'failure', 'messages' => '' );726 $fields = $_POST;727 try {728 $body = array(729 'referenceId' => $this->get_order_id( $order ),730 'amount' => str_replace( '.', '', $order->order_total ),731 'description' => esc_html__( 'Woocommerce Order', 'woocommerce-businesspay' ),732 'postBackUrl' => $this->get_postback_url(),733 'customer' => array(734 'name' => $this->get_gateway_card_holder_name( $fields ),735 'document' => $this->get_gateway_card_document( $fields ),736 ),737 'payment' => array(738 'card' => array(739 'type' => 1,740 //1: Crédito. 2: Débito741 'capture' => $this->enable_antifraud ? 'false' : 'true',742 'installments' => $this->get_gateway_card_installments( $fields ),743 'interestType' => 3,744 //3: Parcelado loja. 4: Parcelado Administrador745 'authenticate' => 3,746 //1: Somente transações autenticadas. 2: Autenticadas e não autenticadas. 3: Autorizar sem autenticação.747 'saveCard' => 'false',748 'recurrent' => 'false',749 'softDescriptor' => $this->name_in_invoice,750 'cardInfo' => array(751 'number' => $this->get_gateway_card_number( $fields ),752 'expirationMonth' => $this->get_gateway_card_expiry_month( $fields ),753 'expirationYear' => $this->get_gateway_card_expiry_year( $fields ),754 'cvv' => $this->get_gateway_card_cvv( $fields ),755 'brand' => $this->get_brand_name( $this->get_gateway_card_brand( $fields ) ),756 'holderName' => $this->get_gateway_card_holder_name( $fields ),757 )758 )759 )760 );761 762 $response = $this->gateway_api_request( 'POST', '/transactions', $body );763 if ( ! isset( $response->result ) ) {764 $this->gateway_insert_order_metadata( $order, $response );765 $response = $this->gateway_insert_order_status( $order, $response );766 $this->logger( 'Gateway Authorization CREDIT | result', $response );767 768 if ( $this->enable_antifraud && $response['result'] == 'success' ) {769 $this->antifraud_authorization_card( $order );770 }771 $result = $response;772 }773 } catch ( Exception $e ) {774 $this->logger( 'Gateway Authorization Error', $e->getMessage() );775 }776 777 return $result;778 }779 780 private function antifraud_authorization_card( $order ) {781 $result = array( 'result' => 'failure', 'messages' => '' );782 $do_retry = true;783 $retry_num = 0;784 while ( $retry_num < 3 && $do_retry ) {785 $retry_num ++;786 try {787 $xml = new DOMDocument( '1.0', 'utf-8' );788 $body = $xml->appendChild( $xml->createElement( 'ClearSale' ) );789 $af_orders = $body->appendChild( $xml->createElement( 'Orders' ) );790 $af_order = $af_orders->appendChild( $xml->createElement( 'Order' ) );791 792 //ORDER793 $af_order->appendChild( $xml->createElement( 'ID' ) )->appendChild( $xml->createTextNode( $this->get_order_id( $order ) ) );794 $af_order->appendChild( $xml->createElement( 'FingerPrint' ) )->appendChild( $xml->createElement( 'SessionID' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_order_fingerprint() ) );795 $af_order->appendChild( $xml->createElement( 'Date' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_order_date( $order ) ) );796 $af_order->appendChild( $xml->createElement( 'Email' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_order_email( $order ) ) );797 //$af_order->appendChild($xml->createElement('B2B_B2C'))->appendChild($xml->createTextNode('B2C'));798 $af_order->appendChild( $xml->createElement( 'ShippingPrice' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_order_shipping_price( $order ) ) );799 $af_order->appendChild( $xml->createElement( 'TotalItems' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_order_total_items( $order ) ) );800 $af_order->appendChild( $xml->createElement( 'TotalOrder' ) )->appendChild( $xml->createTextNode( $this->get_total_order( $order ) ) );801 $af_order->appendChild( $xml->createElement( 'QtyInstallments' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_order_qtd_installments( $order ) ) );802 //$af_order->appendChild($xml->createElement('DeliveryTimeCD'))->appendChild($xml->createTextNode(''));803 $af_order->appendChild( $xml->createElement( 'IP' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_order_ip( $order ) ) );804 //$af_order->appendChild($xml->createElement('ShippingType'))->appendChild($xml->createTextNode(''));805 //$af_order->appendChild($xml->createElement('Gift'))->appendChild($xml->createTextNode('0'));806 //$af_order->appendChild($xml->createElement('GiftMessage'))->appendChild($xml->createTextNode(''));807 $af_order->appendChild( $xml->createElement( 'Obs' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_order_obs( $order ) ) );808 $af_order->appendChild( $xml->createElement( 'Status' ) )->appendChild( $xml->createTextNode( '0' ) );809 $af_order->appendChild( $xml->createElement( 'Reanalise' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_order_reanalyze( $order ) ) );810 //$af_order->appendChild($xml->createElement('SlaCustom'))->appendChild($xml->createTextNode(''));811 $af_order->appendChild( $xml->createElement( 'Origin' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_install_origin() ) );812 $af_order->appendChild( $xml->createElement( 'ChannelID' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_install_channel_id() ) );813 //$af_order->appendChild($xml->createElement('ReservationDate'))->appendChild($xml->createTextNode(''));814 //$af_order->appendChild($xml->createElement('Nationality'))->appendChild($xml->createTextNode(''));815 //$af_order->appendChild($xml->createElement('Product'))->appendChild($xml->createTextNode('4'));816 //$af_order->appendChild($xml->createElement('ListTypeID'))->appendChild($xml->createTextNode('1'));817 //$af_order->appendChild($xml->createElement('ListID'))->appendChild($xml->createTextNode(''));818 819 //BILLING820 $af_billing_data = $af_order->appendChild( $xml->createElement( 'BillingData' ) );821 //$af_billing_data->appendChild($xml->createElement('ID'))->appendChild($xml->createTextNode(''));822 $af_billing_data->appendChild( $xml->createElement( 'Type' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_person_type( $order ) ) );823 $af_billing_data->appendChild( $xml->createElement( 'LegalDocument1' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_document( $order ) ) );824 //$af_billing_data->appendChild($xml->createElement('LegalDocument2'))->appendChild($xml->createTextNode(''));825 $af_billing_data->appendChild( $xml->createElement( 'Name' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_name( $order ) ) );826 //$af_billing_data->appendChild($xml->createElement('BirthDate'))->appendChild($xml->createTextNode(''));827 $af_billing_data->appendChild( $xml->createElement( 'Email' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_email( $order ) ) );828 //$af_billing_data->appendChild($xml->createElement('Gender'))->appendChild($xml->createTextNode(''));829 830 $af_billing_address = $af_billing_data->appendChild( $xml->createElement( 'Address' ) );831 $af_billing_address->appendChild( $xml->createElement( 'Street' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_street( $order ) ) );832 $af_billing_address->appendChild( $xml->createElement( 'Number' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_street_number( $order ) ) );833 $af_billing_address->appendChild( $xml->createElement( 'Comp' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_complement( $order ) ) );834 $af_billing_address->appendChild( $xml->createElement( 'County' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_county( $order ) ) );835 $af_billing_address->appendChild( $xml->createElement( 'City' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_city( $order ) ) );836 $af_billing_address->appendChild( $xml->createElement( 'State' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_state( $order ) ) );837 $af_billing_address->appendChild( $xml->createElement( 'Country' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_country( $order ) ) );838 $af_billing_address->appendChild( $xml->createElement( 'ZipCode' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_zipcode( $order ) ) );839 //$af_billing_address->appendChild($xml->createElement('Reference'))->appendChild($xml->createTextNode(''));840 841 $af_billing_phones = $af_billing_data->appendChild( $xml->createElement( 'Phones' ) );842 $af_billing_phone = $af_billing_phones->appendChild( $xml->createElement( 'Phone' ) );843 $af_billing_phone->appendChild( $xml->createElement( 'Type' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_phone_type( $order ) ) );844 $af_billing_phone->appendChild( $xml->createElement( 'DDI' ) )->appendChild( $xml->createTextNode( '55' ) );845 $af_billing_phone->appendChild( $xml->createElement( 'DDD' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_phone_ddd( $order ) ) );846 $af_billing_phone->appendChild( $xml->createElement( 'Number' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_phone_number( $order ) ) );847 //$af_billing_phone->appendChild($xml->createElement('Extension'))->appendChild($xml->createTextNode(''));848 849 //SHIPPING850 $af_shipping_data = $af_order->appendChild( $xml->createElement( 'ShippingData' ) );851 //$af_shipping_data->appendChild($xml->createElement('ID'))->appendChild($xml->createTextNode(''));852 $af_shipping_data->appendChild( $xml->createElement( 'Type' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_person_type( $order ) ) );853 $af_shipping_data->appendChild( $xml->createElement( 'LegalDocument1' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_document( $order ) ) );854 //$af_shipping_data->appendChild($xml->createElement('LegalDocument2'))->appendChild($xml->createTextNode(''));855 $af_shipping_data->appendChild( $xml->createElement( 'Name' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_name( $order ) ) );856 //$af_shipping_data->appendChild($xml->createElement('BirthDate'))->appendChild($xml->createTextNode(''));857 $af_shipping_data->appendChild( $xml->createElement( 'Email' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_email( $order ) ) );858 //$af_shipping_data->appendChild($xml->createElement('Gender'))->appendChild($xml->createTextNode(''));859 860 $af_shipping_address = $af_shipping_data->appendChild( $xml->createElement( 'Address' ) );861 $af_shipping_address->appendChild( $xml->createElement( 'Street' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_street( $order ) ) );862 $af_shipping_address->appendChild( $xml->createElement( 'Number' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_street_number( $order ) ) );863 $af_shipping_address->appendChild( $xml->createElement( 'Comp' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_complement( $order ) ) );864 $af_shipping_address->appendChild( $xml->createElement( 'County' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_county( $order ) ) );865 $af_shipping_address->appendChild( $xml->createElement( 'City' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_city( $order ) ) );866 $af_shipping_address->appendChild( $xml->createElement( 'State' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_state( $order ) ) );867 $af_shipping_address->appendChild( $xml->createElement( 'Country' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_country( $order ) ) );868 $af_shipping_address->appendChild( $xml->createElement( 'ZipCode' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_zipcode( $order ) ) );869 //$af_shipping_address->appendChild($xml->createElement('Reference'))->appendChild($xml->createTextNode(''));870 871 $af_shipping_phones = $af_shipping_data->appendChild( $xml->createElement( 'Phones' ) );872 $af_shipping_phone = $af_shipping_phones->appendChild( $xml->createElement( 'Phone' ) );873 $af_shipping_phone->appendChild( $xml->createElement( 'Type' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_phone_type( $order ) ) );874 $af_shipping_phone->appendChild( $xml->createElement( 'DDI' ) )->appendChild( $xml->createTextNode( '55' ) );875 $af_shipping_phone->appendChild( $xml->createElement( 'DDD' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_phone_ddd( $order ) ) );876 $af_shipping_phone->appendChild( $xml->createElement( 'Number' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_shipping_phone_number( $order ) ) );877 //$af_shipping_phone->appendChild($xml->createElement('Extension'))->appendChild($xml->createTextNode(''));878 879 //PAYMENT880 $af_payments = $af_order->appendChild( $xml->createElement( 'Payments' ) );881 $af_payment = $af_payments->appendChild( $xml->createElement( 'Payment' ) );882 //$af_payment->appendChild($xml->createElement('Sequential'))->appendChild($xml->createTextNode(''));883 $af_payment->appendChild( $xml->createElement( 'Date' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_date( $order ) ) );884 $af_payment->appendChild( $xml->createElement( 'Amount' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_amount( $order ) ) );885 $af_payment->appendChild( $xml->createElement( 'PaymentTypeID' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_type_id( $order ) ) );886 $af_payment->appendChild( $xml->createElement( 'QtyInstallments' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_qtd_installments( $order ) ) );887 //$af_payment->appendChild($xml->createElement('Interest'))->appendChild($xml->createTextNode(''));888 //$af_payment->appendChild($xml->createElement('InterestValue'))->appendChild($xml->createTextNode(''));889 //$af_payment->appendChild($xml->createElement('CardNumber'))->appendChild($xml->createTextNode(''));890 $af_payment->appendChild( $xml->createElement( 'CardBin' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_card_bin( $order ) ) );891 $af_payment->appendChild( $xml->createElement( 'CardEndNumber' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_card_end( $order ) ) );892 $af_payment->appendChild( $xml->createElement( 'CardType' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_card_type( $order ) ) );893 $af_payment->appendChild( $xml->createElement( 'CardExpirationDate' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_card_expiration( $order ) ) );894 $af_payment->appendChild( $xml->createElement( 'Name' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_card_holder_name( $order ) ) );895 $af_payment->appendChild( $xml->createElement( 'LegalDocument' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_payment_card_legal_document( $order ) ) );896 897 $af_payment_address = $af_payment->appendChild( $xml->createElement( 'Address' ) );898 $af_payment_address->appendChild( $xml->createElement( 'Street' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_street( $order ) ) );899 $af_payment_address->appendChild( $xml->createElement( 'Number' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_street_number( $order ) ) );900 $af_payment_address->appendChild( $xml->createElement( 'Comp' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_complement( $order ) ) );901 $af_payment_address->appendChild( $xml->createElement( 'County' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_county( $order ) ) );902 $af_payment_address->appendChild( $xml->createElement( 'City' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_city( $order ) ) );903 $af_payment_address->appendChild( $xml->createElement( 'State' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_state( $order ) ) );904 $af_payment_address->appendChild( $xml->createElement( 'Country' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_country( $order ) ) );905 $af_payment_address->appendChild( $xml->createElement( 'ZipCode' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_billing_zipcode( $order ) ) );906 //$af_payment_address->appendChild($xml->createElement('Reference'))->appendChild($xml->createTextNode(''));907 908 //$af_payment->appendChild($xml->createElement('Nsu'))->appendChild($xml->createTextNode(''));909 $af_payment->appendChild( $xml->createElement( 'Currency' ) )->appendChild( $xml->createTextNode( '986' ) );910 911 //ITEMS912 $af_items_xml = $af_order->appendChild( $xml->createElement( 'Items' ) );913 $af_items_order = $order->get_items();914 915 foreach ( $af_items_order as $af_item_order ) {916 $af_item_xml = $af_items_xml->appendChild( $xml->createElement( 'Item' ) );917 918 $af_item_xml->appendChild( $xml->createElement( 'ID' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_item_id( $af_item_order ) ) );919 $af_item_xml->appendChild( $xml->createElement( 'Name' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_item_name( $af_item_order ) ) );920 $af_item_xml->appendChild( $xml->createElement( 'Qty' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_item_qty( $af_item_order ) ) );921 $af_item_xml->appendChild( $xml->createElement( 'Gift' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_item_gift() ) );922 $af_item_xml->appendChild( $xml->createElement( 'CategoryID' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_item_category_id( $af_item_order ) ) );923 $af_item_xml->appendChild( $xml->createElement( 'CategoryName' ) )->appendChild( $xml->createTextNode( $this->get_antifraud_item_category_name( $af_item_order ) ) );924 }925 926 //PURCHASE INFO927 $af_purchase_info = $af_order->appendChild( $xml->createElement( 'PurchaseInformationData' ) );928 //$af_purchase_info->appendChild($xml->createElement('LastDateInsertedMail'))->appendChild($xml->createTextNode(''));929 //$af_purchase_info->appendChild($xml->createElement('LastDateChangePassword'))->appendChild($xml->createTextNode(''));930 //$af_purchase_info->appendChild($xml->createElement('LastDateChangePhone'))->appendChild($xml->createTextNode(''));931 //$af_purchase_info->appendChild($xml->createElement('LastDateChangeMobilePhone'))->appendChild($xml->createTextNode(''));932 //$af_purchase_info->appendChild($xml->createElement('LastDateInsertedAddress'))->appendChild($xml->createTextNode(''));933 $af_purchase_info->appendChild( $xml->createElement( 'PurchaseLogged' ) )->appendChild( $xml->createTextNode( ( is_user_logged_in() ) ? '1' : '0' ) );934 //$af_purchase_info->appendChild($xml->createElement('PurchaseLoggedWithFacebook'))->appendChild($xml->createTextNode(''));935 936 $xml->formatOutput = ( $this->debug == 'yes' );937 938 $response = $this->antifraud_api_request( 'POST', 'SendOrders', $xml->saveXML() );939 if ( ! $response->result == 'failure' ) {940 $this->antifraud_insert_order_reanalyze( $order );941 $metadata_result = $this->antifraud_insert_order_metadata( $order, $response );942 if ( ! $metadata_result->result == 'failure' ) {943 $result = $metadata_result;944 $do_retry = false;945 }946 }947 } catch ( Exception $e ) {948 $this->logger( 'Antifraud Authorization Card Error', $e->getMessage() );949 }950 }951 952 return $result;953 }954 955 956 //API REQUEST957 703 958 704 private function gateway_api_request( $method, $endpoint, $body ) { 959 705 $result = array( 'result' => 'failure', 'messages' => '' ); 960 706 try { 961 $payload = array( 962 'method' => $method, 963 'sslverify' => true, 964 'timeout' => 60, 965 'headers' => array( 966 'Content-Type' => 'application/json', 967 'authenticationApi' => $this->authentication_api, 968 'authenticationKey' => $this->authentication_key 969 ), 970 'body' => json_encode( $body ) 971 ); 972 973 $url = ( $this->sandbox == 'yes' ) ? $this->gateway_demo_url . '/' . $this->gateway_demo_version : $this->gateway_live_url . '/' . $this->gateway_live_version; 974 $this->logger( 'API Gateway Request | URL', $url ); 975 $this->logger( 'API Gateway Request | BODY', $body ); 976 977 $response = wp_safe_remote_post( $url . $endpoint, $payload ); 978 979 if ( ! is_wp_error( $response ) ) { 980 $response_json = wp_remote_retrieve_body( $response ); 981 $decoded_json = json_decode( $response_json ); 982 $this->logger( 'API Gateway Response | JSON', $decoded_json ); 983 if ( ! empty( $decoded_json ) ) { 984 $result = $decoded_json; 985 } else { 986 wc_add_notice( esc_html__( 'The credentials for this virtual store are not valid on the BusinessPay server.', 'woocommerce-businesspay' ), 'error' ); 987 } 988 } else { 989 wc_add_notice( esc_html__( 'Could not receive a valid server response. Please try again.', 'woocommerce-businesspay' ), 'error' ); 990 } 991 } catch ( Exception $e ) { 992 $this->logger( 'Gateway Api Request Error', $e->getMessage() ); 993 } 994 995 return $result; 996 } 997 998 private function antifraud_api_request( $method, $endpoint, $xml ) { 999 $result = array( 'result' => 'failure', 'messages' => '' ); 1000 try { 1001 $entity = ( $this->debug == 'yes' ) ? $this->antifraud_entity_code_demo : $this->antifraud_entity_code_live; 1002 $ssl_ver = ( $this->sandbox == 'yes' ) ? 'false' : 'true'; 1003 $payload = array( 1004 'method' => $method, 1005 'sslverify' => $ssl_ver, 1006 'timeout' => 60, 1007 'headers' => array( 1008 'Content-Type' => 'application/x-www-form-urlencoded', 1009 ), 1010 'body' => array( 1011 'entityCode' => $entity, 1012 'xml' => $xml 1013 ) 1014 ); 1015 1016 $url = ( $this->sandbox == 'yes' ) ? $this->antifraud_demo_url . '/integracao' . $this->antifraud_demo_version : $this->antifraud_live_url . $this->antifraud_live_version; 1017 $this->logger( 'API Antifraud Request | URL', $url ); 1018 $this->logger( 'API Antifraud Request | Payload', $payload ); 1019 1020 $response = wp_safe_remote_post( $url . '/service.asmx/' . $endpoint, $payload ); 1021 1022 if ( ! is_wp_error( $response ) ) { 1023 $response_body = wp_remote_retrieve_body( $response ); 1024 if ( ! empty( $response_body ) ) { 1025 $result = $response_body; 1026 } else { 1027 wc_add_notice( esc_html__( 'The credentials for this virtual store are not valid on the BusinessPay server. Please try again.', 'woocommerce-businesspay' ), 'error' ); 1028 } 1029 } else { 1030 wc_add_notice( esc_html__( 'Could not receive a valid server response. Please try again.', 'woocommerce-businesspay' ), 'error' ); 1031 } 1032 } catch ( Exception $e ) { 1033 $this->logger( 'Antifraud API Request Error', $e->getMessage() ); 1034 } 1035 1036 return $result; 1037 } 1038 1039 1040 //METADATA 1041 1042 private function gateway_insert_order_metadata( $order, $response ) { 1043 try { 1044 if ( ! strlen( $response->error->message ) > 0 ) { 1045 $this->gateway_remove_order_metadata( $order ); 1046 1047 $oid = $this->get_order_id( $order ); 1048 if ( isset( $response->payment->card ) ) { 1049 if ( $response->payment->card->type == '1' ) { 1050 update_post_meta( $oid, '_businesspay-transaction-type', 'credit-card' ); 1051 } elseif ( $response->payment->card->type == '2' ) { 1052 update_post_meta( $oid, '_businesspay-transaction-type', 'debit-card' ); 1053 } 1054 update_post_meta( $oid, '_businesspay-transaction-id', $response->transactionId ); 1055 update_post_meta( $oid, '_businesspay-transaction-date', $response->dtTransaction ); 1056 update_post_meta( $oid, '_businesspay-transaction-status', $response->status ); 1057 update_post_meta( $oid, '_businesspay-transaction-status-message', $this->gateway_woocommerce_message( $order, $response ) ); 1058 update_post_meta( $oid, '_businesspay-card-type', $response->payment->card->type ); 1059 update_post_meta( $oid, '_businesspay-card-brand', $response->payment->card->cardInfo->brand ); 1060 update_post_meta( $oid, '_businesspay-card-interest-type', $response->payment->card->interestType ); 1061 update_post_meta( $oid, '_businesspay-card-installments', $response->payment->card->installments ); 1062 update_post_meta( $oid, '_businesspay-card-capture', $response->payment->card->capture ); 1063 update_post_meta( $oid, '_businesspay-card-captured-amount', $response->payment->card->capturedAmount ); 1064 update_post_meta( $oid, '_businesspay-card-pre-authorization', $response->payment->card->preAuthorization ); 1065 update_post_meta( $oid, '_businesspay-card-authenticate', $response->payment->card->authenticate ); 1066 update_post_meta( $oid, '_businesspay-card-recurrent', $response->payment->card->recurrent ); 1067 update_post_meta( $oid, '_businesspay-card-provider', $response->payment->card->provider ); 1068 update_post_meta( $oid, '_businesspay-card-provider-version', $response->payment->card->providerVersion ); 1069 update_post_meta( $oid, '_businesspay-card-authentication-eci', $response->payment->card->authenticationECI ); 1070 update_post_meta( $oid, '_businesspay-card-authorization-code', $response->payment->card->codAuthorization ); 1071 update_post_meta( $oid, '_businesspay-card-provider-reference', $response->payment->card->providerReference ); 1072 update_post_meta( $oid, '_businesspay-card-provider-code', $response->payment->card->providerCode ); 1073 update_post_meta( $oid, '_businesspay-card-provider-message', $response->payment->card->providerMessage ); 1074 update_post_meta( $oid, '_businesspay-card-cardinfo-number', $response->payment->card->cardInfo->number ); 1075 update_post_meta( $oid, '_businesspay-card-cardinfo-expiration-month', $response->payment->card->cardInfo->expirationMonth ); 1076 update_post_meta( $oid, '_businesspay-card-cardinfo-expiration-year', $response->payment->card->cardInfo->expirationYear ); 1077 update_post_meta( $oid, '_businesspay-customer-name', $response->customer->name ); 1078 update_post_meta( $oid, '_businesspay-customer-document', $response->customer->document ); 1079 } elseif ( isset( $response->payment->electronicTransfer ) ) { 1080 update_post_meta( $oid, '_businesspay-transaction-type', 'bank-transfer' ); 1081 update_post_meta( $oid, '_businesspay-transaction-id', $response->transactionId ); 1082 update_post_meta( $oid, '_businesspay-transaction-date', $response->dtTransaction ); 1083 update_post_meta( $oid, '_businesspay-transaction-status', $response->status ); 1084 update_post_meta( $oid, '_businesspay-transaction-status-message', $this->gateway_woocommerce_message( $order, $response ) ); 1085 update_post_meta( $oid, '_businesspay-customer-name', $response->customer->name ); 1086 update_post_meta( $oid, '_businesspay-customer-document', $response->customer->document ); 1087 update_post_meta( $oid, '_businesspay-electronic-transfer-provider', $response->payment->electronicTransfer->provider ); 1088 update_post_meta( $oid, '_businesspay-electronic-transfer-provider-reference', $response->payment->electronicTransfer->providerReference ); 1089 update_post_meta( $oid, '_businesspay-electronic-transfer-payment-date', $response->payment->electronicTransfer->paymentDate ); 1090 update_post_meta( $oid, '_businesspay-electronic-transfer-payment-amount', $response->payment->electronicTransfer->paymentAmount ); 1091 } elseif ( isset( $response->payment->bankSlip ) ) { 1092 update_post_meta( $oid, '_businesspay-transaction-type', 'billet' ); 1093 update_post_meta( $oid, '_businesspay-transaction-id', $response->transactionId ); 1094 update_post_meta( $oid, '_businesspay-transaction-date', $response->dtTransaction ); 1095 update_post_meta( $oid, '_businesspay-transaction-status', $response->status ); 1096 update_post_meta( $oid, '_businesspay-transaction-status-message', $this->gateway_woocommerce_message( $order, $response ) ); 1097 update_post_meta( $oid, '_businesspay-customer-name', $response->customer->name ); 1098 update_post_meta( $oid, '_businesspay-customer-document', $response->customer->document ); 1099 update_post_meta( $oid, '_businesspay-bankslip-provider-reference', $response->payment->bankSlip->providerReference ); 1100 update_post_meta( $oid, '_businesspay-bankslip-provider-code', $response->payment->bankSlip->providerCode ); 1101 update_post_meta( $oid, '_businesspay-bankslip-provider-message', $response->payment->bankSlip->providerMessage ); 1102 update_post_meta( $oid, '_businesspay-bankslip-emission-date', $response->payment->bankSlip->emissionDate ); 1103 update_post_meta( $oid, '_businesspay-bankslip-expiration-date', $response->payment->bankSlip->expirationDate ); 1104 update_post_meta( $oid, '_businesspay-bankslip-instructions', $response->payment->bankSlip->instructions ); 1105 update_post_meta( $oid, '_businesspay-bankslip-guarantor', $response->payment->bankSlip->guarantor ); 1106 update_post_meta( $oid, '_businesspay-bankslip-provider', $response->payment->bankSlip->provider ); 1107 update_post_meta( $oid, '_businesspay-bankslip-payment-date', $response->payment->bankSlip->paymentDate ); 1108 update_post_meta( $oid, '_businesspay-bankslip-payment-amount', $response->payment->bankSlip->paymentAmount ); 1109 } 1110 $this->set_summary_info( $order ); 1111 } 1112 } catch ( Exception $e ) { 1113 $this->logger( 'Gateway Insert Order Metadata Error', $e->getMessage() ); 1114 } 1115 } 1116 1117 private function gateway_insert_order_status( $order, $response ) { 1118 $result = array( 'result' => 'failure', 'messages' => '' ); 1119 try { 1120 $res_status = $this->gateway_woocommerce_status( $order, $response ); 1121 $res_result = $this->gateway_woocommerce_result( $response ); 1122 $res_message = $this->gateway_woocommerce_message( $order, $response ); 1123 1124 if ( $res_result == 'success' ) { 1125 $res_note = esc_html__( 'BusinessPay Status: ', 'woocommerce-businesspay' ) . $res_message; 1126 $order->set_transaction_id( $response->transactionId ); 1127 $order->update_status( $res_status, $res_note ); 1128 1129 if ( isset( $response->payment->electronicTransfer->url ) ) { 1130 $return_url = $response->payment->electronicTransfer->url; 1131 } elseif ( isset( $response->payment->bankSlip->url ) ) { 1132 $return_url = $response->payment->bankSlip->url; 1133 } else { 1134 $return_url = $this->get_return_url( $order ); 1135 } 1136 $result = array( 1137 'result' => 'success', 1138 'redirect' => $return_url 1139 ); 1140 } else { 1141 $result = array( 1142 'result' => $res_result, 1143 'messages' => $res_message 1144 ); 1145 $order->update_status( 'failed', $res_message ); 1146 } 1147 } catch ( Exception $e ) { 1148 $this->logger( 'Gateway Insert Order Status Error', $e->getMessage() ); 1149 } 1150 1151 return $result; 1152 } 1153 1154 private function antifraud_insert_order_metadata( $order, $response ) { 1155 $af_xml = new DOMDocument(); 1156 $af_xml->loadXML( trim( $response ) ); 1157 $content_text = (string) $af_xml->textContent; 1158 $content_text = mb_convert_encoding( $content_text, 'utf-8', mb_detect_encoding( $content_text ) ); 1159 $content_text_2 = str_replace( 'utf-16', 'utf-8', $content_text ); 1160 1161 $af_xml_2 = new DOMDocument(); 1162 $af_xml_2->loadXML( $content_text_2 ); 1163 1164 $transaction_id = $af_xml_2->getElementsByTagName( 'TransactionID' ); 1165 $transaction_date = current_time( 'mysql' ); 1166 $status_code = $af_xml_2->getElementsByTagName( 'StatusCode' ); 1167 $message = $af_xml_2->getElementsByTagName( 'Message' ); 1168 $id = $af_xml_2->getElementsByTagName( 'ID' ); 1169 $status = $af_xml_2->getElementsByTagName( 'Status' ); 1170 1171 $this->logger( 'API Antifraud Response | Transaction ID', $transaction_id[0]->nodeValue ); 1172 $this->logger( 'API Antifraud Response | Transaction Date', $transaction_date ); 1173 $this->logger( 'API Antifraud Response | StatusCode', $status_code[0]->nodeValue ); 1174 $this->logger( 'API Antifraud Response | Message', $message[0]->nodeValue ); 1175 $this->logger( 'API Antifraud Response | ID', $id[0]->nodeValue ); 1176 $this->logger( 'API Antifraud Response | Status', $status[0]->nodeValue ); 1177 1178 $oid = $this->get_order_id( $order ); 1179 $this->antifraud_remove_order_metadata( $order ); 1180 update_post_meta( $oid, '_businesspay-antifraud-transaction-id', $transaction_id[0]->nodeValue ); 1181 update_post_meta( $oid, '_businesspay-antifraud-transaction-date', $transaction_date ); 1182 update_post_meta( $oid, '_businesspay-antifraud-status-code', $status_code[0]->nodeValue ); 1183 update_post_meta( $oid, '_businesspay-antifraud-message', $message[0]->nodeValue ); 1184 update_post_meta( $oid, '_businesspay-antifraud-id', $id[0]->nodeValue ); 1185 update_post_meta( $oid, '_businesspay-antifraud-status', $status[0]->nodeValue ); 1186 } 1187 1188 private function gateway_remove_order_metadata( $order ) { 1189 $oid = $this->get_order_id( $order ); 1190 $tid = get_post_meta( $oid, '_businesspay-transaction-type', true ); 1191 if ( strlen( $tid ) > 0 ) { 1192 //All fields managed by BusinessPay 1193 delete_post_meta( $oid, '_businesspay-transaction-type' ); 1194 delete_post_meta( $oid, '_businesspay-transaction-date' ); 1195 delete_post_meta( $oid, '_businesspay-transaction-status' ); 1196 delete_post_meta( $oid, '_businesspay-transaction-status-message' ); 1197 delete_post_meta( $oid, '_businesspay-card-type' ); 1198 delete_post_meta( $oid, '_businesspay-card-brand' ); 1199 delete_post_meta( $oid, '_businesspay-card-interest-type' ); 1200 delete_post_meta( $oid, '_businesspay-card-installments' ); 1201 delete_post_meta( $oid, '_businesspay-card-capture' ); 1202 delete_post_meta( $oid, '_businesspay-card-captured-amount' ); 1203 delete_post_meta( $oid, '_businesspay-card-pre-authorization' ); 1204 delete_post_meta( $oid, '_businesspay-card-authenticate' ); 1205 delete_post_meta( $oid, '_businesspay-card-recurrent' ); 1206 delete_post_meta( $oid, '_businesspay-card-provider' ); 1207 delete_post_meta( $oid, '_businesspay-card-provider-version' ); 1208 delete_post_meta( $oid, '_businesspay-card-authentication-eci' ); 1209 delete_post_meta( $oid, '_businesspay-card-authorization-code' ); 1210 delete_post_meta( $oid, '_businesspay-card-provider-reference' ); 1211 delete_post_meta( $oid, '_businesspay-card-provider-code' ); 1212 delete_post_meta( $oid, '_businesspay-card-provider-message' ); 1213 delete_post_meta( $oid, '_businesspay-card-cardinfo-number' ); 1214 delete_post_meta( $oid, '_businesspay-card-cardinfo-expiration-month' ); 1215 delete_post_meta( $oid, '_businesspay-card-cardinfo-expiration-year' ); 1216 delete_post_meta( $oid, '_businesspay-customer-name' ); 1217 delete_post_meta( $oid, '_businesspay-customer-document' ); 1218 delete_post_meta( $oid, '_businesspay-electronic-transfer-provider' ); 1219 delete_post_meta( $oid, '_businesspay-electronic-transfer-provider-reference' ); 1220 delete_post_meta( $oid, '_businesspay-electronic-transfer-payment-date' ); 1221 delete_post_meta( $oid, '_businesspay-electronic-transfer-payment-amount' ); 1222 delete_post_meta( $oid, '_businesspay-bankslip-provider-reference' ); 1223 delete_post_meta( $oid, '_businesspay-bankslip-provider-code' ); 1224 delete_post_meta( $oid, '_businesspay-bankslip-provider-message' ); 1225 delete_post_meta( $oid, '_businesspay-bankslip-emission-date' ); 1226 delete_post_meta( $oid, '_businesspay-bankslip-expiration-date' ); 1227 delete_post_meta( $oid, '_businesspay-bankslip-instructions' ); 1228 delete_post_meta( $oid, '_businesspay-bankslip-guarantor' ); 1229 delete_post_meta( $oid, '_businesspay-bankslip-provider' ); 1230 delete_post_meta( $oid, '_businesspay-bankslip-payment-date' ); 1231 delete_post_meta( $oid, '_businesspay-bankslip-payment-amount' ); 1232 } 1233 } 1234 1235 private function antifraud_remove_order_metadata( $order ) { 1236 $oid = $this->get_order_id( $order ); 1237 delete_post_meta( $oid, '_businesspay-antifraud-transaction-id' ); 1238 delete_post_meta( $oid, '_businesspay-antifraud-transaction-date' ); 1239 delete_post_meta( $oid, '_businesspay-antifraud-status-code' ); 1240 delete_post_meta( $oid, '_businesspay-antifraud-message' ); 1241 delete_post_meta( $oid, '_businesspay-antifraud-id' ); 1242 delete_post_meta( $oid, '_businesspay-antifraud-status' ); 1243 } 1244 1245 private function antifraud_insert_order_reanalyze( $order ) { 1246 update_post_meta( $this->get_order_id( $order ), '_businesspay-antifraud-reanalyze', '1' ); 1247 } 1248 1249 1250 //STATUS 1251 1252 private function gateway_woocommerce_status( $order, $response ) { 1253 try { 1254 switch ( $response->status ) { 1255 case 0: //TRANSACAO INICIADA 1256 $result = 'on-hold'; 1257 break; 1258 case 1: //AGUARDANDO PAGAMENTO 1259 $result = 'pending'; 1260 break; 1261 case 2: //EFETIVADA 1262 $result = 'on-hold'; 1263 break; 1264 case 3: //EM ANALISE 1265 $result = 'on-hold'; 1266 break; 1267 case 4: //EXPIRADA 1268 $result = 'failed'; 1269 break; 1270 case 5: //AUTORIZADA 1271 $result = 'on-hold'; 1272 break; 1273 case 6: //CONFIRMADA 1274 $result = 'processing'; 1275 break; 1276 case 7: //NEGADA 1277 $result = 'failed'; 1278 break; 1279 case 8: //CANCELAMENTO EM ANDAMENTO 1280 $result = 'failed'; 1281 break; 1282 case 9: //CANCELADA 1283 $result = 'cancelled'; 1284 break; 1285 case 10: //PENDENTE DE CONFIRMAÇÃO 1286 $result = 'on-hold'; 1287 break; 1288 case 11: //FALHA NA COMUNICAÇÃO COM FORNECEDOR 1289 $result = 'failed'; 1290 break; 1291 default: 1292 $result = 'failed'; 1293 break; 1294 } 1295 1296 //Verify billet & transfer payment amount 1297 if ( $result == 'processing' ) { 1298 //Using card with antifraud 1299 if ( isset( $response->payment->card ) && $this->enable_antifraud ) { 1300 $result = 'on-hold'; 1301 } else { 1302 $bp_paid_total = $this->get_gateway_payment_amount( $response ); 1303 if ( ! empty( $bp_paid_total ) ) { 1304 $bp_order_total = str_replace( array( ',', '.' ), '', $this->get_total_order( $order ) ); 1305 $bp_balance = $bp_order_total - $bp_paid_total; 1306 if ( $bp_balance > 0 ) { 1307 $result = 'on-hold'; 1308 } 1309 } 1310 } 1311 } 1312 } catch ( Exception $e ) { 1313 $this->logger( 'Gateway Woocommerce Status Error', $e->getMessage() ); 1314 } 1315 $this->logger( 'WooCommerce Status | STATUS', $result ); 1316 1317 return $result; 1318 } 1319 1320 private function gateway_woocommerce_result( $response ) { 1321 $result = 'failure'; 1322 try { 1323 switch ( $response->status ) { 1324 case 0: //TRANSACAO INICIADA 1325 $result = 'success'; 1326 break; 1327 case 1: //AGUARDANDO PAGAMENTO 1328 $result = 'success'; 1329 break; 1330 case 2: //EFETIVADA 1331 $result = 'success'; 1332 break; 1333 case 3: //EM ANALISE 1334 $result = 'success'; 1335 break; 1336 case 4: //EXPIRADA 1337 $result = 'failure'; 1338 break; 1339 case 5: //AUTORIZADA 1340 $result = 'success'; 1341 break; 1342 case 6: //CONFIRMADA 1343 $result = 'success'; 1344 break; 1345 case 7: //NEGADA 1346 $result = 'failure'; 1347 break; 1348 case 8: //CANCELAMENTO EM ANDAMENTO 1349 $result = 'failure'; 1350 break; 1351 case 9: //CANCELADA 1352 $result = 'failure'; 1353 break; 1354 case 10: //PENDENTE DE CONFIRMAÇÃO 1355 $result = 'success'; 1356 break; 1357 case 11: //FALHA NA COMUNICAÇÃO COM FORNECEDOR 1358 $result = 'failure'; 1359 break; 1360 default: 1361 $result = 'failure'; 1362 break; 1363 } 1364 } catch ( Exception $e ) { 1365 $this->logger( 'Gateway Woocommerce Result Error', $e->getMessage() ); 1366 } 1367 $this->logger( 'WooCommerce Status | RESULT', $result ); 1368 1369 return $result; 1370 } 1371 1372 private function gateway_woocommerce_message( $order, $response ) { 1373 $result = 'failure'; 1374 try { 1375 switch ( $response->status ) { 1376 case 0: //TRANSACAO INICIADA 1377 $result = esc_html__( 'Transaction started but not confirmed.', 'woocommerce-businesspay' ); 1378 break; 1379 case 1: //AGUARDANDO PAGAMENTO 1380 $result = esc_html__( 'Awating payment.', 'woocommerce-businesspay' ); 1381 break; 1382 case 2: //EFETIVADA 1383 $result = esc_html__( 'Transaction effectivated.', 'woocommerce-businesspay' ); 1384 break; 1385 case 3: //EM ANALISE 1386 $result = esc_html__( 'Transaction under analysis.', 'woocommerce-businesspay' ); 1387 break; 1388 case 4: //EXPIRADA 1389 $result = esc_html__( 'Transaction expired.', 'woocommerce-businesspay' ); 1390 break; 1391 case 5: //AUTORIZADA 1392 $result = esc_html__( 'Transaction authorized.', 'woocommerce-businesspay' ); 1393 break; 1394 case 6: //CONFIRMADA 1395 $result = esc_html__( 'Transaction confirmed.', 'woocommerce-businesspay' ); 1396 break; 1397 case 7: //NEGADA 1398 $result = esc_html__( 'Transaction denied.', 'woocommerce-businesspay' ); 1399 break; 1400 case 8: //CANCELAMENTO EM ANDAMENTO 1401 $result = esc_html__( 'Cancellation in progress.', 'woocommerce-businesspay' ); 1402 break; 1403 case 9: //CANCELADA 1404 $result = esc_html__( 'Transaction Canceled.', 'woocommerce-businesspay' ); 1405 break; 1406 case 10: //PENDENTE DE CONFIRMAÇÃO 1407 $result = esc_html__( 'Transaction pending of confirmation.', 'woocommerce-businesspay' ); 1408 break; 1409 case 11: //FALHA NA COMUNICAÇÃO COM FORNECEDOR 1410 $result = esc_html__( 'Failure to communicate with the provider.', 'woocommerce-businesspay' ); 1411 break; 1412 default: 1413 $result = esc_html__( 'No valid server response.', 'woocommerce-businesspay' ); 1414 break; 1415 } 1416 1417 //Verify billet & transfer payment amount 1418 if ( $result == 'processing' ) { 1419 //Using card with antifraud 1420 if ( isset( $response->payment->card ) && $this->enable_antifraud ) { 1421 $result = esc_html__( 'The order will be analyzed by antifraud software', 'woocommerce-businesspay' ); 1422 } else { 1423 $bp_paid_total = $this->get_gateway_payment_amount( $response ); 1424 if ( ! empty( $bp_paid_total ) ) { 1425 $bp_order_total = str_replace( array( ',', '.' ), '', $this->get_total_order( $order ) ); 1426 $bp_balance = $bp_order_total - $bp_paid_total; 1427 if ( $bp_balance > 0 ) { 1428 $result = esc_html__( 'payment made less than the value of the order.', 'woocommerce-businesspay' ); 1429 } 1430 } 1431 } 1432 } 1433 } catch ( Exception $e ) { 1434 $this->logger( 'Gateway Woocommerce Message Error', $e->getMessage() ); 1435 } 1436 $this->logger( 'WooCommerce Status | MESSAGE', $result ); 1437 1438 return $result; 1439 } 1440 1441 1442 //CALLBACK 1443 1444 public function gateway_callback() { 1445 $callback = file_get_contents( "php://input" ); 1446 $json = json_decode( $callback ); 1447 $this->logger( 'API Notification | Body', $json ); 1448 1449 if ( isset( $json->referenceId ) ) { //Gateway 1450 $this->gateway_api_consult_status( $json->referenceId, $json->transactionId ); 1451 //} elseif ( isset( $json->code ) ) { //Antifraud 1452 } else { 1453 $this->antifraud_api_consult_status( $json ); 1454 } 1455 } 1456 1457 private function gateway_api_consult_status( $order_id, $transactionId ) { 1458 $result = false; 1459 try { 1460 $order = wc_get_order( $order_id ); 1461 if ( ! is_wp_error( $order ) ) { 1462 $body = array( 'transactionId' => $transactionId ); 1463 $response = $this->gateway_api_request( 'GET', '/transactions/' . $transactionId, $body ); 1464 if ( ! isset( $response->result ) ) { 1465 $this->gateway_insert_order_metadata( $order, $response ); 1466 $result = $this->gateway_insert_order_status( $order, $response ); 1467 } 1468 } 1469 } catch ( Exception $e ) { 1470 $this->logger( 'Gateway API Consult Status Error', $e->getMessage() ); 1471 } 1472 1473 return $result; 1474 } 1475 1476 private function antifraud_api_consult_status( $json ) { 1477 $this->logger( 'ANTIFRAUD CALLBACK', $json ); 1478 1479 return ''; 1480 } 1481 1482 1483 //ADMIN 1484 1485 public function businesspay_admin_panel_gateway() { 1486 wc_get_template( 'businesspay-panel-gateway.php', array( 'bpConfig' => $this ), 'woocommerce/businesspay/', WC_BusinessPay::get_templates_path() ); 1487 } 1488 1489 public function businesspay_admin_panel_antifraud() { 1490 wc_get_template( 'businesspay-panel-antifraud.php', array( 'bpConfig' => $this ), 'woocommerce/businesspay/', WC_BusinessPay::get_templates_path() ); 1491 } 1492 1493 1494 //GETTERS 1495 1496 private function get_admin_url() { 1497 if ( version_compare( WC_BusinessPay::get_woo_version(), '2.1', '>=' ) ) { 1498 return admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=businesspay_gateway' ); 1499 } 1500 1501 return admin_url( 'admin.php?page=woocommerce_settings&tab=payment_gateways§ion=WC_BusinessPay_Gateway' ); 1502 } 1503 1504 private function get_blog_domain() { 1505 return str_replace( array( 'http://', 'https://', 'www.' ), '', get_option( 'siteurl' ) ); 1506 } 1507 1508 private function get_blog_name() { 1509 return get_bloginfo( 'name' ); 1510 } 1511 1512 public function get_cart_total() { 1513 if ( version_compare( WC_BusinessPay::get_woo_version(), '3.2.0', '>=' ) ) { 1514 $cart_total = WC()->cart->get_cart_contents_total(); 1515 } else { 1516 global $woocommerce; 1517 $cart_total = $woocommerce->cart->total; 1518 } 1519 1520 return $cart_total; 1521 } 1522 1523 public function get_order_id( $order ) { 1524 return $order->get_id(); 1525 } 1526 1527 public function get_total_order( $order ) { 1528 return $order->get_total(); 1529 } 1530 1531 public function get_currency_symbol() { 1532 return get_woocommerce_currency_symbol(); 1533 } 1534 1535 private function get_postback_url() { 1536 if ( version_compare( WC()->version, '2.1', '>=' ) ) { 1537 $site_url = home_url( '/wc-api/WC_BusinessPay_Gateway/' ); 1538 } else { 1539 $site_url = home_url( '/?wc-api=WC_BusinessPay_Gateway' ); 1540 } 1541 1542 return $site_url; 1543 } 1544 1545 private function get_brand_name( $brand ) { 1546 $result = ''; 1547 $brand = strtolower( str_replace( array( ' ' ), '', $brand ) ); 1548 switch ( $brand ) { 1549 case 'visa': 1550 $result = 'Visa'; 1551 break; 1552 case 'mastercard': 1553 $result = 'Mastercard'; 1554 break; 1555 case 'amex': 1556 $result = 'American Express'; 1557 break; 1558 case 'elo': 1559 $result = 'Elo'; 1560 break; 1561 case 'hipercard': 1562 $result = 'Hipercard'; 1563 break; 1564 case 'hiper': 1565 $result = 'Hiper'; 1566 break; 1567 case 'aura': 1568 $result = 'Aura'; 1569 break; 1570 case 'discover': 1571 $result = 'Discover'; 1572 break; 1573 case 'jcb': 1574 $result = 'JCB'; 1575 break; 1576 } 1577 1578 return $result; 1579 } 1580 1581 public function get_date_format() { 1582 return 'Y-m-d H:i:s'; 1583 } 1584 1585 private function get_date_interval( $date_start, $interval, $measure ) { 1586 $result = $date_start; 1587 try { 1588 if ( empty( $interval ) ) { 1589 $interval = $this->default_session_interval; 1590 } 1591 1592 switch ( $measure ) { 1593 case 'days' : 1594 $interval_spec = 'P' . $interval . 'D'; 1595 break; 1596 case 'hours': 1597 $interval_spec = 'PT' . $interval . 'H'; 1598 break; 1599 default : 1600 $interval_spec = 'PT' . $interval . 'H'; 1601 break; 1602 } 1603 1604 $date_interval = new DateTime( 'now', new DateTimeZone( get_option( 'timezone_string' ) ) ); 1605 $date_interval->add( new DateInterval( $interval_spec ) ); 1606 $result = $date_interval->format( $this->get_date_format() ); 1607 } catch ( Exception $e ) { 1608 $this->logger( 'Get Date Interval Error', $e->getMessage() ); 1609 } 1610 1611 return $result; 1612 } 1613 1614 private function get_billet_expiration( $interval ) { 1615 if ( empty( $interval ) ) { 1616 $interval = $this->default_billet_expiration_days; 1617 } 1618 try { 1619 $expiration = new DateTime(); 1620 $interval_spec = 'P' . $interval . 'D'; 1621 $expiration->add( new DateInterval( $interval_spec ) ); 1622 $result = $expiration; 1623 } catch ( Exception $e ) { 1624 $result = false; 1625 $this->logger( 'Get Billet Expiration Error', $e->getMessage() ); 1626 } 1627 1628 return $result; 1629 } 1630 1631 private function get_session() { 1632 $today = current_time( 'mysql' ); 1633 $auth_last = get_option( 'businesspay_auth_last' ); 1634 $auth_next = get_option( 'businesspay_auth_next' ); 1635 $this->logger( 'Session Info | $today', $today ); 1636 $this->logger( 'Session Info | $auth_last', $auth_last ); 1637 $this->logger( 'Session Info | $auth_next', $auth_next ); 1638 1639 $session = ( $auth_last == '' ) || ( $auth_next == '' ) || ( strtotime( $auth_next ) < strtotime( $today ) ); 1640 1641 if ( $session ) { 1642 $this->get_session_info(); 1643 } 1644 1645 $client = get_option( 'businesspay_enable_client' ); 1646 $install = get_option( 'businesspay_enable_install' ); 1647 1648 return ( $client && $install ); 1649 } 1650 1651 private function get_session_info() { 1652 try { 1653 if ( ! empty( $this->authentication_api ) && ! empty( $this->authentication_key ) ) { 1654 $action = $this->auth_schema . '://' . $this->auth_gateway . '.' . $this->authority . '.com.br'; 1655 $action .= '/' . $this->auth_api . '/' . $this->auth_scope . '/' . $this->auth_version . '/' . $this->auth_validate; 1656 1657 $body = array( 1658 'vendor_id' => $this->auth_vendor_id, 1659 'name' => substr( get_bloginfo( 'name' ), 0, 50 ), 1660 'domain' => str_replace( array( 1661 'http://', 1662 'https://', 1663 'www.' 1664 ), '', get_option( 'siteurl' ) ), 1665 'mode_api' => ( $this->sandbox == 'yes' ) ? 'demo' : 'live', 1666 'postback_url' => $this->get_postback_url(), 1667 'version_api' => ( $this->sandbox == 'yes' ) ? str_replace( 'v', '', $this->gateway_demo_version ) : str_replace( 'v', '', $this->gateway_live_version ), 1668 'version_wp' => get_bloginfo( 'version' ), 1669 'version_plugin' => WC_BusinessPay::VERSION, 1670 'version_php' => WC_BusinessPay::get_php_version(), 1671 'version_woo' => WC_BusinessPay::get_woo_version() 1672 ); 1673 707 if ( ! empty( $body ) ) { 1674 708 $payload = array( 1675 'method' => 'POST',709 'method' => $method, 1676 710 'sslverify' => true, 1677 711 'timeout' => 60, … … 1684 718 ); 1685 719 1686 $ this->logger( 'Session Info | Request', $payload );1687 1688 $ response = wp_safe_remote_post( $action, $payload);1689 1690 $ this->logger( 'Session Info | Response', $response);720 $url = ( $this->sandbox == 'yes' ) ? $this->gateway_demo_url . '/' . $this->gateway_demo_version : $this->gateway_live_url . '/' . $this->gateway_live_version; 721 $this->logger( 'API Gateway Request | URL', $url ); 722 $this->logger( 'API Gateway Request | BODY', $body ); 723 724 $response = wp_safe_remote_post( $url . $endpoint, $payload ); 1691 725 1692 726 if ( ! is_wp_error( $response ) ) { 1693 $response_body = wp_remote_retrieve_body( $response ); 1694 $response_body = $this->clear_response( $response_body ); 1695 1696 if ( ! empty( $response_body ) ) { 1697 $response = json_decode( $response_body ); 1698 1699 $today = current_time( 'mysql' ); 1700 $next = $this->get_date_interval( $today, $response->auth_interval, 'hours' ); 1701 1702 if ( ! empty( $today ) ) { 1703 $this->set_option_auth_last($today); 1704 } 1705 1706 if ( ! empty( $next ) ) { 1707 $this->set_option_auth_next($next); 1708 } 1709 1710 if ( ! empty( $response->auth_interval ) ) { 1711 $this->set_option_auth_id( $response->id ); 1712 $this->set_option_auth_interval( $response->auth_interval ); 1713 $this->set_option_enable_client( $response->client_enabled ); 1714 $this->set_option_enable_install( $response->install_enabled ); 1715 $this->set_option_enable_antifraud( $response->antifraud_enabled ); 1716 } 1717 1718 if ( ! empty( $response->antifraud_entity_code_demo ) ) { 1719 $this->set_option_antifraud_entity_code_demo( $response->antifraud_entity_code_demo ); 1720 $this->set_option_antifraud_entity_code_live( $response->antifraud_entity_code_live ); 1721 $this->set_option_antifraud_app_id_demo( $response->antifraud_app_id_demo ); 1722 $this->set_option_antifraud_app_id_live( $response->antifraud_app_id_live ); 727 $response_json = json_decode( wp_remote_retrieve_body( $response ) ); 728 $this->logger( 'API Gateway Response | JSON', $response_json ); 729 if ( ! empty( $response_json ) ) { 730 $result = $response_json; 731 } else { 732 wc_add_notice( esc_html__( 'The credentials for this virtual store are not valid on the BusinessPay server.', 'woocommerce-businesspay' ), 'error' ); 733 } 734 } else { 735 wc_add_notice( esc_html__( 'Could not receive a valid server response. Please try again.', 'woocommerce-businesspay' ), 'error' ); 736 } 737 } 738 } catch ( Exception $e ) { 739 $this->logger( 'Gateway Api Request Error', $e->getMessage() ); 740 } 741 742 return $result; 743 } 744 745 private function gateway_insert_order_metadata( $order, $response ) { 746 try { 747 if ( ! strlen( $response->error->message ) > 0 ) { 748 $order_id = $this->get_order_id( $order ); 749 $this->gateway_remove_order_metadata( $order_id ); 750 751 if ( isset( $response->payment->card ) ) { 752 if ( $response->payment->card->type == '1' ) { 753 update_post_meta( $order_id, '_businesspay-transaction-type', 'credit-card' ); 754 } elseif ( $response->payment->card->type == '2' ) { 755 update_post_meta( $order_id, '_businesspay-transaction-type', 'debit-card' ); 756 } 757 update_post_meta( $order_id, '_businesspay-transaction-id', $response->transactionId ); 758 update_post_meta( $order_id, '_businesspay-transaction-date', $response->dtTransaction ); 759 update_post_meta( $order_id, '_businesspay-transaction-status', $response->status ); 760 update_post_meta( $order_id, '_businesspay-transaction-status-message', $this->gateway_woocommerce_message( $order, $response ) ); 761 update_post_meta( $order_id, '_businesspay-card-type', $response->payment->card->type ); 762 update_post_meta( $order_id, '_businesspay-card-brand', $response->payment->card->cardInfo->brand ); 763 update_post_meta( $order_id, '_businesspay-card-interest-type', $response->payment->card->interestType ); 764 update_post_meta( $order_id, '_businesspay-card-installments', $response->payment->card->installments ); 765 update_post_meta( $order_id, '_businesspay-card-capture', $response->payment->card->capture ); 766 update_post_meta( $order_id, '_businesspay-card-captured-amount', $response->payment->card->capturedAmount ); 767 update_post_meta( $order_id, '_businesspay-card-pre-authorization', $response->payment->card->preAuthorization ); 768 update_post_meta( $order_id, '_businesspay-card-authenticate', $response->payment->card->authenticate ); 769 update_post_meta( $order_id, '_businesspay-card-recurrent', $response->payment->card->recurrent ); 770 update_post_meta( $order_id, '_businesspay-card-provider', $response->payment->card->provider ); 771 update_post_meta( $order_id, '_businesspay-card-provider-version', $response->payment->card->providerVersion ); 772 update_post_meta( $order_id, '_businesspay-card-authentication-eci', $response->payment->card->authenticationECI ); 773 update_post_meta( $order_id, '_businesspay-card-authorization-code', $response->payment->card->codAuthorization ); 774 update_post_meta( $order_id, '_businesspay-card-provider-reference', $response->payment->card->providerReference ); 775 update_post_meta( $order_id, '_businesspay-card-provider-code', $response->payment->card->providerCode ); 776 update_post_meta( $order_id, '_businesspay-card-provider-message', $response->payment->card->providerMessage ); 777 update_post_meta( $order_id, '_businesspay-card-cardinfo-number', $response->payment->card->cardInfo->number ); 778 update_post_meta( $order_id, '_businesspay-card-cardinfo-expiration-month', $response->payment->card->cardInfo->expirationMonth ); 779 update_post_meta( $order_id, '_businesspay-card-cardinfo-expiration-year', $response->payment->card->cardInfo->expirationYear ); 780 update_post_meta( $order_id, '_businesspay-customer-name', $response->customer->name ); 781 update_post_meta( $order_id, '_businesspay-customer-document', $response->customer->document ); 782 } elseif ( isset( $response->payment->electronicTransfer ) ) { 783 update_post_meta( $order_id, '_businesspay-transaction-type', 'bank-transfer' ); 784 update_post_meta( $order_id, '_businesspay-transaction-id', $response->transactionId ); 785 update_post_meta( $order_id, '_businesspay-transaction-date', $response->dtTransaction ); 786 update_post_meta( $order_id, '_businesspay-transaction-status', $response->status ); 787 update_post_meta( $order_id, '_businesspay-transaction-status-message', $this->gateway_woocommerce_message( $order, $response ) ); 788 update_post_meta( $order_id, '_businesspay-customer-name', $response->customer->name ); 789 update_post_meta( $order_id, '_businesspay-customer-document', $response->customer->document ); 790 update_post_meta( $order_id, '_businesspay-electronic-transfer-provider', $response->payment->electronicTransfer->provider ); 791 update_post_meta( $order_id, '_businesspay-electronic-transfer-provider-reference', $response->payment->electronicTransfer->providerReference ); 792 update_post_meta( $order_id, '_businesspay-electronic-transfer-payment-date', $response->payment->electronicTransfer->paymentDate ); 793 update_post_meta( $order_id, '_businesspay-electronic-transfer-payment-amount', $response->payment->electronicTransfer->paymentAmount ); 794 } elseif ( isset( $response->payment->bankSlip ) ) { 795 update_post_meta( $order_id, '_businesspay-transaction-type', 'billet' ); 796 update_post_meta( $order_id, '_businesspay-transaction-id', $response->transactionId ); 797 update_post_meta( $order_id, '_businesspay-transaction-date', $response->dtTransaction ); 798 update_post_meta( $order_id, '_businesspay-transaction-status', $response->status ); 799 update_post_meta( $order_id, '_businesspay-transaction-status-message', $this->gateway_woocommerce_message( $order, $response ) ); 800 update_post_meta( $order_id, '_businesspay-customer-name', $response->customer->name ); 801 update_post_meta( $order_id, '_businesspay-customer-document', $response->customer->document ); 802 update_post_meta( $order_id, '_businesspay-bankslip-provider-reference', $response->payment->bankSlip->providerReference ); 803 update_post_meta( $order_id, '_businesspay-bankslip-provider-code', $response->payment->bankSlip->providerCode ); 804 update_post_meta( $order_id, '_businesspay-bankslip-provider-message', $response->payment->bankSlip->providerMessage ); 805 update_post_meta( $order_id, '_businesspay-bankslip-emission-date', $response->payment->bankSlip->emissionDate ); 806 update_post_meta( $order_id, '_businesspay-bankslip-expiration-date', $response->payment->bankSlip->expirationDate ); 807 update_post_meta( $order_id, '_businesspay-bankslip-instructions', $response->payment->bankSlip->instructions ); 808 update_post_meta( $order_id, '_businesspay-bankslip-guarantor', $response->payment->bankSlip->guarantor ); 809 update_post_meta( $order_id, '_businesspay-bankslip-provider', $response->payment->bankSlip->provider ); 810 update_post_meta( $order_id, '_businesspay-bankslip-payment-date', $response->payment->bankSlip->paymentDate ); 811 update_post_meta( $order_id, '_businesspay-bankslip-payment-amount', $response->payment->bankSlip->paymentAmount ); 812 } 813 $this->set_summary_info( $order ); 814 } 815 } catch ( Exception $e ) { 816 $this->logger( 'Gateway Insert Order Metadata Error', $e->getMessage() ); 817 } 818 } 819 820 private function gateway_insert_order_status( $order, $response ) { 821 $result = array( 'result' => 'failure', 'messages' => '' ); 822 try { 823 $res_status = $this->gateway_woocommerce_status( $order, $response ); 824 $res_result = $this->gateway_woocommerce_result( $response ); 825 $res_message = $this->gateway_woocommerce_message( $order, $response ); 826 827 if ( $res_result == 'success' ) { 828 $res_note = esc_html__( 'BusinessPay Status: ', 'woocommerce-businesspay' ) . $res_message; 829 $order->set_transaction_id( $response->transactionId ); 830 $this->update_order_status( $order, $res_status, $res_note ); 831 832 $result = array( 833 'result' => 'success', 834 'redirect' => $this->get_response_url( $order, $response ), 835 ); 836 } else { 837 $result = array( 838 'result' => $res_result, 839 'messages' => $res_message 840 ); 841 $this->update_order_status( $order, 'failed', $res_message ); 842 } 843 } catch ( Exception $e ) { 844 $this->logger( 'Gateway Insert Order Status Error', $e->getMessage() ); 845 } 846 847 return $result; 848 } 849 850 private function gateway_remove_order_metadata( $order_id ) { 851 $tid = get_post_meta( $order_id, '_businesspay-transaction-type', true ); 852 if ( strlen( $tid ) > 0 ) { 853 delete_post_meta( $order_id, '_businesspay-transaction-type' ); 854 delete_post_meta( $order_id, '_businesspay-transaction-date' ); 855 delete_post_meta( $order_id, '_businesspay-transaction-status' ); 856 delete_post_meta( $order_id, '_businesspay-transaction-status-message' ); 857 delete_post_meta( $order_id, '_businesspay-card-type' ); 858 delete_post_meta( $order_id, '_businesspay-card-brand' ); 859 delete_post_meta( $order_id, '_businesspay-card-interest-type' ); 860 delete_post_meta( $order_id, '_businesspay-card-installments' ); 861 delete_post_meta( $order_id, '_businesspay-card-capture' ); 862 delete_post_meta( $order_id, '_businesspay-card-captured-amount' ); 863 delete_post_meta( $order_id, '_businesspay-card-pre-authorization' ); 864 delete_post_meta( $order_id, '_businesspay-card-authenticate' ); 865 delete_post_meta( $order_id, '_businesspay-card-recurrent' ); 866 delete_post_meta( $order_id, '_businesspay-card-provider' ); 867 delete_post_meta( $order_id, '_businesspay-card-provider-version' ); 868 delete_post_meta( $order_id, '_businesspay-card-authentication-eci' ); 869 delete_post_meta( $order_id, '_businesspay-card-authorization-code' ); 870 delete_post_meta( $order_id, '_businesspay-card-provider-reference' ); 871 delete_post_meta( $order_id, '_businesspay-card-provider-code' ); 872 delete_post_meta( $order_id, '_businesspay-card-provider-message' ); 873 delete_post_meta( $order_id, '_businesspay-card-cardinfo-number' ); 874 delete_post_meta( $order_id, '_businesspay-card-cardinfo-expiration-month' ); 875 delete_post_meta( $order_id, '_businesspay-card-cardinfo-expiration-year' ); 876 delete_post_meta( $order_id, '_businesspay-customer-name' ); 877 delete_post_meta( $order_id, '_businesspay-customer-document' ); 878 delete_post_meta( $order_id, '_businesspay-electronic-transfer-provider' ); 879 delete_post_meta( $order_id, '_businesspay-electronic-transfer-provider-reference' ); 880 delete_post_meta( $order_id, '_businesspay-electronic-transfer-payment-date' ); 881 delete_post_meta( $order_id, '_businesspay-electronic-transfer-payment-amount' ); 882 delete_post_meta( $order_id, '_businesspay-bankslip-provider-reference' ); 883 delete_post_meta( $order_id, '_businesspay-bankslip-provider-code' ); 884 delete_post_meta( $order_id, '_businesspay-bankslip-provider-message' ); 885 delete_post_meta( $order_id, '_businesspay-bankslip-emission-date' ); 886 delete_post_meta( $order_id, '_businesspay-bankslip-expiration-date' ); 887 delete_post_meta( $order_id, '_businesspay-bankslip-instructions' ); 888 delete_post_meta( $order_id, '_businesspay-bankslip-guarantor' ); 889 delete_post_meta( $order_id, '_businesspay-bankslip-provider' ); 890 delete_post_meta( $order_id, '_businesspay-bankslip-payment-date' ); 891 delete_post_meta( $order_id, '_businesspay-bankslip-payment-amount' ); 892 } 893 } 894 895 //GATEWAY STATUS 896 897 private function gateway_woocommerce_status( $order, $response ) { 898 try { 899 switch ( $response->status ) { 900 case 0: //TRANSACAO INICIADA 901 $result = 'on-hold'; 902 break; 903 case 1: //AGUARDANDO PAGAMENTO 904 $result = 'on-hold'; 905 break; 906 case 2: //EFETIVADA 907 $result = 'failed'; 908 break; 909 case 3: //EM ANALISE 910 $result = 'on-hold'; 911 break; 912 case 4: //EXPIRADA 913 $result = 'cancelled'; 914 break; 915 case 5: //AUTORIZADA 916 $result = 'on-hold'; 917 break; 918 case 6: //CONFIRMADA 919 $result = 'processing'; 920 break; 921 case 7: //NEGADA 922 $result = 'failed'; 923 break; 924 case 8: //CANCELAMENTO EM ANDAMENTO 925 $result = 'on-hold'; 926 break; 927 case 9: //CANCELADA 928 $result = 'cancelled'; 929 break; 930 case 10: //PENDENTE DE CONFIRMAÇÃO 931 $result = 'on-hold'; 932 break; 933 case 11: //FALHA NA COMUNICAÇÃO COM FORNECEDOR 934 $result = 'failed'; 935 break; 936 default: 937 $result = 'failed'; 938 break; 939 } 940 941 //Verify billet & transfer payment amount 942 if ( $result == 'processing' ) { 943 $paid_wrong = false; 944 $paid_total = $this->get_gateway_payment_amount( $response ); 945 if ( ! empty( $paid_total ) ) { 946 $order_total = str_replace( array( ',', '.' ), '', $this->get_total_order( $order ) ); 947 $balance = $order_total - $paid_total; 948 if ( $balance > 0 ) { 949 $paid_wrong = true; 950 } 951 } else { 952 $paid_wrong = true; 953 } 954 955 if ( $paid_wrong ) { 956 $result = 'on-hold'; 957 } 958 } 959 } catch ( Exception $e ) { 960 $this->logger( 'Gateway Woocommerce Status Error', $e->getMessage() ); 961 } 962 963 return $result; 964 } 965 966 private function gateway_woocommerce_result( $response ) { 967 $result = 'failure'; 968 try { 969 switch ( $response->status ) { 970 case 0: //TRANSACAO INICIADA 971 $result = 'success'; 972 break; 973 case 1: //AGUARDANDO PAGAMENTO 974 $result = 'success'; 975 break; 976 case 2: //EFETIVADA 977 $result = 'failure'; 978 break; 979 case 3: //EM ANALISE 980 $result = 'success'; 981 break; 982 case 4: //EXPIRADA 983 $result = 'failure'; 984 break; 985 case 5: //AUTORIZADA 986 $result = 'success'; 987 break; 988 case 6: //CONFIRMADA 989 $result = 'success'; 990 break; 991 case 7: //NEGADA 992 $result = 'failure'; 993 break; 994 case 8: //CANCELAMENTO EM ANDAMENTO 995 $result = 'failure'; 996 break; 997 case 9: //CANCELADA 998 $result = 'failure'; 999 break; 1000 case 10: //PENDENTE DE CONFIRMAÇÃO 1001 $result = 'success'; 1002 break; 1003 case 11: //FALHA NA COMUNICAÇÃO COM FORNECEDOR 1004 $result = 'failure'; 1005 break; 1006 default: 1007 $result = 'failure'; 1008 break; 1009 } 1010 } catch ( Exception $e ) { 1011 $this->logger( 'Gateway Woocommerce Result Error', $e->getMessage() ); 1012 } 1013 1014 return $result; 1015 } 1016 1017 private function gateway_woocommerce_message( $order, $response ) { 1018 $result = 'failure'; 1019 try { 1020 switch ( $response->status ) { 1021 case 0: //TRANSACAO INICIADA 1022 $result = esc_html__( 'Transaction started but not confirmed.', 'woocommerce-businesspay' ); 1023 break; 1024 case 1: //AGUARDANDO PAGAMENTO 1025 $result = esc_html__( 'Awating payment.', 'woocommerce-businesspay' ); 1026 break; 1027 case 2: //EFETIVADA 1028 $result = esc_html__( 'Transaction effectivated.', 'woocommerce-businesspay' ); 1029 break; 1030 case 3: //EM ANALISE 1031 $result = esc_html__( 'Transaction under analysis.', 'woocommerce-businesspay' ); 1032 break; 1033 case 4: //EXPIRADA 1034 $result = esc_html__( 'Transaction expired.', 'woocommerce-businesspay' ); 1035 break; 1036 case 5: //AUTORIZADA 1037 $result = esc_html__( 'Transaction authorized.', 'woocommerce-businesspay' ); 1038 break; 1039 case 6: //CONFIRMADA 1040 $result = esc_html__( 'Transaction confirmed.', 'woocommerce-businesspay' ); 1041 break; 1042 case 7: //NEGADA 1043 $result = esc_html__( 'Transaction denied.', 'woocommerce-businesspay' ); 1044 break; 1045 case 8: //CANCELAMENTO EM ANDAMENTO 1046 $result = esc_html__( 'Cancellation in progress.', 'woocommerce-businesspay' ); 1047 break; 1048 case 9: //CANCELADA 1049 $result = esc_html__( 'Transaction Canceled.', 'woocommerce-businesspay' ); 1050 break; 1051 case 10: //PENDENTE DE CONFIRMAÇÃO 1052 $result = esc_html__( 'Transaction pending of confirmation.', 'woocommerce-businesspay' ); 1053 break; 1054 case 11: //FALHA NA COMUNICAÇÃO COM FORNECEDOR 1055 $result = esc_html__( 'Failure to communicate with the provider.', 'woocommerce-businesspay' ); 1056 break; 1057 default: 1058 $result = esc_html__( 'No valid server response.', 'woocommerce-businesspay' ); 1059 break; 1060 } 1061 1062 //Verify billet & transfer payment amount 1063 if ( $result == 'processing' ) { 1064 $paid_wrong = false; 1065 $paid_total = $this->get_gateway_payment_amount( $response ); 1066 if ( ! empty( $paid_total ) ) { 1067 $order_total = str_replace( array( ',', '.' ), '', $this->get_total_order( $order ) ); 1068 $balance = $order_total - $paid_total; 1069 if ( $balance > 0 ) { 1070 $paid_wrong = true; 1071 } 1072 } else { 1073 $paid_wrong = true; 1074 } 1075 1076 if ( $paid_wrong ) { 1077 $result = esc_html__( 'payment made less than the value of the order.', 'woocommerce-businesspay' ); 1078 } 1079 } 1080 } catch ( Exception $e ) { 1081 $this->logger( 'Gateway Woocommerce Message Error', $e->getMessage() ); 1082 } 1083 1084 return $result; 1085 } 1086 1087 1088 //ANTIFRAUD CALLS 1089 1090 private function antifraud_maybe_renew_token() { 1091 $result = false; 1092 try { 1093 $today = current_time( 'mysql' ); 1094 $token = get_option( 'businesspay_antifraud_auth_token' ); 1095 $expiration = get_option( 'businesspay_antifraud_auth_expiration' ); 1096 $this->logger( 'Antifraud Token | today', $today ); 1097 $this->logger( 'Antifraud Token | token', $token ); 1098 $this->logger( 'Antifraud Token | expiration', $expiration ); 1099 1100 $renew = ( $token == '' ) || ( $expiration == '' ) || ( strtotime( $expiration ) < strtotime( $today ) ); 1101 1102 if ( $renew ) { 1103 $retry_num = 0; 1104 while ( $retry_num < 3 ) { 1105 $retry_num ++; 1106 $body = array( 1107 'Name' => ( $this->debug == 'yes' ) ? $this->antifraud_login_demo : $this->antifraud_login_live, 1108 'Password' => ( $this->debug == 'yes' ) ? $this->antifraud_password_demo : $this->antifraud_password_live 1109 ); 1110 1111 $payload = array( 1112 'method' => 'POST', 1113 'sslverify' => true, 1114 'timeout' => 60, 1115 'headers' => array( 1116 'cache-control' => 'no-cache', 1117 'Content-Type' => 'application/json', 1118 ), 1119 'body' => json_encode( $body ) 1120 ); 1121 1122 $url = ( $this->sandbox == 'yes' ) ? $this->antifraud_demo_url . '/api/' . $this->antifraud_demo_version . '/authenticate' : $this->antifraud_live_url . '/' . $this->antifraud_live_version . '/authenticate'; 1123 1124 $this->logger( 'Antifraud Token | $url', $url ); 1125 $this->logger( 'Antifraud Token | PAYLOAD', $payload ); 1126 $response = wp_safe_remote_post( $url, $payload ); 1127 1128 $this->logger( 'Antifraud Token | Response', $response ); 1129 1130 if ( ! is_wp_error( $response ) ) { 1131 $response = json_decode( wp_remote_retrieve_body( $response ) ); 1132 if ( ! empty( $response ) ) { 1133 $this->set_option_antifraud_auth_token( $response->Token ); 1134 $this->set_option_antifraud_auth_expiration( $response->ExpirationDate ); 1135 $retry_num = 3; 1136 $result = true; 1723 1137 } 1724 1138 } 1725 1139 } 1140 } else { 1141 $result = true; 1726 1142 } 1727 1143 } catch ( Exception $e ) { 1728 $this->logger( 'Get Session Info Error', $e->getMessage() ); 1729 } 1730 } 1731 1732 private function get_session_id() { 1733 $result = session_id(); 1734 if ( empty( $result ) ) { 1735 session_start(); 1736 $result = session_id(); 1144 $this->logger( 'Antifraud Renew Token Error', $e->getMessage() ); 1737 1145 } 1738 1146 … … 1740 1148 } 1741 1149 1742 1743 //GATEWAY GETTERS 1150 private function antifraud_maybe_do_analysis( $order, $gateway_response ) { 1151 if ( $this->enable_antifraud && $gateway_response->status == 5 ) { 1152 $oid = $this->get_order_id( $order ); 1153 $transaction_type = get_post_meta( $oid, '_businesspay-transaction-type', true ); 1154 if ( $transaction_type == 'credit-card' || $transaction_type == 'debit-card' ) { 1155 $this->antifraud_do_analysis( $order ); 1156 } 1157 } 1158 } 1159 1160 private function antifraud_do_analysis( $order ) { 1161 $result = array( 'result' => 'failure', 'messages' => '' ); 1162 if ( $this->antifraud_maybe_renew_token() ) { 1163 $retry_num = 0; 1164 while ( $retry_num < 3 ) { 1165 $retry_num ++; 1166 try { 1167 $af_items_order = $order->get_items(); 1168 $arr_items = array(); 1169 1170 foreach ( $af_items_order as $af_item_order ) { 1171 $arr_item = array( 1172 'code' => $this->get_antifraud_item_id( $af_item_order ), 1173 'name' => $this->get_antifraud_item_name( $af_item_order ), 1174 'value' => $this->get_antifraud_item_value( $af_item_order ), 1175 'amount' => $this->get_antifraud_item_amount( $af_item_order ), 1176 'categoryID' => $this->get_antifraud_item_category_id( $af_item_order ), 1177 'categoryName' => $this->get_antifraud_item_category_name( $af_item_order ), 1178 ); 1179 array_push( $arr_items, $arr_item ); 1180 } 1181 1182 $arr_order = array( 1183 'code' => $this->get_antifraud_order_id( $order ), 1184 'sessionID' => $this->get_antifraud_order_fingerprint(), 1185 'date' => $this->get_antifraud_order_date( $order ), 1186 'email' => $this->get_antifraud_order_email( $order ), 1187 'itemValue' => $this->get_antifraud_order_total_items( $order ), 1188 'totalValue' => $this->get_antifraud_order_total_order( $order ), 1189 'numberOfInstallments' => $this->get_antifraud_order_qtd_installments( $order ), 1190 'ip' => $this->get_antifraud_order_ip( $order ), 1191 'observation' => $this->get_antifraud_order_obs( $order ), 1192 'origin' => $this->get_antifraud_order_origin(), 1193 'channelID' => $this->get_antifraud_order_channel_id(), 1194 'product' => $this->get_antifraud_order_product_id(), 1195 'billing' => array( 1196 'clientID' => $this->get_antifraud_billing_client_id( $order ), 1197 'type' => $this->get_antifraud_billing_person_type( $order ), 1198 'primaryDocument' => $this->get_antifraud_billing_document( $order ), 1199 'name' => $this->get_antifraud_billing_name( $order ), 1200 'email' => $this->get_antifraud_billing_email( $order ), 1201 'address' => array( 1202 'street' => $this->get_antifraud_billing_street( $order ), 1203 'number' => $this->get_antifraud_billing_street_number( $order ), 1204 'additionalInformation' => $this->get_antifraud_billing_complement( $order ), 1205 'county' => $this->get_antifraud_billing_county( $order ), 1206 'city' => $this->get_antifraud_billing_city( $order ), 1207 'state' => $this->get_antifraud_billing_state( $order ), 1208 'zipcode' => $this->get_antifraud_billing_zipcode( $order ), 1209 'country' => $this->get_antifraud_billing_country( $order ), 1210 ), 1211 'phones' => array( 1212 array( 1213 'type' => $this->get_antifraud_billing_phone_type( $order ), 1214 'ddi' => $this->get_antifraud_billing_phone_ddi(), 1215 'ddd' => $this->get_antifraud_billing_phone_ddd( $order ), 1216 'number' => $this->get_antifraud_billing_phone_number( $order ), 1217 ), 1218 ), 1219 ), 1220 'shipping' => array( 1221 'clientID' => $this->get_antifraud_shipping_client_id( $order ), 1222 'type' => $this->get_antifraud_shipping_person_type( $order ), 1223 'primaryDocument' => $this->get_antifraud_shipping_document( $order ), 1224 'name' => $this->get_antifraud_shipping_name( $order ), 1225 'email' => $this->get_antifraud_shipping_email( $order ), 1226 'address' => array( 1227 'street' => $this->get_antifraud_shipping_street( $order ), 1228 'number' => $this->get_antifraud_shipping_street_number( $order ), 1229 'additionalInformation' => $this->get_antifraud_shipping_complement( $order ), 1230 'county' => $this->get_antifraud_shipping_county( $order ), 1231 'city' => $this->get_antifraud_shipping_city( $order ), 1232 'state' => $this->get_antifraud_shipping_state( $order ), 1233 'zipcode' => $this->get_antifraud_shipping_zipcode( $order ), 1234 'country' => $this->get_antifraud_shipping_country( $order ), 1235 ), 1236 'phones' => array( 1237 array( 1238 'type' => $this->get_antifraud_shipping_phone_type( $order ), 1239 'ddi' => $this->get_antifraud_shipping_phone_ddi(), 1240 'ddd' => $this->get_antifraud_shipping_phone_ddd( $order ), 1241 'number' => $this->get_antifraud_shipping_phone_number( $order ), 1242 ), 1243 ), 1244 'price' => $this->get_antifraud_shipping_delivery_price( $order ), 1245 ), 1246 'payments' => array( 1247 array( 1248 'date' => $this->get_antifraud_payment_date( $order ), 1249 'value' => $this->get_antifraud_payment_value( $order ), 1250 'type' => $this->get_antifraud_payment_type( $order ), 1251 'installments' => $this->get_antifraud_payment_qtd_installments( $order ), 1252 'card' => array( 1253 'bin' => $this->get_antifraud_payment_card_bin( $order ), 1254 'end' => $this->get_antifraud_payment_card_end( $order ), 1255 'type' => $this->get_antifraud_payment_card_type( $order ), 1256 'validityDate' => $this->get_antifraud_payment_card_expiration( $order ), 1257 'ownerName' => $this->get_antifraud_payment_card_holder_name( $order ), 1258 'document' => $this->get_antifraud_payment_card_legal_document( $order ), 1259 ), 1260 ), 1261 ), 1262 'items' => $arr_items 1263 ); 1264 1265 $response = $this->antifraud_api_request( 'POST', 'orders', $arr_order ); 1266 if ( ! $response->result == 'failure' ) { 1267 $this->antifraud_insert_order_metadata( $order, $response ); 1268 $response = $this->antifraud_insert_order_status( $order, $response ); 1269 $retry_num = 3; 1270 $result = $response; 1271 } 1272 } catch ( Exception $e ) { 1273 $this->logger( 'Antifraud Authorization Card Error', $e->getMessage() ); 1274 } 1275 } 1276 } else { 1277 $this->logger( 'Antifraud Do Analysis', 'Antifraud Renew Token Error' ); 1278 } 1279 1280 return $result; 1281 } 1282 1283 private function antifraud_api_request( $method, $endpoint, $body ) { 1284 $result = array( 'result' => 'failure', 'messages' => '' ); 1285 try { 1286 $payload = array( 1287 'method' => $method, 1288 'sslverify' => true, 1289 'timeout' => 60, 1290 'headers' => array( 1291 'Content-Type' => 'application/json', 1292 'Authorization' => 'Bearer ' . $this->antifraud_auth_token, 1293 ), 1294 'body' => json_encode( $body ) 1295 ); 1296 1297 $url = ( $this->sandbox == 'yes' ) ? $this->antifraud_demo_url . '/api/' . $this->antifraud_demo_version . '/' . $endpoint : $this->antifraud_live_url . '/' . $this->antifraud_live_version . '/' . $endpoint; 1298 1299 $this->logger( 'API Antifraud Request | Body', $body ); 1300 $response = wp_safe_remote_post( $url, $payload ); 1301 1302 if ( ! is_wp_error( $response ) ) { 1303 $response_json = json_decode( wp_remote_retrieve_body( $response ) ); 1304 $this->logger( 'API Antifraud Response | JSON', $response_json ); 1305 if ( ! empty( $response_json ) ) { 1306 $result = $response_json; 1307 } else { 1308 wc_add_notice( esc_html__( 'The credentials for this virtual store are not valid on the BusinessPay server. Please try again.', 'woocommerce-businesspay' ), 'error' ); 1309 } 1310 } else { 1311 wc_add_notice( esc_html__( 'Could not receive a valid server response. Please try again.', 'woocommerce-businesspay' ), 'error' ); 1312 } 1313 } catch ( Exception $e ) { 1314 $this->logger( 'Antifraud API Request Error', $e->getMessage() ); 1315 } 1316 1317 return $result; 1318 } 1319 1320 private function antifraud_insert_order_metadata( $order, $response ) { 1321 try { 1322 if ( ! isset( $response->Message ) ) { 1323 $order_id = $this->get_order_id( $order ); 1324 $this->antifraud_remove_order_metadata( $order_id ); 1325 1326 update_post_meta( $order_id, '_businesspay-antifraud-transaction-date', current_time( 'mysql' ) ); 1327 1328 if ( isset( $response->packageID ) ) { 1329 update_post_meta( $order_id, '_businesspay-antifraud-transaction-id', $response->packageID ); 1330 } 1331 1332 if ( isset( $response->orders[0]->status ) ) { 1333 update_post_meta( $order_id, '_businesspay-antifraud-status-code', $response->orders[0]->status ); 1334 update_post_meta( $order_id, '_businesspay-antifraud-message', $this->antifraud_woocommerce_message( $response ) ); 1335 } 1336 1337 if ( isset( $response->orders[0]->score ) ) { 1338 update_post_meta( $order_id, '_businesspay-antifraud-score', $response->orders[0]->score ); 1339 } 1340 } 1341 } catch ( Exception $e ) { 1342 $this->logger( 'Gateway Insert Order Metadata Error', $e->getMessage() ); 1343 } 1344 } 1345 1346 private function antifraud_insert_order_status( $order, $response ) { 1347 $result = array( 'result' => 'failure', 'messages' => '' ); 1348 try { 1349 $res_status = $this->antifraud_woocommerce_status( $response ); 1350 $res_result = $this->antifraud_woocommerce_result( $response ); 1351 $res_message = $this->antifraud_woocommerce_message( $response ); 1352 1353 if ( $res_result == 'success' ) { 1354 $res_note = esc_html__( 'Antifraud Status: ', 'woocommerce-businesspay' ) . $res_message; 1355 $this->update_order_status( $order, $res_status, $res_note ); 1356 1357 $analysis = $response->orders[0]->status; 1358 if ( in_array( $analysis, array( 'APA', 'APM', 'APP' ) ) ) { 1359 $this->gateway_do_capture( $order ); 1360 } 1361 } else { 1362 $result = array( 1363 'result' => $res_result, 1364 'messages' => $res_message 1365 ); 1366 $this->update_order_status( $order, 'failed', $res_message ); 1367 } 1368 } catch ( Exception $e ) { 1369 $this->logger( 'Antifraud Insert Order Status Error', $e->getMessage() ); 1370 } 1371 1372 return $result; 1373 } 1374 1375 private function antifraud_remove_order_metadata( $order_id ) { 1376 delete_post_meta( $order_id, '_businesspay-antifraud-transaction-date' ); 1377 delete_post_meta( $order_id, '_businesspay-antifraud-transaction-id' ); 1378 delete_post_meta( $order_id, '_businesspay-antifraud-status-code' ); 1379 delete_post_meta( $order_id, '_businesspay-antifraud-score' ); 1380 delete_post_meta( $order_id, '_businesspay-antifraud-message' ); 1381 } 1382 1383 //ANTIFRAUD STATUS 1384 1385 private function antifraud_woocommerce_status( $response ) { 1386 $result = 'failed'; 1387 try { 1388 switch ( $response->orders[0]->status ) { 1389 case 'APA': //APROVAÇÃO AUTOMÁTICA 1390 $result = 'on-hold'; 1391 break; 1392 case 'AMA': //ANÁLISE MANUAL 1393 $result = 'on-hold'; 1394 break; 1395 case 'APM': //APROVAÇÃO MANUAL 1396 $result = 'on-hold'; 1397 break; 1398 case 'APP': //APROVAÇÃO POR POLÍTICA 1399 $result = 'on-hold'; 1400 break; 1401 case 'CAN': //CANCELADO PELO CLIENTE 1402 $result = 'cancelled'; 1403 break; 1404 case 'FRD': //FRAUDE CONFIRMADA 1405 $result = 'failed'; 1406 break; 1407 case 'NVO': //NOVO 1408 $result = 'on-hold'; 1409 break; 1410 case 'RPA': //REPROVAÇÃO AUTOMÁTICA 1411 $result = 'failed'; 1412 break; 1413 case 'RPM': //REPROVAÇÃO SEM SUSPEITA 1414 $result = 'failed'; 1415 break; 1416 case 'RPP': //REPROVAÇÃO POR POLÍTICA 1417 $result = 'failed'; 1418 break; 1419 case 'SUS': //SUSPENSÃO MANUAL 1420 $result = 'failed'; 1421 break; 1422 default: 1423 $result = 'failed'; 1424 break; 1425 } 1426 } catch ( Exception $e ) { 1427 $this->logger( 'Antifraud Woocommerce Status Error', $e->getMessage() ); 1428 } 1429 1430 return $result; 1431 } 1432 1433 private function antifraud_woocommerce_result( $response ) { 1434 $result = 'failure'; 1435 try { 1436 switch ( $response->orders[0]->status ) { 1437 case 'APA': //APROVAÇÃO AUTOMÁTICA 1438 $result = 'success'; 1439 break; 1440 case 'AMA': //ANÁLISE MANUAL 1441 $result = 'success'; 1442 break; 1443 case 'APM': //APROVAÇÃO MANUAL 1444 $result = 'success'; 1445 break; 1446 case 'APP': //APROVAÇÃO POR POLÍTICA 1447 $result = 'success'; 1448 break; 1449 case 'CAN': //CANCELADO PELO CLIENTE 1450 $result = 'success'; 1451 break; 1452 case 'FRD': //FRAUDE CONFIRMADA 1453 $result = 'success'; 1454 break; 1455 case 'NVO': //NOVO 1456 $result = 'success'; 1457 break; 1458 case 'RPA': //REPROVAÇÃO AUTOMÁTICA 1459 $result = 'success'; 1460 break; 1461 case 'RPM': //REPROVAÇÃO SEM SUSPEITA 1462 $result = 'success'; 1463 break; 1464 case 'RPP': //REPROVAÇÃO POR POLÍTICA 1465 $result = 'success'; 1466 break; 1467 case 'SUS': //SUSPENSÃO MANUAL 1468 $result = 'success'; 1469 break; 1470 default: 1471 $result = 'failure'; 1472 break; 1473 } 1474 } catch ( Exception $e ) { 1475 $this->logger( 'Gateway Woocommerce Result Error', $e->getMessage() ); 1476 } 1477 1478 return $result; 1479 } 1480 1481 private function antifraud_woocommerce_message( $response ) { 1482 $result = 'failure'; 1483 try { 1484 switch ( $response->orders[0]->status ) { 1485 case 'APA': //APROVAÇÃO AUTOMÁTICA 1486 $result = esc_html__( 'Order was automatically approved according to parameters defined in the automatic approval rule.', 'woocommerce-businesspay' ); 1487 break; 1488 case 'AMA': //ANÁLISE MANUAL 1489 $result = esc_html__( 'Order is queued for analysis.', 'woocommerce-businesspay' ); 1490 break; 1491 case 'APM': //APROVAÇÃO MANUAL 1492 $result = esc_html__( 'Order manually approved by decision-making of an analyst.', 'woocommerce-businesspay' ); 1493 break; 1494 case 'APP': //APROVAÇÃO POR POLÍTICA 1495 $result = esc_html__( 'Order approved automatically by client-established policy or antifraud software rule.', 'woocommerce-businesspay' ); 1496 break; 1497 case 'CAN': //CANCELADO PELO CLIENTE 1498 $result = esc_html__( 'Canceled by customer or duplicated order.', 'woocommerce-businesspay' ); 1499 break; 1500 case 'FRD': //FRAUDE CONFIRMADA 1501 $result = esc_html__( 'Order imputed as fraud confirmed by contact with the card administrator and / or contact with the card holder or CPF of the registry that is unaware of the purchase.', 'woocommerce-businesspay' ); 1502 break; 1503 case 'NVO': //NOVO 1504 $result = esc_html__( 'Order imported and not classified Score by the analyzer yet.', 'woocommerce-businesspay' ); 1505 break; 1506 case 'RPA': //REPROVAÇÃO AUTOMÁTICA 1507 $result = esc_html__( 'Order Automatically Disapproved by some type of business rule that needs to be applied.', 'woocommerce-businesspay' ); 1508 break; 1509 case 'RPM': //REPROVAÇÃO SEM SUSPEITA 1510 $result = esc_html__( 'Order disapproved without suspicion by lack of contact with the client within the agreed period and / or social security number of restrictive policies (Irregular, SUS or Canceled).', 'woocommerce-businesspay' ); 1511 break; 1512 case 'RPP': //REPROVAÇÃO POR POLÍTICA 1513 $result = esc_html__( 'Order disapproved automatically by policy established by customer or antifraud software.', 'woocommerce-businesspay' ); 1514 break; 1515 case 'SUS': //SUSPENSÃO MANUAL 1516 $result = esc_html__( 'Order automatically approved by policy established by the customer or antifraud software.', 'woocommerce-businesspay' ); 1517 break; 1518 default: 1519 $result = 'failure'; 1520 break; 1521 } 1522 } catch ( Exception $e ) { 1523 $this->logger( 'Gateway Woocommerce Message Error', $e->getMessage() ); 1524 } 1525 1526 return $result; 1527 } 1528 1529 1530 //WEBHOOK CALLBACK 1531 1532 public function webhook_callback() { 1533 $contents = file_get_contents( "php://input" ); 1534 $json = json_decode( $contents ); 1535 $this->logger( 'API Notification | Body', $json ); 1536 1537 if ( isset( $json->transactionId ) && isset( $json->referenceId ) ) { 1538 $this->gateway_maybe_consult_status( $json->referenceId, $json->transactionId ); 1539 } elseif ( isset( $json->code ) && isset( $json->date ) && isset( $json->type ) ) { 1540 $this->antifraud_maybe_consult_status( $json->code, $json->type ); 1541 } else { 1542 $this->logger( 'WebHook Callback Error', 'Fields not detected. Suspicious call.' ); 1543 } 1544 } 1545 1546 private function gateway_maybe_consult_status( $order_id, $transactionId ) { 1547 $result = false; 1548 try { 1549 $order = wc_get_order( $order_id ); 1550 if ( ! is_wp_error( $order ) ) { 1551 if ( $transactionId == $order->get_transaction_id() ) { 1552 $body = array( 'transactionId' => $transactionId ); 1553 $response = $this->gateway_api_request( 'GET', '/transactions/' . $transactionId, $body ); 1554 if ( ! isset( $response->result ) ) { 1555 $this->gateway_insert_order_metadata( $order, $response ); 1556 $res_status = $this->gateway_insert_order_status( $order, $response ); 1557 1558 if ( $res_status['result'] == 'success' ) { 1559 $this->antifraud_maybe_do_analysis( $order, $response ); 1560 } 1561 $result = $res_status; 1562 } 1563 } else { 1564 $this->logger( 'Gateway Webhook consult status error', 'Incorrect Transaction ID' ); 1565 } 1566 } 1567 } catch ( Exception $e ) { 1568 $this->logger( 'Gateway API Consult Status Error', $e->getMessage() ); 1569 } 1570 1571 return $result; 1572 } 1573 1574 private function antifraud_maybe_consult_status( $order_id, $type ) { 1575 $result = false; 1576 try { 1577 $order = wc_get_order( $order_id ); 1578 if ( ! is_wp_error( $order ) ) { 1579 if ( $type == 'status' ) { 1580 $body = ''; 1581 $response = $this->antifraud_api_request( 'GET', '/orders/' . $order_id . '/status', $body ); 1582 if ( ! isset( $response->result ) ) { 1583 $this->antifraud_insert_order_metadata( $order, $response ); 1584 $result = $this->antifraud_insert_order_status( $order, $response ); 1585 } 1586 } else { 1587 $this->logger( 'Antifraud Webhook consult status error', 'Incorrect type value' ); 1588 } 1589 } 1590 } catch ( Exception $e ) { 1591 $this->logger( 'Antifraud API Consult Status Error', $e->getMessage() ); 1592 } 1593 1594 return $result; 1595 } 1596 1597 1598 //ADMIN METABOXES 1599 1600 public function businesspay_admin_panel_gateway() { 1601 wc_get_template( 'businesspay-panel-gateway.php', array( 'bpConfig' => $this ), 'woocommerce/businesspay/', WC_BusinessPay::get_templates_path() ); 1602 } 1603 1604 public function businesspay_admin_panel_antifraud() { 1605 wc_get_template( 'businesspay-panel-antifraud.php', array( 'bpConfig' => $this ), 'woocommerce/businesspay/', WC_BusinessPay::get_templates_path() ); 1606 } 1607 1608 1609 //GATEWAY GETTERS - Order 1610 1611 private function get_gateway_selected_method( $fields ) { 1612 $payment_type = $this->get_gateway_selected_tab( $fields ); 1613 $method = $payment_type; 1614 if ( $payment_type == 'card' ) { 1615 $installments = $this->get_gateway_payment_card_installments( $fields ); 1616 if ( $installments == 'debit' ) { 1617 $method = $installments; 1618 } else { 1619 $method = 'credit'; 1620 } 1621 } 1622 1623 return $method; 1624 } 1744 1625 1745 1626 private function get_gateway_selected_tab( $fields ) { … … 1747 1628 } 1748 1629 1749 private function get_gateway_card_number( $fields ) { 1630 private function get_gateway_order_reference_id( $order ) { 1631 return $this->get_order_id( $order ); 1632 } 1633 1634 private function get_gateway_order_amount( $order ) { 1635 return str_replace( '.', '', $order->order_total ); 1636 } 1637 1638 private function get_gateway_order_description() { 1639 return esc_html__( 'Woocommerce Order', 'woocommerce-businesspay' ); 1640 } 1641 1642 private function get_gateway_order_postback_url() { 1643 return $this->get_postback_url(); 1644 } 1645 1646 //GATEWAY GETTERS - Payment 1647 1648 private function get_gateway_payment_type( $fields ) { 1649 $installments = sanitize_text_field( $fields['businesspay_installments'] ); 1650 if ( $installments == 'debit' ) { 1651 $type = '2'; 1652 } else { 1653 $type = '1'; 1654 } 1655 1656 return $type; 1657 } 1658 1659 private function get_gateway_payment_card_capture() { 1660 return $this->enable_antifraud ? 'false' : 'true'; 1661 } 1662 1663 private function get_gateway_payment_card_save() { 1664 //Save card to create token 1665 return 'false'; 1666 } 1667 1668 private function get_gateway_payment_card_interest_type() { 1669 //3: Parcelado loja. 4: Parcelado Administrador 1670 return 3; 1671 } 1672 1673 private function get_gateway_payment_card_authenticate() { 1674 //1: Somente transações autenticadas. 2: Autenticadas e não autenticadas. 3: Autorizar sem autenticação. 1675 return 1; 1676 } 1677 1678 private function get_gateway_payment_card_recurrent() { 1679 return 'false'; 1680 } 1681 1682 private function get_gateway_payment_card_soft_descriptor() { 1683 return $this->name_in_invoice; 1684 } 1685 1686 private function get_gateway_payment_card_info_number( $fields ) { 1750 1687 return str_replace( ' ', '', sanitize_text_field( $fields['businesspay_card_number'] ) ); 1751 1688 } 1752 1689 1753 private function get_gateway_card_brand( $fields ) { 1754 return sanitize_text_field( $fields['businesspay_card_brand'] ); 1755 } 1756 1757 private function get_gateway_card_holder_name( $fields ) { 1690 private function get_gateway_payment_card_info_brand( $fields ) { 1691 $brand = strtolower( str_replace( array( ' ' ), '', sanitize_text_field( $fields['businesspay_card_brand'] ) ) ); 1692 1693 switch ( $brand ) { 1694 case 'visa': 1695 $result = 'Visa'; 1696 break; 1697 case 'mastercard': 1698 $result = 'Mastercard'; 1699 break; 1700 case 'amex': 1701 $result = 'American Express'; 1702 break; 1703 case 'elo': 1704 $result = 'Elo'; 1705 break; 1706 case 'hipercard': 1707 $result = 'Hipercard'; 1708 break; 1709 case 'hiper': 1710 $result = 'Hiper'; 1711 break; 1712 case 'aura': 1713 $result = 'Aura'; 1714 break; 1715 case 'discover': 1716 $result = 'Discover'; 1717 break; 1718 case 'jcb': 1719 $result = 'JCB'; 1720 break; 1721 default: 1722 $result = ''; 1723 break; 1724 } 1725 1726 return $result; 1727 } 1728 1729 private function get_gateway_payment_card_info_holder_name( $fields ) { 1758 1730 return sanitize_text_field( $fields['businesspay_holder_name'] ); 1759 1731 } 1760 1732 1761 private function get_gateway_ card_expiry( $fields ) {1733 private function get_gateway_payment_card_info_expiry( $fields ) { 1762 1734 return sanitize_text_field( $fields['businesspay_expiry'] ); 1763 1735 } 1764 1736 1765 private function get_gateway_ card_expiry_month( $fields ) {1766 $temp_date = explode( '/', $this->get_gateway_ card_expiry( $fields ) );1737 private function get_gateway_payment_card_info_expiry_month( $fields ) { 1738 $temp_date = explode( '/', $this->get_gateway_payment_card_info_expiry( $fields ) ); 1767 1739 1768 1740 return trim( $temp_date[0] ); 1769 1741 } 1770 1742 1771 private function get_gateway_ card_expiry_year( $fields ) {1772 $temp_date = explode( '/', $this->get_gateway_ card_expiry( $fields ) );1743 private function get_gateway_payment_card_info_expiry_year( $fields ) { 1744 $temp_date = explode( '/', $this->get_gateway_payment_card_info_expiry( $fields ) ); 1773 1745 1774 1746 return trim( $temp_date[1] ); 1775 1747 } 1776 1748 1777 private function get_gateway_ card_cvv( $fields ) {1749 private function get_gateway_payment_card_info_cvv( $fields ) { 1778 1750 return sanitize_text_field( $fields['businesspay_cvv'] ); 1779 1751 } 1780 1752 1781 private function get_gateway_card_installments( $fields ) { 1782 return sanitize_text_field( $fields['businesspay_installments'] ); 1783 } 1784 1785 private function get_gateway_card_document( $fields ) { 1753 private function get_gateway_payment_card_installments( $fields ) { 1754 $installments = sanitize_text_field( $fields['businesspay_installments'] ); 1755 if ( $installments == 'debit' ) { 1756 $installments = '1'; 1757 } 1758 1759 return $installments; 1760 } 1761 1762 private function get_gateway_payment_card_document( $fields ) { 1786 1763 return str_replace( array( '.', '/', '-', ' ' ), '', sanitize_text_field( $fields['businesspay_doc'] ) ); 1787 1764 } 1788 1765 1789 private function get_gateway_transfer_bank( $fields ) { 1790 return sanitize_text_field( $fields['businesspay_transfer_bank'] ); 1791 } 1792 1793 private function get_gateway_billet_bank( $fields ) { 1794 return sanitize_text_field( $fields['businesspay_billet_bank'] ); 1795 } 1796 1797 private function get_gateway_billing_neighborhood( $fields ) { 1798 return sanitize_text_field( $fields['billing_neighborhood'] ); 1799 } 1800 1801 private function get_gateway_customer_name( $fields ) { 1802 return sanitize_text_field( $fields['billing_first_name'] . ' ' . $fields['billing_last_name'] ); 1803 } 1804 1805 private function get_gateway_customer_document( $fields ) { 1806 return sanitize_text_field( $fields['billing_cpf'] ); 1807 } 1808 1809 private function get_gateway_customer_email( $fields ) { 1810 return sanitize_email( $fields['billing_email'] ); 1811 } 1812 1813 private function get_gateway_customer_address( $fields ) { 1814 return sanitize_text_field( $fields['billing_address_1'] ); 1815 } 1816 1817 private function get_gateway_customer_address_number( $fields ) { 1818 return sanitize_text_field( $fields['billing_number'] ); 1819 } 1820 1821 private function get_gateway_customer_address_complement( $fields ) { 1822 return sanitize_text_field( $fields['billing_address_2'] ); 1823 } 1824 1825 private function get_gateway_customer_address_district( $fields ) { 1826 return sanitize_text_field( $fields['billing_neighborhood'] ); 1827 } 1828 1829 private function get_gateway_customer_address_zipcode( $fields ) { 1830 return str_replace( '-', '', sanitize_text_field( $fields['billing_postcode'] ) ); 1831 } 1832 1833 private function get_gateway_customer_address_city( $fields ) { 1834 return sanitize_text_field( $fields['billing_city'] ); 1835 } 1836 1837 private function get_gateway_customer_address_state( $fields ) { 1838 return sanitize_text_field( $fields['billing_state'] ); 1766 private function get_gateway_payment_billet_expiration_date() { 1767 $interval = $this->billet_number_days; 1768 if ( empty( $interval ) ) { 1769 $interval = $this->default_billet_expiration_days; 1770 } 1771 try { 1772 $expiration = new DateTime(); 1773 $interval_spec = 'P' . $interval . 'D'; 1774 $expiration->add( new DateInterval( $interval_spec ) ); 1775 $result = $expiration->format( 'Y-m-d' ); 1776 } catch ( Exception $e ) { 1777 $result = false; 1778 $this->logger( 'Get Billet Expiration Error', $e->getMessage() ); 1779 } 1780 1781 return $result; 1782 } 1783 1784 private function get_gateway_payment_billet_instruction() { 1785 return $this->billet_instruction_1; 1786 } 1787 1788 private function get_gateway_payment_billet_guarantor() { 1789 return 'Comprador'; 1839 1790 } 1840 1791 … … 1852 1803 } 1853 1804 1854 1855 //ANTIFRAUD GETTERS 1805 private function get_gateway_payment_transfer_provider( $fields ) { 1806 return sanitize_text_field( $fields['businesspay_transfer_bank'] ); 1807 } 1808 1809 private function get_gateway_payment_billet_provider( $fields ) { 1810 return sanitize_text_field( $fields['businesspay_billet_bank'] ); 1811 } 1812 1813 //GATEWAY GETTERS - Customer 1814 1815 private function get_gateway_customer_name( $fields ) { 1816 $payment_type = $this->get_gateway_selected_tab( $fields ); 1817 $name = ''; 1818 switch ( $payment_type ) { 1819 case 'card': 1820 $name = $this->get_gateway_payment_card_info_holder_name( $fields ); 1821 break; 1822 case 'transfer': 1823 $name = sanitize_text_field( $fields['billing_first_name'] . ' ' . $fields['billing_last_name'] ); 1824 break; 1825 case 'billet': 1826 $name = sanitize_text_field( $fields['billing_first_name'] . ' ' . $fields['billing_last_name'] ); 1827 break; 1828 } 1829 1830 return $name; 1831 } 1832 1833 private function get_gateway_customer_document( $fields ) { 1834 $payment_type = $this->get_gateway_selected_tab( $fields ); 1835 $doc = ''; 1836 switch ( $payment_type ) { 1837 case 'card': 1838 $doc = $this->get_gateway_payment_card_document( $fields ); 1839 break; 1840 case 'transfer': 1841 $doc = sanitize_text_field( $fields['billing_cpf'] ); 1842 break; 1843 case 'billet': 1844 $doc = sanitize_text_field( $fields['billing_cpf'] ); 1845 break; 1846 } 1847 1848 return $doc; 1849 } 1850 1851 private function get_gateway_customer_email( $fields ) { 1852 return sanitize_email( $fields['billing_email'] ); 1853 } 1854 1855 private function get_gateway_customer_address( $fields ) { 1856 return sanitize_text_field( $fields['billing_address_1'] ); 1857 } 1858 1859 private function get_gateway_customer_address_number( $fields ) { 1860 return sanitize_text_field( $fields['billing_number'] ); 1861 } 1862 1863 private function get_gateway_customer_address_complement( $fields ) { 1864 return sanitize_text_field( $fields['billing_address_2'] ); 1865 } 1866 1867 private function get_gateway_customer_address_district( $fields ) { 1868 return sanitize_text_field( $fields['billing_neighborhood'] ); 1869 } 1870 1871 private function get_gateway_customer_address_zipcode( $fields ) { 1872 return str_replace( '-', '', sanitize_text_field( $fields['billing_postcode'] ) ); 1873 } 1874 1875 private function get_gateway_customer_address_city( $fields ) { 1876 return sanitize_text_field( $fields['billing_city'] ); 1877 } 1878 1879 private function get_gateway_customer_address_state( $fields ) { 1880 return sanitize_text_field( $fields['billing_state'] ); 1881 } 1882 1883 //GATEWAY GETTERS - Billing 1884 1885 private function get_gateway_billing_neighborhood( $fields ) { 1886 return sanitize_text_field( $fields['billing_neighborhood'] ); 1887 } 1888 1889 1890 //ANTIFRAUD GETTERS - Order 1891 1892 private function get_antifraud_order_id( $order ) { 1893 return (string) $this->get_order_id( $order ); 1894 } 1856 1895 1857 1896 private function get_antifraud_order_fingerprint() { … … 1867 1906 } 1868 1907 1869 private function get_antifraud_order_shipping_price( $order ) {1870 return $order->get_shipping_total();1871 }1872 1873 1908 private function get_antifraud_order_total_items( $order ) { 1874 return $order->get_item_count(); 1909 return $order->get_subtotal(); 1910 } 1911 1912 private function get_antifraud_order_total_order( $order ) { 1913 return (float) $order->get_total(); 1875 1914 } 1876 1915 1877 1916 private function get_antifraud_order_qtd_installments( $order ) { 1878 return sanitize_text_field( get_post_meta( $this->get_order_id( $order ), '_businesspay-card-installments', true ) );1917 return (integer) sanitize_text_field( get_post_meta( $this->get_order_id( $order ), '_businesspay-card-installments', true ) ); 1879 1918 } 1880 1919 … … 1887 1926 } 1888 1927 1889 private function get_antifraud_order_reanalyze( $order ) { 1890 $reanalyze = get_post_meta( $this->get_order_id( $order ), '_businesspay-antifraud-reanalyze', true ); 1891 if ( empty( $reanalyze ) ) { 1892 $reanalyze = '0'; 1893 } 1894 1895 return $reanalyze; 1928 private function get_antifraud_order_origin() { 1929 return sanitize_text_field( $this->get_blog_domain() ); 1930 } 1931 1932 private function get_antifraud_order_channel_id() { 1933 return sanitize_text_field( $this->get_blog_name() ); 1934 } 1935 1936 private function get_antifraud_order_product_id() { 1937 return (integer) $this->antifraud_product_id; 1938 } 1939 1940 private function get_antifraud_order_product_name() { 1941 switch ( $this->antifraud_product_id ) { 1942 case '1': 1943 $result = 'Realtime Decision'; 1944 break; 1945 case '2': 1946 $result = 'Total ClearSale'; 1947 break; 1948 case '3': 1949 $result = 'Total Garantido'; 1950 break; 1951 case '4': 1952 $result = 'Application'; 1953 break; 1954 default: 1955 $result = ''; 1956 break; 1957 } 1958 1959 return $result; 1960 } 1961 1962 //ANTIFRAUD GETTERS - Billing 1963 1964 private function get_antifraud_billing_client_id( $order ) { 1965 return sanitize_text_field( $order->get_user_id() ); 1896 1966 } 1897 1967 1898 1968 private function get_antifraud_billing_person_type( $order ) { 1899 return sanitize_text_field( $order->get_meta( '_billing_persontype' ) );1969 return (integer) sanitize_text_field( $order->get_meta( '_billing_persontype' ) ); 1900 1970 } 1901 1971 … … 1916 1986 1917 1987 private function get_antifraud_billing_name( $order ) { 1918 $name = sanitize_text_field( $order->get_billing_first_name() . ' ' . $order->get_billing_last_name() ); 1919 1920 return $name; 1988 return sanitize_text_field( $order->get_billing_first_name() . ' ' . $order->get_billing_last_name() ); 1921 1989 } 1922 1990 … … 1960 2028 $phone = str_replace( array( '(', ')', ' ', '-' ), '', sanitize_text_field( $order->get_billing_phone() ) ); 1961 2029 if ( strlen( $phone ) >= 11 ) { 1962 $result = '6';2030 $result = 6; 1963 2031 } //Celular 1964 elseif ( $this->get_antifraud_billing_person_type( $ this->get_order_id( $order ) ) == '1') { //Pessoa física1965 $result = '1'; //Residencial2032 elseif ( $this->get_antifraud_billing_person_type( $order ) == 1 ) { //Pessoa física 2033 $result = 1; //Residencial 1966 2034 } else { //Pessoa jurídica 1967 $result = '2'; //Comercial2035 $result = 2; //Comercial 1968 2036 } 1969 2037 1970 2038 return $result; 2039 } 2040 2041 private function get_antifraud_billing_phone_ddi() { 2042 return 55; 1971 2043 } 1972 2044 … … 1976 2048 $ddd = str_replace( array( '(', ')' ), '', $ddd ); 1977 2049 1978 return $ddd;2050 return (integer) $ddd; 1979 2051 } 1980 2052 … … 1984 2056 $phone = str_replace( array( '(', ')', ' ', '-' ), '', $phone ); 1985 2057 1986 return $phone; 2058 return (integer) $phone; 2059 } 2060 2061 //ANTIFRAUD GETTERS - Shipping 2062 2063 private function get_antifraud_shipping_client_id( $order ) { 2064 return sanitize_text_field( $order->get_user_id() ); 1987 2065 } 1988 2066 1989 2067 private function get_antifraud_shipping_person_type( $order ) { 1990 return sanitize_text_field( $order->get_meta( '_billing_persontype' ) );2068 return (integer) sanitize_text_field( $order->get_meta( '_billing_persontype' ) ); 1991 2069 } 1992 2070 … … 2106 2184 2107 2185 private function get_antifraud_shipping_phone_type( $order ) { 2108 $zip = trim( sanitize_text_field( $order->get_shipping_postcode() ) ); 2109 if ( empty( $zip ) ) { 2110 $phone = sanitize_text_field( $order->get_billing_phone() ); 2111 $phone = str_replace( array( '(', ')', ' ', '-' ), '', $phone ); 2112 if ( strlen( $phone ) >= 11 ) { 2113 $result = '6'; 2114 } //Celular 2115 else { 2116 $ptype = $this->get_antifraud_shipping_person_type( $order ); 2117 if ( $ptype == '1' ) { //Pessoa física 2118 $result = '1'; //Residencial 2119 } else { //Pessoa jurídica 2120 $result = '2'; //Comercial 2121 } 2122 } 2186 $phone = str_replace( array( '(', ')', ' ', '-' ), '', sanitize_text_field( $order->get_billing_phone() ) ); 2187 if ( strlen( $phone ) >= 11 ) { 2188 $result = 6; 2189 } //Celular 2190 elseif ( $this->get_antifraud_billing_person_type( $order ) == 1 ) { //Pessoa física 2191 $result = 1; //Residencial 2192 } else { //Pessoa jurídica 2193 $result = 2; //Comercial 2123 2194 } 2124 2195 2125 2196 return $result; 2197 } 2198 2199 private function get_antifraud_shipping_phone_ddi() { 2200 return 55; 2126 2201 } 2127 2202 … … 2131 2206 $ddd = str_replace( array( '(', ')' ), '', $ddd ); 2132 2207 2133 return $ddd;2208 return (integer) $ddd; 2134 2209 } 2135 2210 … … 2139 2214 $phone = str_replace( array( '(', ')', ' ', '-' ), '', $phone ); 2140 2215 2141 return $phone; 2142 } 2216 return (integer) $phone; 2217 } 2218 2219 private function get_antifraud_shipping_delivery_price( $order ) { 2220 return (float) $order->get_total_shipping(); 2221 } 2222 2223 //ANTIFRAUD GETTERS - Payment 2143 2224 2144 2225 private function get_antifraud_payment_date( $order ) { … … 2146 2227 } 2147 2228 2148 private function get_antifraud_payment_ amount( $order ) {2149 return $order->get_total();2150 } 2151 2152 private function get_antifraud_payment_type _id( $order ) {2229 private function get_antifraud_payment_value( $order ) { 2230 return (float) $order->get_total(); 2231 } 2232 2233 private function get_antifraud_payment_type( $order ) { 2153 2234 $card_type = sanitize_text_field( get_post_meta( $this->get_order_id( $order ), '_businesspay-card-type', true ) ); 2154 2235 if ( $card_type == '2' ) { … … 2156 2237 } 2157 2238 2158 return $card_type;2239 return (integer) $card_type; 2159 2240 } 2160 2241 2161 2242 private function get_antifraud_payment_qtd_installments( $order ) { 2162 return sanitize_text_field( get_post_meta( $this->get_order_id( $order ), '_businesspay-card-installments', true ) );2243 return (integer) sanitize_text_field( get_post_meta( $this->get_order_id( $order ), '_businesspay-card-installments', true ) ); 2163 2244 } 2164 2245 … … 2180 2261 switch ( $card_type ) { 2181 2262 case 'DINERS CLUB' : 2182 $card_num = '1';2263 $card_num = 1; 2183 2264 break; 2184 2265 case 'DINERSCLUB' : 2185 $card_num = '1';2266 $card_num = 1; 2186 2267 break; 2187 2268 case 'DINERS' : 2188 $card_num = '1';2269 $card_num = 1; 2189 2270 break; 2190 2271 case 'MASTER CARD' : 2191 $card_num = '2';2272 $card_num = 2; 2192 2273 break; 2193 2274 case 'MASTERCARD' : 2194 $card_num = '2';2275 $card_num = 2; 2195 2276 break; 2196 2277 case 'MASTER' : 2197 $card_num = '2';2278 $card_num = 2; 2198 2279 break; 2199 2280 case 'VISA' : 2200 $card_num = '3';2281 $card_num = 3; 2201 2282 break; 2202 2283 case 'AMERICAN EXPRESS' : 2203 $card_num = '5';2284 $card_num = 5; 2204 2285 break; 2205 2286 case 'AMERICANEXPRESS' : 2206 $card_num = '5';2287 $card_num = 5; 2207 2288 break; 2208 2289 case 'AMEX' : 2209 $card_num = '5';2290 $card_num = 5; 2210 2291 break; 2211 2292 case 'HIPER CARD' : 2212 $card_num = '6';2293 $card_num = 6; 2213 2294 break; 2214 2295 case 'HIPERCARD' : 2215 $card_num = '6';2296 $card_num = 6; 2216 2297 break; 2217 2298 case 'HIPER' : 2218 $card_num = '6';2299 $card_num = 6; 2219 2300 break; 2220 2301 case 'AURA' : 2221 $card_num = '7';2302 $card_num = 7; 2222 2303 break; 2223 2304 default : 2224 $card_num = '4';2305 $card_num = 4; 2225 2306 break; //outros 2226 2307 } … … 2244 2325 } 2245 2326 2327 //ANTIFRAUD GETTERS - Item 2328 2246 2329 private function get_antifraud_item_id( $order_item ) { 2247 2330 return sanitize_text_field( $order_item['product_id'] ); … … 2252 2335 } 2253 2336 2254 private function get_antifraud_item_ qty( $order_item ) {2255 return sanitize_text_field( $order_item['qty']);2256 } 2257 2258 private function get_antifraud_item_ gift() {2259 return '0';2337 private function get_antifraud_item_value( $order_item ) { 2338 return (float) sanitize_text_field( $order_item->get_subtotal() ); 2339 } 2340 2341 private function get_antifraud_item_amount( $order_item ) { 2342 return (integer) sanitize_text_field( $order_item['qty'] ); 2260 2343 } 2261 2344 … … 2270 2353 2271 2354 return $cats[0]->name; 2272 }2273 2274 private function get_antifraud_install_origin() {2275 return sanitize_text_field( $this->get_blog_domain() );2276 }2277 2278 private function get_antifraud_install_channel_id() {2279 return sanitize_text_field( $this->get_blog_name() );2280 2355 } 2281 2356 … … 2318 2393 } 2319 2394 2320 private function set_option_antifraud_entity_code_demo( $value ) { 2321 update_option( 'businesspay_antifraud_entity_code_demo', $value ); 2322 $this->antifraud_entity_code_demo = $value; 2323 } 2324 2325 private function set_option_antifraud_entity_code_live( $value ) { 2326 update_option( 'businesspay_antifraud_entity_code_live', $value ); 2327 $this->antifraud_entity_code_live = $value; 2395 private function set_option_antifraud_login_demo( $value ) { 2396 update_option( 'businesspay_antifraud_login_demo', $value ); 2397 $this->antifraud_login_demo = $value; 2398 } 2399 2400 private function set_option_antifraud_login_live( $value ) { 2401 update_option( 'businesspay_antifraud_login_live', $value ); 2402 $this->antifraud_login_live = $value; 2403 } 2404 2405 private function set_option_antifraud_password_demo( $value ) { 2406 update_option( 'businesspay_antifraud_password_demo', $value ); 2407 $this->antifraud_password_demo = $value; 2408 } 2409 2410 private function set_option_antifraud_password_live( $value ) { 2411 update_option( 'businesspay_antifraud_password_live', $value ); 2412 $this->antifraud_password_live = $value; 2328 2413 } 2329 2414 … … 2336 2421 update_option( 'businesspay_antifraud_app_id_live', $value ); 2337 2422 $this->antifraud_app_id_live = $value; 2423 } 2424 2425 private function set_option_antifraud_product_id( $value ) { 2426 update_option( 'businesspay_antifraud_product_id', $value ); 2427 $this->antifraud_product_id = $value; 2428 } 2429 2430 private function set_option_antifraud_auth_token( $value ) { 2431 update_option( 'businesspay_antifraud_auth_token', $value ); 2432 $this->antifraud_auth_token = $value; 2433 } 2434 2435 private function set_option_antifraud_auth_expiration( $value ) { 2436 $expiration = new DateTime( str_replace( 'T', ' ', $value ) ); 2437 $expiration->modify( '-1 minutes' ); 2438 update_option( 'businesspay_antifraud_auth_expiration', $expiration->format( $this->get_date_format() ) ); 2439 $this->antifraud_auth_expiration = $expiration; 2338 2440 } 2339 2441 … … 2428 2530 2429 2531 2430 //ANTIFRAUD SETTERS 2532 //GETTERS 2533 2534 private function get_admin_url() { 2535 if ( version_compare( WC_BusinessPay::get_woo_version(), '2.1', '>=' ) ) { 2536 return admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=businesspay_gateway' ); 2537 } 2538 2539 return admin_url( 'admin.php?page=woocommerce_settings&tab=payment_gateways§ion=WC_BusinessPay_Gateway' ); 2540 } 2541 2542 private function get_blog_domain() { 2543 return str_replace( array( 'http://', 'https://', 'www.' ), '', get_option( 'siteurl' ) ); 2544 } 2545 2546 private function get_blog_name() { 2547 return get_bloginfo( 'name' ); 2548 } 2549 2550 public function get_cart_total() { 2551 if ( version_compare( WC_BusinessPay::get_woo_version(), '3.2.0', '>=' ) ) { 2552 $cart_total = WC()->cart->get_cart_contents_total(); 2553 } else { 2554 global $woocommerce; 2555 $cart_total = $woocommerce->cart->total; 2556 } 2557 2558 return $cart_total; 2559 } 2560 2561 public function get_order_id( $order ) { 2562 return $order->get_id(); 2563 } 2564 2565 public function get_total_order( $order ) { 2566 return $order->get_total(); 2567 } 2568 2569 public function get_currency_symbol() { 2570 return get_woocommerce_currency_symbol(); 2571 } 2572 2573 private function get_postback_url() { 2574 if ( version_compare( WC()->version, '2.1', '>=' ) ) { 2575 $site_url = home_url( '/wc-api/WC_BusinessPay_Gateway/' ); 2576 } else { 2577 $site_url = home_url( '/?wc-api=WC_BusinessPay_Gateway' ); 2578 } 2579 2580 return $site_url; 2581 } 2582 2583 public function get_date_format() { 2584 return 'Y-m-d H:i:s'; 2585 } 2586 2587 private function get_date_interval( $date_start, $interval, $measure ) { 2588 $result = $date_start; 2589 try { 2590 if ( empty( $interval ) ) { 2591 $interval = $this->default_session_interval; 2592 } 2593 2594 switch ( $measure ) { 2595 case 'days' : 2596 $interval_spec = 'P' . $interval . 'D'; 2597 break; 2598 case 'hours': 2599 $interval_spec = 'PT' . $interval . 'H'; 2600 break; 2601 default : 2602 $interval_spec = 'PT' . $interval . 'H'; 2603 break; 2604 } 2605 2606 $date_interval = new DateTime( 'now', new DateTimeZone( get_option( 'timezone_string' ) ) ); 2607 $date_interval->add( new DateInterval( $interval_spec ) ); 2608 $result = $date_interval->format( $this->get_date_format() ); 2609 } catch ( Exception $e ) { 2610 $this->logger( 'Get Date Interval Error', $e->getMessage() ); 2611 } 2612 2613 return $result; 2614 } 2615 2616 private function get_session() { 2617 $today = current_time( 'mysql' ); 2618 $auth_last = get_option( 'businesspay_auth_last' ); 2619 $auth_next = get_option( 'businesspay_auth_next' ); 2620 2621 $session = ( $auth_last == '' ) || ( $auth_next == '' ) || ( strtotime( $auth_next ) < strtotime( $today ) ); 2622 2623 if ( $session ) { 2624 $this->get_session_info(); 2625 } 2626 2627 $client = get_option( 'businesspay_enable_client' ); 2628 $install = get_option( 'businesspay_enable_install' ); 2629 2630 return ( $client && $install ); 2631 } 2632 2633 private function get_session_info() { 2634 try { 2635 if ( ! empty( $this->authentication_api ) && ! empty( $this->authentication_key ) ) { 2636 $action = $this->auth_schema . '://' . $this->auth_gateway . '.' . $this->authority . '.com.br'; 2637 $action .= '/' . $this->auth_api . '/' . $this->auth_scope . '/' . $this->auth_version . '/' . $this->auth_validate; 2638 2639 $body = array( 2640 'vendor_id' => $this->auth_vendor_id, 2641 'name' => substr( get_bloginfo( 'name' ), 0, 50 ), 2642 'domain' => str_replace( array( 2643 'http://', 2644 'https://', 2645 'www.' 2646 ), '', get_option( 'siteurl' ) ), 2647 'mode_api' => ( $this->sandbox == 'yes' ) ? 'demo' : 'live', 2648 'postback_url' => $this->get_postback_url(), 2649 'version_api' => ( $this->sandbox == 'yes' ) ? str_replace( 'v', '', $this->gateway_demo_version ) : str_replace( 'v', '', $this->gateway_live_version ), 2650 'version_wp' => get_bloginfo( 'version' ), 2651 'version_plugin' => WC_BusinessPay::VERSION, 2652 'version_php' => WC_BusinessPay::get_php_version(), 2653 'version_woo' => WC_BusinessPay::get_woo_version() 2654 ); 2655 2656 $payload = array( 2657 'method' => 'POST', 2658 'sslverify' => true, 2659 'timeout' => 60, 2660 'headers' => array( 2661 'Content-Type' => 'application/json', 2662 'authenticationApi' => $this->authentication_api, 2663 'authenticationKey' => $this->authentication_key 2664 ), 2665 'body' => json_encode( $body ) 2666 ); 2667 2668 $this->logger( 'Session Info | Request', $payload ); 2669 2670 $response = wp_safe_remote_post( $action, $payload ); 2671 2672 $this->logger( 'Session Info | Response', $response ); 2673 2674 if ( ! is_wp_error( $response ) ) { 2675 $response_body = wp_remote_retrieve_body( $response ); 2676 $response_body = $this->clear_response( $response_body ); 2677 2678 if ( ! empty( $response_body ) ) { 2679 $response = json_decode( $response_body ); 2680 if ( ! empty( $response->auth_interval ) ) { 2681 $today = current_time( 'mysql' ); 2682 $next = $this->get_date_interval( $today, $response->auth_interval, 'hours' ); 2683 2684 $this->set_option_auth_last( $today ); 2685 $this->set_option_auth_next( $next ); 2686 $this->set_option_auth_id( $response->id ); 2687 $this->set_option_auth_interval( $response->auth_interval ); 2688 $this->set_option_enable_client( $response->client_enabled ); 2689 $this->set_option_enable_install( $response->install_enabled ); 2690 $this->set_option_enable_antifraud( $response->antifraud_enabled ); 2691 $this->set_option_antifraud_product_id( $response->antifraud_product_id ); 2692 $this->set_option_antifraud_login_demo( $response->antifraud_login_demo ); 2693 $this->set_option_antifraud_login_live( $response->antifraud_login_live ); 2694 $this->set_option_antifraud_password_demo( $response->antifraud_password_demo ); 2695 $this->set_option_antifraud_password_live( $response->antifraud_password_live ); 2696 $this->set_option_antifraud_app_id_demo( $response->antifraud_app_id_demo ); 2697 $this->set_option_antifraud_app_id_live( $response->antifraud_app_id_live ); 2698 } 2699 } 2700 } 2701 } 2702 } catch ( Exception $e ) { 2703 $this->logger( 'Get Session Info Error', $e->getMessage() ); 2704 } 2705 } 2706 2707 private function get_session_id() { 2708 $result = session_id(); 2709 if ( empty( $result ) ) { 2710 session_start(); 2711 $result = session_id(); 2712 } 2713 2714 return $result; 2715 } 2716 2717 private function get_response_url( $order, $response ) { 2718 if ( isset( $response->payment->electronicTransfer->url ) ) { 2719 $url = $response->payment->electronicTransfer->url; 2720 } elseif ( isset( $response->payment->bankSlip->url ) ) { 2721 $url = $response->payment->bankSlip->url; 2722 } else { 2723 $url = $this->get_return_url( $order ); 2724 } 2725 2726 return $url; 2727 } 2431 2728 2432 2729 … … 2546 2843 private function clear_response( $response ) { 2547 2844 return strstr( $response, '{' ); //clear response body hack 2845 } 2846 2847 private function update_order_status( $order, $status, $note ) { 2848 if ( $order->get_status() == $status ) { 2849 $order->add_order_note( $note ); 2850 } else { 2851 $order->update_status( $status, $note ); 2852 } 2548 2853 } 2549 2854 … … 2678 2983 echo sprintf( '<div class="error"><p><strong>%s</strong> %s</p></div>', $msg1, $msg2 ); 2679 2984 } 2985 2680 2986 } -
woo-businesspay/trunk/languages/woocommerce-businesspay-pt_BR.po
r1966668 r1977545 3 3 "Project-Id-Version: WooCommerce BusinessPay\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2018-1 0-31 17:48+0000\n"6 "PO-Revision-Date: 2018-1 0-31 18:04+0000\n"5 "POT-Creation-Date: 2018-11-20 16:10+0000\n" 6 "PO-Revision-Date: 2018-11-20 16:11+0000\n" 7 7 "Last-Translator: webmaster <webmaster@hypelab.com.br>\n" 8 8 "Language-Team: Português do Brasil\n" … … 12 12 "Content-Type: text/plain; charset=UTF-8\n" 13 13 "Content-Transfer-Encoding: 8bit\n" 14 "X-Generator: Loco https://localise.biz/" 14 "X-Generator: Loco https://localise.biz/\n" 15 "X-Loco-Version: 2.2.0; wp-4.9.8" 15 16 16 17 #: templates/missing-woocommerce-template.php:18 … … 26 27 msgstr "Instalar WooCommerce" 27 28 28 #: templates/businesspay-panel-gateway.php:1 929 #: templates/businesspay-panel-antifraud.php: 1929 #: templates/businesspay-panel-gateway.php:18 30 #: templates/businesspay-panel-antifraud.php:20 30 31 msgid "\\a\\t" 31 32 msgstr "\\à\\s" 32 33 33 #: templates/businesspay-panel-gateway.php:2 634 #: includes/woocommerce-businesspay-gateway.php:3 1734 #: templates/businesspay-panel-gateway.php:25 35 #: includes/woocommerce-businesspay-gateway.php:329 35 36 msgid "Debit Card" 36 37 msgstr "Cartão de débito" 37 38 38 #: templates/businesspay-panel-gateway.php:2 839 #: templates/businesspay-panel-gateway.php:27 39 40 #: templates/frontend-template.php:87 40 41 msgid "At sight via debit" 41 42 msgstr "À vista via débito em conta" 42 43 43 #: templates/businesspay-panel-gateway.php:3 144 #: includes/woocommerce-businesspay-gateway.php:2 2844 #: templates/businesspay-panel-gateway.php:30 45 #: includes/woocommerce-businesspay-gateway.php:240 45 46 msgid "Credit Card" 46 47 msgstr "Cartão de crédito" 47 48 48 #: templates/businesspay-panel-gateway.php:3 349 #: templates/businesspay-panel-gateway.php:32 49 50 msgid "Unknown Brand" 50 51 msgstr "Bandeira desconhecida" 51 52 52 #: templates/businesspay-panel-gateway.php:3 953 #: templates/businesspay-panel-gateway.php:38 53 54 #: templates/frontend-template.php:95 54 55 msgid "In " 55 56 msgstr "Em " 56 57 57 #: templates/businesspay-panel-gateway.php:3 958 #: templates/businesspay-panel-gateway.php:38 58 59 #: templates/frontend-template.php:95 59 60 msgid "x of " 60 61 msgstr "x de " 61 62 62 #: templates/businesspay-panel-gateway.php:3 963 #: templates/businesspay-panel-gateway.php:38 63 64 #: templates/frontend-template.php:95 64 65 msgid " on credit card" 65 66 msgstr " no cartão de crédito" 66 67 67 #: templates/businesspay-panel-gateway.php:4 368 #: templates/businesspay-panel-gateway.php:42 68 69 msgid "Bank Transference" 69 70 msgstr "Transferência bancária" 70 71 71 #: templates/businesspay-panel-gateway.php:4 972 #: templates/businesspay-panel-gateway.php:5 773 #: templates/businesspay-panel-gateway.php:7 974 #: templates/businesspay-panel-gateway.php:8 772 #: templates/businesspay-panel-gateway.php:48 73 #: templates/businesspay-panel-gateway.php:56 74 #: templates/businesspay-panel-gateway.php:78 75 #: templates/businesspay-panel-gateway.php:86 75 76 msgid "Unavailable" 76 77 msgstr "Indisponível" 77 78 78 #: templates/businesspay-panel-gateway.php:6 579 #: templates/businesspay-panel-gateway.php:64 79 80 #: templates/frontend-template.php:26 80 #: includes/woocommerce-businesspay-gateway.php:3 3381 #: includes/woocommerce-businesspay-gateway.php:345 81 82 msgid "Billet" 82 83 msgstr "Boleto" 83 84 84 #: templates/businesspay-panel-gateway.php:9 485 #: templates/businesspay-panel-gateway.php:93 85 86 msgid "Unknown" 86 87 msgstr "Desconhecido" 87 88 88 #: templates/businesspay-panel-gateway.php:10 389 #: templates/businesspay-panel-gateway.php:102 89 90 msgid "Transaction Information" 90 91 msgstr "Informações da Transação" 91 92 92 #: templates/businesspay-panel-gateway.php:104 93 #: templates/businesspay-panel-antifraud.php:33 93 #: templates/businesspay-panel-gateway.php:103 94 94 msgid "Token: " 95 95 msgstr "Token:" 96 96 97 #: templates/businesspay-panel-gateway.php:10 698 #: templates/businesspay-panel-antifraud.php:3 797 #: templates/businesspay-panel-gateway.php:105 98 #: templates/businesspay-panel-antifraud.php:36 99 99 msgid "Date: " 100 100 msgstr "Data: " 101 101 102 #: templates/businesspay-panel-gateway.php:10 8103 #: templates/businesspay-panel-antifraud.php:3 9102 #: templates/businesspay-panel-gateway.php:107 103 #: templates/businesspay-panel-antifraud.php:38 104 104 msgid "Status: " 105 105 msgstr "Status: " 106 106 107 #: templates/businesspay-panel-gateway.php:1 10107 #: templates/businesspay-panel-gateway.php:109 108 108 msgid "Payment Information" 109 109 msgstr "Informações do pagamento" 110 110 111 #: templates/businesspay-panel-gateway.php:11 1111 #: templates/businesspay-panel-gateway.php:110 112 112 msgid "Type: " 113 113 msgstr "Tipo: " 114 114 115 #: templates/businesspay-panel-gateway.php:11 4115 #: templates/businesspay-panel-gateway.php:113 116 116 msgid "Brand: " 117 117 msgstr "Bandeira: " 118 118 119 #: templates/businesspay-panel-gateway.php:11 6119 #: templates/businesspay-panel-gateway.php:115 120 120 msgid "Installments: " 121 121 msgstr "Parcelas: " 122 122 123 #: templates/businesspay-panel-gateway.php:11 9123 #: templates/businesspay-panel-gateway.php:118 124 124 msgid "Origin Bank: " 125 125 msgstr "Banco de origem: " 126 126 127 #: templates/businesspay-panel-gateway.php:12 1127 #: templates/businesspay-panel-gateway.php:120 128 128 msgid "Reference Code: " 129 129 msgstr "Código de referência: " 130 130 131 #: templates/businesspay-panel-gateway.php:12 3132 #: templates/businesspay-panel-gateway.php:13 5131 #: templates/businesspay-panel-gateway.php:122 132 #: templates/businesspay-panel-gateway.php:134 133 133 msgid "Payment Date: " 134 134 msgstr "Data do pagamento: " 135 135 136 #: templates/businesspay-panel-gateway.php:12 5137 #: templates/businesspay-panel-gateway.php:13 7136 #: templates/businesspay-panel-gateway.php:124 137 #: templates/businesspay-panel-gateway.php:136 138 138 msgid "Payment Amount: " 139 139 msgstr "Valor pago: " 140 140 141 #: templates/businesspay-panel-gateway.php:12 7141 #: templates/businesspay-panel-gateway.php:126 142 142 msgid "Provider Bank: " 143 143 msgstr "Banco emissor: " 144 144 145 #: templates/businesspay-panel-gateway.php:12 9145 #: templates/businesspay-panel-gateway.php:128 146 146 msgid "Provider Reference: " 147 147 msgstr "Referência do emissor: " 148 148 149 #: templates/businesspay-panel-gateway.php:13 1149 #: templates/businesspay-panel-gateway.php:130 150 150 msgid "Emission Date: " 151 151 msgstr "Data de emissão: " 152 152 153 #: templates/businesspay-panel-gateway.php:13 3153 #: templates/businesspay-panel-gateway.php:132 154 154 msgid "Expiration Date: " 155 155 msgstr "Data de expiração: " … … 202 202 msgstr "depende de um certificado SSL ativo para funcionar!" 203 203 204 #: templates/businesspay-panel-antifraud.php:3 2204 #: templates/businesspay-panel-antifraud.php:33 205 205 msgid "Analysis Information" 206 msgstr " "207 208 #: templates/businesspay-panel-antifraud.php:3 5206 msgstr "Dados da Análise" 207 208 #: templates/businesspay-panel-antifraud.php:34 209 209 msgid "ID: " 210 210 msgstr "ID: " 211 211 212 #: templates/businesspay-panel-antifraud.php:41 212 #: templates/businesspay-panel-antifraud.php:40 213 msgid "Score: " 214 msgstr "Score: " 215 216 #: templates/businesspay-panel-antifraud.php:42 213 217 msgid "Message: " 214 msgstr " "218 msgstr "Mensagem: " 215 219 216 220 #: templates/frontend-template.php:16 … … 219 223 220 224 #: templates/frontend-template.php:21 221 #: includes/woocommerce-businesspay-gateway.php:3 25225 #: includes/woocommerce-businesspay-gateway.php:337 222 226 msgid "Bank Transfer" 223 227 msgstr "Transferência" … … 305 309 msgstr "Esta compra está sendo feita no Brasil" 306 310 307 #: includes/woocommerce-businesspay-gateway.php:2 5311 #: includes/woocommerce-businesspay-gateway.php:26 308 312 msgid "BusinessPay" 309 313 msgstr "BusinessPay" 310 314 311 #: includes/woocommerce-businesspay-gateway.php:2 6315 #: includes/woocommerce-businesspay-gateway.php:27 312 316 msgid "Accept payments using BusinessPay Gateway." 313 317 msgstr "Receba pagamentos usando o BusinessPay." 314 318 315 #: includes/woocommerce-businesspay-gateway.php:1 56319 #: includes/woocommerce-businesspay-gateway.php:162 316 320 msgid "Account Enabled" 317 321 msgstr "Conta habilitada." 318 322 319 #: includes/woocommerce-businesspay-gateway.php:1 56323 #: includes/woocommerce-businesspay-gateway.php:162 320 324 msgid "Account Disabled" 321 325 msgstr "Conta inativa ou inexistente." 322 326 323 #: includes/woocommerce-businesspay-gateway.php:1 57327 #: includes/woocommerce-businesspay-gateway.php:163 324 328 msgid "Installation Enabled" 325 329 msgstr "Instalação habilitada." 326 330 327 #: includes/woocommerce-businesspay-gateway.php:1 57331 #: includes/woocommerce-businesspay-gateway.php:163 328 332 msgid "Installation Disabled" 329 333 msgstr "Instalação não registrada." 330 334 331 #: includes/woocommerce-businesspay-gateway.php:1 58335 #: includes/woocommerce-businesspay-gateway.php:164 332 336 msgid "Antifraud Enabled" 333 337 msgstr "Antifraude habilitado." 334 338 335 #: includes/woocommerce-businesspay-gateway.php:1 58339 #: includes/woocommerce-businesspay-gateway.php:164 336 340 msgid "Antifraud Disabled" 337 341 msgstr "Antifraude desabilitado." 338 342 339 #: includes/woocommerce-businesspay-gateway.php:160 343 #: includes/woocommerce-businesspay-gateway.php:165 344 msgid "Product not configured" 345 msgstr "Produto não configurado" 346 347 #: includes/woocommerce-businesspay-gateway.php:167 340 348 msgid "Client Account:" 341 349 msgstr "Conta do cliente:" 342 350 343 #: includes/woocommerce-businesspay-gateway.php:16 1351 #: includes/woocommerce-businesspay-gateway.php:168 344 352 msgid "Client Installation:" 345 353 msgstr "Instalação do cliente:" 346 354 347 #: includes/woocommerce-businesspay-gateway.php:16 2355 #: includes/woocommerce-businesspay-gateway.php:169 348 356 msgid "Client Antifraud:" 349 357 msgstr "Antifraude do cliente:" 350 358 351 #: includes/woocommerce-businesspay-gateway.php:171 359 #: includes/woocommerce-businesspay-gateway.php:170 360 msgid "Antifraud Product:" 361 msgstr "Produto Antifraude: " 362 363 #: includes/woocommerce-businesspay-gateway.php:183 352 364 msgid "Antifraud by " 353 365 msgstr "Antifraude por " 354 366 355 #: includes/woocommerce-businesspay-gateway.php:1 80367 #: includes/woocommerce-businesspay-gateway.php:192 356 368 msgid "BusinessPay Payment Gateway" 357 369 msgstr "BusinessPay" 358 370 359 #: includes/woocommerce-businesspay-gateway.php:1 85371 #: includes/woocommerce-businesspay-gateway.php:197 360 372 msgid "Enable BusinessPay" 361 373 msgstr "Habilita checkout BusinessPay" 362 374 363 #: includes/woocommerce-businesspay-gateway.php:1 86375 #: includes/woocommerce-businesspay-gateway.php:198 364 376 msgid "Enable BusinessPay Gateway Plugin" 365 377 msgstr "Habilita plugin de pagamentos BusinessPay" 366 378 367 #: includes/woocommerce-businesspay-gateway.php:1 87379 #: includes/woocommerce-businesspay-gateway.php:199 368 380 msgid "Enable BusinessPay gateway plugin options." 369 381 msgstr "Habilita opções do plugin de pagamentos BusinessPay" 370 382 371 #: includes/woocommerce-businesspay-gateway.php: 193383 #: includes/woocommerce-businesspay-gateway.php:205 372 384 msgid "Title" 373 385 msgstr "Título" 374 386 375 #: includes/woocommerce-businesspay-gateway.php: 194387 #: includes/woocommerce-businesspay-gateway.php:206 376 388 msgid "Payment method title seen on the checkout page." 377 389 msgstr "Título do método de pagamento visto na página de checkout." 378 390 379 #: includes/woocommerce-businesspay-gateway.php: 195391 #: includes/woocommerce-businesspay-gateway.php:207 380 392 msgid "BusinessPay | Payments via credit card, debit and billet." 381 393 msgstr "BusinessPay | Pagamentos via cartão de crédito, débito e boleto." 382 394 383 #: includes/woocommerce-businesspay-gateway.php:2 00395 #: includes/woocommerce-businesspay-gateway.php:212 384 396 msgid "Description" 385 397 msgstr "Descrição" 386 398 387 #: includes/woocommerce-businesspay-gateway.php:2 01399 #: includes/woocommerce-businesspay-gateway.php:213 388 400 msgid "Payment method description seen on the checkout page." 389 401 msgstr "Descrição do método de pagamento visto na página de checkout." 390 402 391 #: includes/woocommerce-businesspay-gateway.php:2 02403 #: includes/woocommerce-businesspay-gateway.php:214 392 404 msgid "Pay using BusinessPay, a secure experience of online buys." 393 405 msgstr "Pague usando BusinessPay, uma experiência segura de compras online." 394 406 395 #: includes/woocommerce-businesspay-gateway.php:2 07407 #: includes/woocommerce-businesspay-gateway.php:219 396 408 msgid "Gateway Settings" 397 409 msgstr "Configurações do gateway" 398 410 399 #: includes/woocommerce-businesspay-gateway.php:2 12411 #: includes/woocommerce-businesspay-gateway.php:224 400 412 msgid "Authentication API" 401 413 msgstr "Usuário da API" 402 414 403 #: includes/woocommerce-businesspay-gateway.php:2 13415 #: includes/woocommerce-businesspay-gateway.php:225 404 416 msgid "Use your BusinessPay Authentication API" 405 417 msgstr "Insira seu usuário da API BusinessPay" 406 418 407 #: includes/woocommerce-businesspay-gateway.php:2 20419 #: includes/woocommerce-businesspay-gateway.php:232 408 420 msgid "Authentication Key" 409 421 msgstr "Chave da API" 410 422 411 #: includes/woocommerce-businesspay-gateway.php:2 21423 #: includes/woocommerce-businesspay-gateway.php:233 412 424 msgid "Use your BusinessPay Authentication Key" 413 425 msgstr "Insira sua chave da API BusinessPay" 414 426 415 #: includes/woocommerce-businesspay-gateway.php:2 29427 #: includes/woocommerce-businesspay-gateway.php:241 416 428 msgid "Enable credit card payments with BusinessPay" 417 429 msgstr "Habilita pagamentos com cartão de crédito" 418 430 419 #: includes/woocommerce-businesspay-gateway.php:2 30431 #: includes/woocommerce-businesspay-gateway.php:242 420 432 msgid "Enable credit card payment with BusinessPay on checkout page" 421 433 msgstr "Habilita cartão de crédito com BusinessPay na página de checkout" 422 434 423 #: includes/woocommerce-businesspay-gateway.php:2 35435 #: includes/woocommerce-businesspay-gateway.php:247 424 436 msgid "Credit Card Settings" 425 437 msgstr "Configurações de cartão de crédito" 426 438 427 #: includes/woocommerce-businesspay-gateway.php:2 41439 #: includes/woocommerce-businesspay-gateway.php:253 428 440 msgid "Name in Invoice" 429 441 msgstr "Nome na fatura" 430 442 431 #: includes/woocommerce-businesspay-gateway.php:2 42443 #: includes/woocommerce-businesspay-gateway.php:254 432 444 msgid "" 433 445 "Name in Invoice to identify Shop. Its important to avoid gateway chargebacks." … … 436 448 "chargebacks no Gateway." 437 449 438 #: includes/woocommerce-businesspay-gateway.php:2 49450 #: includes/woocommerce-businesspay-gateway.php:261 439 451 msgid "Invoice Prefix" 440 452 msgstr "Prefixo da fatura" 441 453 442 #: includes/woocommerce-businesspay-gateway.php:2 50454 #: includes/woocommerce-businesspay-gateway.php:262 443 455 msgid "Shop prefix to identify invoice shop origin" 444 456 msgstr "Prefixo da loja para identificar a loja de origem do pedido" 445 457 446 #: includes/woocommerce-businesspay-gateway.php:2 56458 #: includes/woocommerce-businesspay-gateway.php:268 447 459 msgid "Installments" 448 460 msgstr "Parcelamento" 449 461 450 #: includes/woocommerce-businesspay-gateway.php:2 58462 #: includes/woocommerce-businesspay-gateway.php:270 451 463 msgid "Enable Installments" 452 464 msgstr "Habilita parcelamento com cartão de crédito" 453 465 454 #: includes/woocommerce-businesspay-gateway.php:2 62466 #: includes/woocommerce-businesspay-gateway.php:274 455 467 msgid "Installments Settings" 456 468 msgstr "Configurações de parcelamento" 457 469 458 #: includes/woocommerce-businesspay-gateway.php:2 67470 #: includes/woocommerce-businesspay-gateway.php:279 459 471 msgid "Minimum Installment" 460 472 msgstr "Parcelamento mínimo" 461 473 462 #: includes/woocommerce-businesspay-gateway.php:2 69474 #: includes/woocommerce-businesspay-gateway.php:281 463 475 msgid "Indicate the minimum installments." 464 476 msgstr "Indica o mínimo de parcelas." 465 477 466 #: includes/woocommerce-businesspay-gateway.php: 288478 #: includes/woocommerce-businesspay-gateway.php:300 467 479 msgid "Maximum Installment" 468 480 msgstr "Parcelamento máximo" 469 481 470 #: includes/woocommerce-businesspay-gateway.php: 290482 #: includes/woocommerce-businesspay-gateway.php:302 471 483 msgid "Indicate the Maximum installments." 472 484 msgstr "Indica o máximo de parcelas." 473 485 474 #: includes/woocommerce-businesspay-gateway.php:3 09486 #: includes/woocommerce-businesspay-gateway.php:321 475 487 msgid "Minimum Value" 476 488 msgstr "Valor mínimo" 477 489 478 #: includes/woocommerce-businesspay-gateway.php:3 10490 #: includes/woocommerce-businesspay-gateway.php:322 479 491 msgid "Minimum value by installment" 480 492 msgstr "Valor mínimo por parcela" 481 493 482 #: includes/woocommerce-businesspay-gateway.php:3 18494 #: includes/woocommerce-businesspay-gateway.php:330 483 495 msgid "Enable debit card payments with BusinessPay" 484 496 msgstr "Habilita pagamentos por cartão de débito" 485 497 486 #: includes/woocommerce-businesspay-gateway.php:3 19498 #: includes/woocommerce-businesspay-gateway.php:331 487 499 msgid "Enable debit card payment on checkout page" 488 500 msgstr "Habilita cartão de débito na página de checkout" 489 501 490 #: includes/woocommerce-businesspay-gateway.php:3 26502 #: includes/woocommerce-businesspay-gateway.php:338 491 503 msgid "Enable bank transfer payments with BusinessPay" 492 504 msgstr "Habilita pagamentos por transferência bancária" 493 505 494 #: includes/woocommerce-businesspay-gateway.php:3 27506 #: includes/woocommerce-businesspay-gateway.php:339 495 507 msgid "Enable bank transfer payment on checkout page" 496 508 msgstr "Habilita pagamentos por transferência bancária na página de checkout" 497 509 498 #: includes/woocommerce-businesspay-gateway.php:3 34510 #: includes/woocommerce-businesspay-gateway.php:346 499 511 msgid "Enable billet payments with BusinessPay" 500 512 msgstr "Habilita pagamentos por boleto bancário" 501 513 502 #: includes/woocommerce-businesspay-gateway.php:3 35514 #: includes/woocommerce-businesspay-gateway.php:347 503 515 msgid "Enable billet payment on checkout page" 504 516 msgstr "Habilita pagamento por boleto na página de checkout" 505 517 506 #: includes/woocommerce-businesspay-gateway.php:3 40518 #: includes/woocommerce-businesspay-gateway.php:352 507 519 msgid "Billet Settings" 508 520 msgstr "Configurações de boleto" 509 521 510 #: includes/woocommerce-businesspay-gateway.php:3 46522 #: includes/woocommerce-businesspay-gateway.php:358 511 523 msgid "Custom Logo URL" 512 524 msgstr "URL do logotipo customizado" 513 525 514 #: includes/woocommerce-businesspay-gateway.php:3 47526 #: includes/woocommerce-businesspay-gateway.php:359 515 527 msgid "URL logo image to be shown on the billet" 516 528 msgstr "URL da imagem do logotipo a ser exibido no boleto" 517 529 518 #: includes/woocommerce-businesspay-gateway.php:3 52530 #: includes/woocommerce-businesspay-gateway.php:364 519 531 msgid "Number of Days" 520 532 msgstr "Dias para vencimento" 521 533 522 #: includes/woocommerce-businesspay-gateway.php:3 54534 #: includes/woocommerce-businesspay-gateway.php:366 523 535 msgid "Days of expiry of the billet after printed." 524 536 msgstr "Dias para expiração do boleto após impresso." 525 537 526 #: includes/woocommerce-businesspay-gateway.php:3 61538 #: includes/woocommerce-businesspay-gateway.php:373 527 539 msgid "Instruction Line" 528 540 msgstr "Linha de instrução" 529 541 530 #: includes/woocommerce-businesspay-gateway.php:3 62542 #: includes/woocommerce-businesspay-gateway.php:374 531 543 msgid "Billet instruction line" 532 544 msgstr "Linha de instrução do boleto" 533 545 534 #: includes/woocommerce-businesspay-gateway.php:3 67546 #: includes/woocommerce-businesspay-gateway.php:379 535 547 msgid "Tools" 536 548 msgstr "Ferramentas" 537 549 538 #: includes/woocommerce-businesspay-gateway.php:3 73550 #: includes/woocommerce-businesspay-gateway.php:385 539 551 msgid "BusinessPay Sandbox" 540 552 msgstr "Ambiente de testes" 541 553 542 #: includes/woocommerce-businesspay-gateway.php:3 74554 #: includes/woocommerce-businesspay-gateway.php:386 543 555 msgid "Enable BusinessPay sandbox mode" 544 556 msgstr "Habilita ambiente de testes do BusinessPay" 545 557 546 #: includes/woocommerce-businesspay-gateway.php:3 75558 #: includes/woocommerce-businesspay-gateway.php:387 547 559 msgid "Enable BusinessPay Sandbox" 548 560 msgstr "Habilita sandbox do BusinessPay" 549 561 550 #: includes/woocommerce-businesspay-gateway.php:3 82562 #: includes/woocommerce-businesspay-gateway.php:394 551 563 msgid "Debug" 552 564 msgstr "Log de erros" 553 565 554 #: includes/woocommerce-businesspay-gateway.php:3 83566 #: includes/woocommerce-businesspay-gateway.php:395 555 567 msgid "Enable logging" 556 568 msgstr "Habilitar log de erros do WooCommerce" 557 569 558 #: includes/woocommerce-businesspay-gateway.php: 389570 #: includes/woocommerce-businesspay-gateway.php:401 559 571 msgid "Status" 560 572 msgstr "Status" 561 573 562 #: includes/woocommerce-businesspay-gateway.php:4 11574 #: includes/woocommerce-businesspay-gateway.php:423 563 575 msgid "Card number must be at least 16 characters." 564 576 msgstr "O campo Número do cartão deve conter pelo menos 15 caracteres." 565 577 566 #: includes/woocommerce-businesspay-gateway.php:4 14578 #: includes/woocommerce-businesspay-gateway.php:426 567 579 msgid "The Card Number field must be numeric." 568 580 msgstr "O campo Número do cartão deve ser numérico." 569 581 570 #: includes/woocommerce-businesspay-gateway.php:4 17582 #: includes/woocommerce-businesspay-gateway.php:429 571 583 msgid "Invalid card number." 572 584 msgstr "Número de cartão inválido." 573 585 574 #: includes/woocommerce-businesspay-gateway.php:4 24586 #: includes/woocommerce-businesspay-gateway.php:436 575 587 msgid "The Name field can not be less than 6 characters." 576 588 msgstr "O campo Nome não pode conter menos que 6 caracteres." 577 589 578 #: includes/woocommerce-businesspay-gateway.php:4 27590 #: includes/woocommerce-businesspay-gateway.php:439 579 591 msgid "The Name field can not be greater than 25 characters." 580 592 msgstr "O campo Nome não pode conter mais que 25 caracteres." 581 593 582 #: includes/woocommerce-businesspay-gateway.php:4 30594 #: includes/woocommerce-businesspay-gateway.php:442 583 595 msgid "The Name field can not have numbers." 584 596 msgstr "O campo Nome não pode conter números." 585 597 586 #: includes/woocommerce-businesspay-gateway.php:4 40598 #: includes/woocommerce-businesspay-gateway.php:452 587 599 msgid "The Month of Expiration field must have 2 digits." 588 600 msgstr "O valor do mês de expiração deve conter 2 dígitos." 589 601 590 #: includes/woocommerce-businesspay-gateway.php:4 43602 #: includes/woocommerce-businesspay-gateway.php:455 591 603 msgid "The Month of Expiration field must be numeric." 592 604 msgstr "O valor do mês de expiração deve ser numérico." 593 605 594 #: includes/woocommerce-businesspay-gateway.php:4 46606 #: includes/woocommerce-businesspay-gateway.php:458 595 607 msgid "The Year of Expiration field must be numeric." 596 608 msgstr "O valor do ano de expiração deve ser numérico." 597 609 598 #: includes/woocommerce-businesspay-gateway.php:4 49610 #: includes/woocommerce-businesspay-gateway.php:461 599 611 msgid "The Year of Expiration field must have 4 digits." 600 612 msgstr "O valor do ano de expiração deve conter 4 dígitos." 601 613 602 #: includes/woocommerce-businesspay-gateway.php:4 56603 #: includes/woocommerce-businesspay-gateway.php:4 62614 #: includes/woocommerce-businesspay-gateway.php:468 615 #: includes/woocommerce-businesspay-gateway.php:474 604 616 msgid "The CVC field must have 3 or 4 digits." 605 617 msgstr "O campo CVC deve conter 3 ou 4 dígitos." 606 618 607 #: includes/woocommerce-businesspay-gateway.php:4 59619 #: includes/woocommerce-businesspay-gateway.php:471 608 620 msgid "The CVC field must be numeric." 609 621 msgstr "O campo CVC deve ser numérico." 610 622 611 #: includes/woocommerce-businesspay-gateway.php:4 69623 #: includes/woocommerce-businesspay-gateway.php:481 612 624 msgid "Please select a installment option." 613 625 msgstr "Por favor selecione uma opção de parcelamento." 614 626 615 #: includes/woocommerce-businesspay-gateway.php:4 76627 #: includes/woocommerce-businesspay-gateway.php:492 616 628 msgid "The Document field must have 11 digits for CPF or 14 digits for CNPJ." 617 629 msgstr "" … … 619 631 "dígitos para CNPJ." 620 632 621 #: includes/woocommerce-businesspay-gateway.php:4 79633 #: includes/woocommerce-businesspay-gateway.php:495 622 634 msgid "The Document field must be numeric." 623 635 msgstr "O campo CPF ou CNPJ do portador deve ser numérico." 624 636 625 #: includes/woocommerce-businesspay-gateway.php:4 82637 #: includes/woocommerce-businesspay-gateway.php:498 626 638 msgid "The Document field as CPF is invalid." 627 639 msgstr "O valor do campo CPF ou CNPJ do portador como CPF é inválido." 628 640 629 #: includes/woocommerce-businesspay-gateway.php: 485641 #: includes/woocommerce-businesspay-gateway.php:501 630 642 msgid "The Document field as CNPJ is invalid." 631 643 msgstr "O valor do campo CPF ou CNPJ do portador como CNPJ é inválido." 632 644 633 #: includes/woocommerce-businesspay-gateway.php: 493645 #: includes/woocommerce-businesspay-gateway.php:509 634 646 msgid "Please select a origin transfer bank option." 635 647 msgstr "Por favor selecione o banco de origem da transferência." 636 648 637 #: includes/woocommerce-businesspay-gateway.php: 499638 #: includes/woocommerce-businesspay-gateway.php:5 12649 #: includes/woocommerce-businesspay-gateway.php:515 650 #: includes/woocommerce-businesspay-gateway.php:528 639 651 msgid "The Neighborhood field need to be filled." 640 652 msgstr "O campo Bairro é obrigatório." 641 653 642 #: includes/woocommerce-businesspay-gateway.php:5 06654 #: includes/woocommerce-businesspay-gateway.php:522 643 655 msgid "Please select a origin billet bank option." 644 656 msgstr "Por favor selecione o banco emissor do boleto." 645 657 646 #: includes/woocommerce-businesspay-gateway.php:5 32658 #: includes/woocommerce-businesspay-gateway.php:546 647 659 msgid "BusinessPay | Debit Card" 648 660 msgstr "BusinessPay | Cartão de débito" 649 661 650 #: includes/woocommerce-businesspay-gateway.php:5 35662 #: includes/woocommerce-businesspay-gateway.php:548 651 663 msgid "BusinessPay | Credit Card" 652 664 msgstr "BusinessPay | Cartão de crédito" 653 665 654 #: includes/woocommerce-businesspay-gateway.php:5 40666 #: includes/woocommerce-businesspay-gateway.php:550 655 667 msgid "BusinessPay | Bank Transfer" 656 668 msgstr "BusinessPay | Transferência bancária" 657 669 658 #: includes/woocommerce-businesspay-gateway.php:5 44670 #: includes/woocommerce-businesspay-gateway.php:552 659 671 msgid "BusinessPay | Billet" 660 672 msgstr "BusinessPay | Boleto" 661 673 662 #: includes/woocommerce-businesspay-gateway.php:555 663 #: includes/woocommerce-businesspay-gateway.php:1138 664 msgid "" 665 "BusinessPay: There was an error performing the transaction. Please contact " 666 "us." 667 msgstr "" 668 "BusinessPay: Ocorreu um erro ao executar a transação. Por favor entre em " 669 "contato conosco." 670 671 #: includes/woocommerce-businesspay-gateway.php:556 672 #: includes/woocommerce-businesspay-gateway.php:983 673 #: includes/woocommerce-businesspay-gateway.php:1024 674 msgid "Could not receive a valid server response. Please try again." 675 msgstr "" 676 "Não foi possível receber uma resposta válida do servidor. Por favor tente " 677 "novamente." 678 679 #: includes/woocommerce-businesspay-gateway.php:579 680 #: includes/woocommerce-businesspay-gateway.php:626 681 #: includes/woocommerce-businesspay-gateway.php:675 682 #: includes/woocommerce-businesspay-gateway.php:729 683 msgid "Woocommerce Order" 684 msgstr "Pedido do WooCommerce" 685 686 #: includes/woocommerce-businesspay-gateway.php:980 674 #: includes/woocommerce-businesspay-gateway.php:732 687 675 msgid "" 688 676 "The credentials for this virtual store are not valid on the BusinessPay " … … 690 678 msgstr "As credenciais desta loja virtual não são válidas neste servidor." 691 679 692 #: includes/woocommerce-businesspay-gateway.php:1021 680 #: includes/woocommerce-businesspay-gateway.php:735 681 #: includes/woocommerce-businesspay-gateway.php:1311 682 msgid "Could not receive a valid server response. Please try again." 683 msgstr "" 684 "Não foi possível receber uma resposta válida do servidor. Por favor tente " 685 "novamente." 686 687 #: includes/woocommerce-businesspay-gateway.php:828 688 msgid "BusinessPay Status: " 689 msgstr "Status BusinessPay: " 690 691 #: includes/woocommerce-businesspay-gateway.php:1022 692 msgid "Transaction started but not confirmed." 693 msgstr "Transação iniciada mas não confirmada." 694 695 #: includes/woocommerce-businesspay-gateway.php:1025 696 msgid "Awating payment." 697 msgstr "Aguardando pagamento." 698 699 #: includes/woocommerce-businesspay-gateway.php:1028 700 msgid "Transaction effectivated." 701 msgstr "Transação efetivada." 702 703 #: includes/woocommerce-businesspay-gateway.php:1031 704 msgid "Transaction under analysis." 705 msgstr "Transação em análise." 706 707 #: includes/woocommerce-businesspay-gateway.php:1034 708 msgid "Transaction expired." 709 msgstr "Transação expirada." 710 711 #: includes/woocommerce-businesspay-gateway.php:1037 712 msgid "Transaction authorized." 713 msgstr "Transação autorizada." 714 715 #: includes/woocommerce-businesspay-gateway.php:1040 716 msgid "Transaction confirmed." 717 msgstr "Transação confirmada." 718 719 #: includes/woocommerce-businesspay-gateway.php:1043 720 msgid "Transaction denied." 721 msgstr "Transação negada." 722 723 #: includes/woocommerce-businesspay-gateway.php:1046 724 msgid "Cancellation in progress." 725 msgstr "Cancelamento em andamento." 726 727 #: includes/woocommerce-businesspay-gateway.php:1049 728 msgid "Transaction Canceled." 729 msgstr "Transação cancelada." 730 731 #: includes/woocommerce-businesspay-gateway.php:1052 732 msgid "Transaction pending of confirmation." 733 msgstr "Transação pendente de confirmação." 734 735 #: includes/woocommerce-businesspay-gateway.php:1055 736 msgid "Failure to communicate with the provider." 737 msgstr "Falha na comunicação com o emissor." 738 739 #: includes/woocommerce-businesspay-gateway.php:1058 740 msgid "No valid server response." 741 msgstr "Nenhuma resposta válida do servidor." 742 743 #: includes/woocommerce-businesspay-gateway.php:1077 744 msgid "payment made less than the value of the order." 745 msgstr "Pagamento feito com valor menor que o vaor do pedido." 746 747 #: includes/woocommerce-businesspay-gateway.php:1308 693 748 msgid "" 694 749 "The credentials for this virtual store are not valid on the BusinessPay " … … 698 753 "novamente em alguns instantes." 699 754 700 #: includes/woocommerce-businesspay-gateway.php:1120 701 msgid "BusinessPay Status: " 702 msgstr "Status BusinessPay: " 703 704 #: includes/woocommerce-businesspay-gateway.php:1366 705 msgid "Transaction started but not confirmed." 706 msgstr "Transação iniciada mas não confirmada." 707 708 #: includes/woocommerce-businesspay-gateway.php:1369 709 msgid "Awating payment." 710 msgstr "Aguardando pagamento." 711 712 #: includes/woocommerce-businesspay-gateway.php:1372 713 msgid "Transaction effectivated." 714 msgstr "Transação efetivada." 715 716 #: includes/woocommerce-businesspay-gateway.php:1375 717 msgid "Transaction under analysis." 718 msgstr "Transação em análise." 719 720 #: includes/woocommerce-businesspay-gateway.php:1378 721 msgid "Transaction expired." 722 msgstr "Transação expirada." 723 724 #: includes/woocommerce-businesspay-gateway.php:1381 725 msgid "Transaction authorized." 726 msgstr "Transação autorizada." 727 728 #: includes/woocommerce-businesspay-gateway.php:1384 729 msgid "Transaction confirmed." 730 msgstr "Transação confirmada." 731 732 #: includes/woocommerce-businesspay-gateway.php:1387 733 msgid "Transaction denied." 734 msgstr "Transação negada." 735 736 #: includes/woocommerce-businesspay-gateway.php:1390 737 msgid "Cancellation in progress." 738 msgstr "Cancelamento em andamento." 739 740 #: includes/woocommerce-businesspay-gateway.php:1393 741 msgid "Transaction Canceled." 742 msgstr "Transação cancelada." 743 744 #: includes/woocommerce-businesspay-gateway.php:1396 745 msgid "Transaction pending of confirmation." 746 msgstr "Transação pendente de confirmação." 747 748 #: includes/woocommerce-businesspay-gateway.php:1399 749 msgid "Failure to communicate with the provider." 750 msgstr "Falha na comunicação com o emissor." 751 752 #: includes/woocommerce-businesspay-gateway.php:1402 753 msgid "No valid server response." 754 msgstr "Nenhuma resposta válida do servidor." 755 756 #: includes/woocommerce-businesspay-gateway.php:1410 757 msgid "The order will be analyzed by antifraud software" 758 msgstr "O pedido será analisado pelo software antifraude" 759 760 #: includes/woocommerce-businesspay-gateway.php:1417 761 msgid "payment made less than the value of the order." 762 msgstr "Pagamento feito com valor menor que o vaor do pedido." 763 764 #: includes/woocommerce-businesspay-gateway.php:2631 765 #: includes/woocommerce-businesspay-gateway.php:2638 755 #: includes/woocommerce-businesspay-gateway.php:1354 756 msgid "Antifraud Status: " 757 msgstr "Status Antifraude: " 758 759 #: includes/woocommerce-businesspay-gateway.php:1486 760 msgid "" 761 "Order was automatically approved according to parameters defined in the " 762 "automatic approval rule." 763 msgstr "" 764 "Pedido aprovado automaticamente de acordo com parâmetros definidos na regra " 765 "de aprovação automática." 766 767 #: includes/woocommerce-businesspay-gateway.php:1489 768 msgid "Order is queued for analysis." 769 msgstr "Pedido está na fila para análise." 770 771 #: includes/woocommerce-businesspay-gateway.php:1492 772 msgid "Order manually approved by decision-making of an analyst." 773 msgstr "Pedido aprovado manualmente através da tomada de decisão do analista." 774 775 #: includes/woocommerce-businesspay-gateway.php:1495 776 msgid "" 777 "Order approved automatically by client-established policy or antifraud " 778 "software rule." 779 msgstr "" 780 "Pedido aprovado manualmente por política estabelecida pelo cliente ou regra " 781 "do software antifraude." 782 783 #: includes/woocommerce-businesspay-gateway.php:1498 784 msgid "Canceled by customer or duplicated order." 785 msgstr "Cancelado pelo cliente ou pedido duplicado." 786 787 #: includes/woocommerce-businesspay-gateway.php:1501 788 msgid "" 789 "Order imputed as fraud confirmed by contact with the card administrator and " 790 "/ or contact with the card holder or CPF of the registry that is unaware of " 791 "the purchase." 792 msgstr "" 793 "Pedido imputado como fraude confirmada pelo contato com a administradora do " 794 "cartão e/ou contato com o portador do cartão ou CPF do registro que " 795 "desconhece a compra." 796 797 #: includes/woocommerce-businesspay-gateway.php:1504 798 msgid "Order imported and not classified Score by the analyzer yet." 799 msgstr "Pedido importado e não classificado Score ainda pelo analista." 800 801 #: includes/woocommerce-businesspay-gateway.php:1507 802 msgid "" 803 "Order Automatically Disapproved by some type of business rule that needs to " 804 "be applied." 805 msgstr "" 806 "Pedido reprovado automaticamente por algum tipo de regra de negócio que " 807 "precisa ser aplicada." 808 809 #: includes/woocommerce-businesspay-gateway.php:1510 810 msgid "" 811 "Order disapproved without suspicion by lack of contact with the client " 812 "within the agreed period and / or social security number of restrictive " 813 "policies (Irregular, SUS or Canceled)." 814 msgstr "" 815 "Pedido cancelado sem suspeita por falta de contato com o cliente dentro do " 816 "período acordado e/ou número de CPF por políticas restritivas (Irregular, " 817 "SUS ou Cancelado)." 818 819 #: includes/woocommerce-businesspay-gateway.php:1513 820 msgid "" 821 "Order disapproved automatically by policy established by customer or " 822 "antifraud software." 823 msgstr "" 824 "Pedido reprovado automaticamente por política estabelecida pelo cliente ou " 825 "software antifraude." 826 827 #: includes/woocommerce-businesspay-gateway.php:1516 828 msgid "" 829 "Order automatically approved by policy established by the customer or " 830 "antifraud software." 831 msgstr "" 832 "Pedido aprovado automaticamente por política estabelecida pelo cliente ou " 833 "software antifraude." 834 835 #: includes/woocommerce-businesspay-gateway.php:1639 836 msgid "Woocommerce Order" 837 msgstr "Pedido do WooCommerce" 838 839 #: includes/woocommerce-businesspay-gateway.php:2974 840 #: includes/woocommerce-businesspay-gateway.php:2981 766 841 msgid "BusinessPay Disabled" 767 842 msgstr "BusinessPay desabilitado" 768 843 769 #: includes/woocommerce-businesspay-gateway.php:2 632844 #: includes/woocommerce-businesspay-gateway.php:2975 770 845 msgid "You must enable at least one form of payment." 771 846 msgstr "Você precisa habilitar ao menos uma forma de pagamento." 772 847 773 #: includes/woocommerce-businesspay-gateway.php:2 633848 #: includes/woocommerce-businesspay-gateway.php:2976 774 849 msgid "Click here to configure!" 775 850 msgstr "Clique aqui para configurar!" 776 851 777 #: includes/woocommerce-businesspay-gateway.php:2 639852 #: includes/woocommerce-businesspay-gateway.php:2982 778 853 #, php-format 779 854 msgid "" -
woo-businesspay/trunk/languages/woocommerce-businesspay.pot
r1966657 r1977545 4 4 "Project-Id-Version: WooCommerce BusinessPay\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 2018-1 0-31 17:48+0000\n"6 "POT-Creation-Date: 2018-11-20 16:10+0000\n" 7 7 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 8 "Last-Translator: Gustavo Piucco <gustavopiucco@gmail.com>\n" … … 27 27 msgstr "" 28 28 29 #: templates/businesspay-panel-gateway.php:1 930 #: templates/businesspay-panel-antifraud.php: 1929 #: templates/businesspay-panel-gateway.php:18 30 #: templates/businesspay-panel-antifraud.php:20 31 31 msgid "\\a\\t" 32 32 msgstr "" 33 33 34 #: templates/businesspay-panel-gateway.php:2 635 #: includes/woocommerce-businesspay-gateway.php:3 1734 #: templates/businesspay-panel-gateway.php:25 35 #: includes/woocommerce-businesspay-gateway.php:329 36 36 msgid "Debit Card" 37 37 msgstr "" 38 38 39 #: templates/businesspay-panel-gateway.php:2 839 #: templates/businesspay-panel-gateway.php:27 40 40 #: templates/frontend-template.php:87 41 41 msgid "At sight via debit" 42 42 msgstr "" 43 43 44 #: templates/businesspay-panel-gateway.php:3 145 #: includes/woocommerce-businesspay-gateway.php:2 2844 #: templates/businesspay-panel-gateway.php:30 45 #: includes/woocommerce-businesspay-gateway.php:240 46 46 msgid "Credit Card" 47 47 msgstr "" 48 48 49 #: templates/businesspay-panel-gateway.php:3 349 #: templates/businesspay-panel-gateway.php:32 50 50 msgid "Unknown Brand" 51 51 msgstr "" 52 52 53 #: templates/businesspay-panel-gateway.php:3 953 #: templates/businesspay-panel-gateway.php:38 54 54 #: templates/frontend-template.php:95 55 55 msgid "In " 56 56 msgstr "" 57 57 58 #: templates/businesspay-panel-gateway.php:3 958 #: templates/businesspay-panel-gateway.php:38 59 59 #: templates/frontend-template.php:95 60 60 msgid "x of " 61 61 msgstr "" 62 62 63 #: templates/businesspay-panel-gateway.php:3 963 #: templates/businesspay-panel-gateway.php:38 64 64 #: templates/frontend-template.php:95 65 65 msgid " on credit card" 66 66 msgstr "" 67 67 68 #: templates/businesspay-panel-gateway.php:4 368 #: templates/businesspay-panel-gateway.php:42 69 69 msgid "Bank Transference" 70 70 msgstr "" 71 71 72 #: templates/businesspay-panel-gateway.php:4 973 #: templates/businesspay-panel-gateway.php:5 774 #: templates/businesspay-panel-gateway.php:7 975 #: templates/businesspay-panel-gateway.php:8 772 #: templates/businesspay-panel-gateway.php:48 73 #: templates/businesspay-panel-gateway.php:56 74 #: templates/businesspay-panel-gateway.php:78 75 #: templates/businesspay-panel-gateway.php:86 76 76 msgid "Unavailable" 77 77 msgstr "" 78 78 79 #: templates/businesspay-panel-gateway.php:6 579 #: templates/businesspay-panel-gateway.php:64 80 80 #: templates/frontend-template.php:26 81 #: includes/woocommerce-businesspay-gateway.php:3 3381 #: includes/woocommerce-businesspay-gateway.php:345 82 82 msgid "Billet" 83 83 msgstr "" 84 84 85 #: templates/businesspay-panel-gateway.php:9 485 #: templates/businesspay-panel-gateway.php:93 86 86 msgid "Unknown" 87 87 msgstr "" 88 88 89 #: templates/businesspay-panel-gateway.php:102 90 msgid "Transaction Information" 91 msgstr "" 92 89 93 #: templates/businesspay-panel-gateway.php:103 90 msgid "Transaction Information"91 msgstr ""92 93 #: templates/businesspay-panel-gateway.php:10494 #: templates/businesspay-panel-antifraud.php:3395 94 msgid "Token: " 96 95 msgstr "" 97 96 98 #: templates/businesspay-panel-gateway.php:10 699 #: templates/businesspay-panel-antifraud.php:3 797 #: templates/businesspay-panel-gateway.php:105 98 #: templates/businesspay-panel-antifraud.php:36 100 99 msgid "Date: " 101 100 msgstr "" 102 101 103 #: templates/businesspay-panel-gateway.php:10 8104 #: templates/businesspay-panel-antifraud.php:3 9102 #: templates/businesspay-panel-gateway.php:107 103 #: templates/businesspay-panel-antifraud.php:38 105 104 msgid "Status: " 106 105 msgstr "" 107 106 107 #: templates/businesspay-panel-gateway.php:109 108 msgid "Payment Information" 109 msgstr "" 110 108 111 #: templates/businesspay-panel-gateway.php:110 109 msgid "Payment Information"110 msgstr ""111 112 #: templates/businesspay-panel-gateway.php:111113 112 msgid "Type: " 114 113 msgstr "" 115 114 116 #: templates/businesspay-panel-gateway.php:11 4115 #: templates/businesspay-panel-gateway.php:113 117 116 msgid "Brand: " 118 117 msgstr "" 119 118 120 #: templates/businesspay-panel-gateway.php:11 6119 #: templates/businesspay-panel-gateway.php:115 121 120 msgid "Installments: " 122 121 msgstr "" 123 122 124 #: templates/businesspay-panel-gateway.php:11 9123 #: templates/businesspay-panel-gateway.php:118 125 124 msgid "Origin Bank: " 126 125 msgstr "" 127 126 128 #: templates/businesspay-panel-gateway.php:12 1127 #: templates/businesspay-panel-gateway.php:120 129 128 msgid "Reference Code: " 130 129 msgstr "" 131 130 132 #: templates/businesspay-panel-gateway.php:12 3133 #: templates/businesspay-panel-gateway.php:13 5131 #: templates/businesspay-panel-gateway.php:122 132 #: templates/businesspay-panel-gateway.php:134 134 133 msgid "Payment Date: " 135 134 msgstr "" 136 135 137 #: templates/businesspay-panel-gateway.php:12 5138 #: templates/businesspay-panel-gateway.php:13 7136 #: templates/businesspay-panel-gateway.php:124 137 #: templates/businesspay-panel-gateway.php:136 139 138 msgid "Payment Amount: " 140 139 msgstr "" 141 140 142 #: templates/businesspay-panel-gateway.php:12 7141 #: templates/businesspay-panel-gateway.php:126 143 142 msgid "Provider Bank: " 144 143 msgstr "" 145 144 146 #: templates/businesspay-panel-gateway.php:12 9145 #: templates/businesspay-panel-gateway.php:128 147 146 msgid "Provider Reference: " 148 147 msgstr "" 149 148 150 #: templates/businesspay-panel-gateway.php:13 1149 #: templates/businesspay-panel-gateway.php:130 151 150 msgid "Emission Date: " 152 151 msgstr "" 153 152 154 #: templates/businesspay-panel-gateway.php:13 3153 #: templates/businesspay-panel-gateway.php:132 155 154 msgid "Expiration Date: " 156 155 msgstr "" … … 201 200 msgstr "" 202 201 203 #: templates/businesspay-panel-antifraud.php:3 2202 #: templates/businesspay-panel-antifraud.php:33 204 203 msgid "Analysis Information" 205 204 msgstr "" 206 205 207 #: templates/businesspay-panel-antifraud.php:3 5206 #: templates/businesspay-panel-antifraud.php:34 208 207 msgid "ID: " 209 208 msgstr "" 210 209 211 #: templates/businesspay-panel-antifraud.php:41 210 #: templates/businesspay-panel-antifraud.php:40 211 msgid "Score: " 212 msgstr "" 213 214 #: templates/businesspay-panel-antifraud.php:42 212 215 msgid "Message: " 213 216 msgstr "" … … 218 221 219 222 #: templates/frontend-template.php:21 220 #: includes/woocommerce-businesspay-gateway.php:3 25223 #: includes/woocommerce-businesspay-gateway.php:337 221 224 msgid "Bank Transfer" 222 225 msgstr "" … … 304 307 msgstr "" 305 308 306 #: includes/woocommerce-businesspay-gateway.php:2 5309 #: includes/woocommerce-businesspay-gateway.php:26 307 310 msgid "BusinessPay" 308 311 msgstr "" 309 312 310 #: includes/woocommerce-businesspay-gateway.php:2 6313 #: includes/woocommerce-businesspay-gateway.php:27 311 314 msgid "Accept payments using BusinessPay Gateway." 312 315 msgstr "" 313 316 314 #: includes/woocommerce-businesspay-gateway.php:1 56317 #: includes/woocommerce-businesspay-gateway.php:162 315 318 msgid "Account Enabled" 316 319 msgstr "" 317 320 318 #: includes/woocommerce-businesspay-gateway.php:1 56321 #: includes/woocommerce-businesspay-gateway.php:162 319 322 msgid "Account Disabled" 320 323 msgstr "" 321 324 322 #: includes/woocommerce-businesspay-gateway.php:1 57325 #: includes/woocommerce-businesspay-gateway.php:163 323 326 msgid "Installation Enabled" 324 327 msgstr "" 325 328 326 #: includes/woocommerce-businesspay-gateway.php:1 57329 #: includes/woocommerce-businesspay-gateway.php:163 327 330 msgid "Installation Disabled" 328 331 msgstr "" 329 332 330 #: includes/woocommerce-businesspay-gateway.php:1 58333 #: includes/woocommerce-businesspay-gateway.php:164 331 334 msgid "Antifraud Enabled" 332 335 msgstr "" 333 336 334 #: includes/woocommerce-businesspay-gateway.php:1 58337 #: includes/woocommerce-businesspay-gateway.php:164 335 338 msgid "Antifraud Disabled" 336 339 msgstr "" 337 340 338 #: includes/woocommerce-businesspay-gateway.php:160 341 #: includes/woocommerce-businesspay-gateway.php:165 342 msgid "Product not configured" 343 msgstr "" 344 345 #: includes/woocommerce-businesspay-gateway.php:167 339 346 msgid "Client Account:" 340 347 msgstr "" 341 348 342 #: includes/woocommerce-businesspay-gateway.php:16 1349 #: includes/woocommerce-businesspay-gateway.php:168 343 350 msgid "Client Installation:" 344 351 msgstr "" 345 352 346 #: includes/woocommerce-businesspay-gateway.php:16 2353 #: includes/woocommerce-businesspay-gateway.php:169 347 354 msgid "Client Antifraud:" 348 355 msgstr "" 349 356 350 #: includes/woocommerce-businesspay-gateway.php:171 357 #: includes/woocommerce-businesspay-gateway.php:170 358 msgid "Antifraud Product:" 359 msgstr "" 360 361 #: includes/woocommerce-businesspay-gateway.php:183 351 362 msgid "Antifraud by " 352 363 msgstr "" 353 364 354 #: includes/woocommerce-businesspay-gateway.php:1 80365 #: includes/woocommerce-businesspay-gateway.php:192 355 366 msgid "BusinessPay Payment Gateway" 356 367 msgstr "" 357 368 358 #: includes/woocommerce-businesspay-gateway.php:1 85369 #: includes/woocommerce-businesspay-gateway.php:197 359 370 msgid "Enable BusinessPay" 360 371 msgstr "" 361 372 362 #: includes/woocommerce-businesspay-gateway.php:1 86373 #: includes/woocommerce-businesspay-gateway.php:198 363 374 msgid "Enable BusinessPay Gateway Plugin" 364 375 msgstr "" 365 376 366 #: includes/woocommerce-businesspay-gateway.php:1 87377 #: includes/woocommerce-businesspay-gateway.php:199 367 378 msgid "Enable BusinessPay gateway plugin options." 368 379 msgstr "" 369 380 370 #: includes/woocommerce-businesspay-gateway.php: 193381 #: includes/woocommerce-businesspay-gateway.php:205 371 382 msgid "Title" 372 383 msgstr "" 373 384 374 #: includes/woocommerce-businesspay-gateway.php: 194385 #: includes/woocommerce-businesspay-gateway.php:206 375 386 msgid "Payment method title seen on the checkout page." 376 387 msgstr "" 377 388 378 #: includes/woocommerce-businesspay-gateway.php: 195389 #: includes/woocommerce-businesspay-gateway.php:207 379 390 msgid "BusinessPay | Payments via credit card, debit and billet." 380 391 msgstr "" 381 392 382 #: includes/woocommerce-businesspay-gateway.php:2 00393 #: includes/woocommerce-businesspay-gateway.php:212 383 394 msgid "Description" 384 395 msgstr "" 385 396 386 #: includes/woocommerce-businesspay-gateway.php:2 01397 #: includes/woocommerce-businesspay-gateway.php:213 387 398 msgid "Payment method description seen on the checkout page." 388 399 msgstr "" 389 400 390 #: includes/woocommerce-businesspay-gateway.php:2 02401 #: includes/woocommerce-businesspay-gateway.php:214 391 402 msgid "Pay using BusinessPay, a secure experience of online buys." 392 403 msgstr "" 393 404 394 #: includes/woocommerce-businesspay-gateway.php:2 07405 #: includes/woocommerce-businesspay-gateway.php:219 395 406 msgid "Gateway Settings" 396 407 msgstr "" 397 408 398 #: includes/woocommerce-businesspay-gateway.php:2 12409 #: includes/woocommerce-businesspay-gateway.php:224 399 410 msgid "Authentication API" 400 411 msgstr "" 401 412 402 #: includes/woocommerce-businesspay-gateway.php:2 13413 #: includes/woocommerce-businesspay-gateway.php:225 403 414 msgid "Use your BusinessPay Authentication API" 404 415 msgstr "" 405 416 406 #: includes/woocommerce-businesspay-gateway.php:2 20417 #: includes/woocommerce-businesspay-gateway.php:232 407 418 msgid "Authentication Key" 408 419 msgstr "" 409 420 410 #: includes/woocommerce-businesspay-gateway.php:2 21421 #: includes/woocommerce-businesspay-gateway.php:233 411 422 msgid "Use your BusinessPay Authentication Key" 412 423 msgstr "" 413 424 414 #: includes/woocommerce-businesspay-gateway.php:2 29425 #: includes/woocommerce-businesspay-gateway.php:241 415 426 msgid "Enable credit card payments with BusinessPay" 416 427 msgstr "" 417 428 418 #: includes/woocommerce-businesspay-gateway.php:2 30429 #: includes/woocommerce-businesspay-gateway.php:242 419 430 msgid "Enable credit card payment with BusinessPay on checkout page" 420 431 msgstr "" 421 432 422 #: includes/woocommerce-businesspay-gateway.php:2 35433 #: includes/woocommerce-businesspay-gateway.php:247 423 434 msgid "Credit Card Settings" 424 435 msgstr "" 425 436 426 #: includes/woocommerce-businesspay-gateway.php:2 41437 #: includes/woocommerce-businesspay-gateway.php:253 427 438 msgid "Name in Invoice" 428 439 msgstr "" 429 440 430 #: includes/woocommerce-businesspay-gateway.php:2 42441 #: includes/woocommerce-businesspay-gateway.php:254 431 442 msgid "" 432 443 "Name in Invoice to identify Shop. Its important to avoid gateway chargebacks." 433 444 msgstr "" 434 445 435 #: includes/woocommerce-businesspay-gateway.php:2 49446 #: includes/woocommerce-businesspay-gateway.php:261 436 447 msgid "Invoice Prefix" 437 448 msgstr "" 438 449 439 #: includes/woocommerce-businesspay-gateway.php:2 50450 #: includes/woocommerce-businesspay-gateway.php:262 440 451 msgid "Shop prefix to identify invoice shop origin" 441 452 msgstr "" 442 453 443 #: includes/woocommerce-businesspay-gateway.php:2 56454 #: includes/woocommerce-businesspay-gateway.php:268 444 455 msgid "Installments" 445 456 msgstr "" 446 457 447 #: includes/woocommerce-businesspay-gateway.php:2 58458 #: includes/woocommerce-businesspay-gateway.php:270 448 459 msgid "Enable Installments" 449 460 msgstr "" 450 461 451 #: includes/woocommerce-businesspay-gateway.php:2 62462 #: includes/woocommerce-businesspay-gateway.php:274 452 463 msgid "Installments Settings" 453 464 msgstr "" 454 465 455 #: includes/woocommerce-businesspay-gateway.php:2 67466 #: includes/woocommerce-businesspay-gateway.php:279 456 467 msgid "Minimum Installment" 457 468 msgstr "" 458 469 459 #: includes/woocommerce-businesspay-gateway.php:2 69470 #: includes/woocommerce-businesspay-gateway.php:281 460 471 msgid "Indicate the minimum installments." 461 472 msgstr "" 462 473 463 #: includes/woocommerce-businesspay-gateway.php: 288474 #: includes/woocommerce-businesspay-gateway.php:300 464 475 msgid "Maximum Installment" 465 476 msgstr "" 466 477 467 #: includes/woocommerce-businesspay-gateway.php: 290478 #: includes/woocommerce-businesspay-gateway.php:302 468 479 msgid "Indicate the Maximum installments." 469 480 msgstr "" 470 481 471 #: includes/woocommerce-businesspay-gateway.php:3 09482 #: includes/woocommerce-businesspay-gateway.php:321 472 483 msgid "Minimum Value" 473 484 msgstr "" 474 485 475 #: includes/woocommerce-businesspay-gateway.php:3 10486 #: includes/woocommerce-businesspay-gateway.php:322 476 487 msgid "Minimum value by installment" 477 488 msgstr "" 478 489 479 #: includes/woocommerce-businesspay-gateway.php:3 18490 #: includes/woocommerce-businesspay-gateway.php:330 480 491 msgid "Enable debit card payments with BusinessPay" 481 492 msgstr "" 482 493 483 #: includes/woocommerce-businesspay-gateway.php:3 19494 #: includes/woocommerce-businesspay-gateway.php:331 484 495 msgid "Enable debit card payment on checkout page" 485 496 msgstr "" 486 497 487 #: includes/woocommerce-businesspay-gateway.php:3 26498 #: includes/woocommerce-businesspay-gateway.php:338 488 499 msgid "Enable bank transfer payments with BusinessPay" 489 500 msgstr "" 490 501 491 #: includes/woocommerce-businesspay-gateway.php:3 27502 #: includes/woocommerce-businesspay-gateway.php:339 492 503 msgid "Enable bank transfer payment on checkout page" 493 504 msgstr "" 494 505 495 #: includes/woocommerce-businesspay-gateway.php:3 34506 #: includes/woocommerce-businesspay-gateway.php:346 496 507 msgid "Enable billet payments with BusinessPay" 497 508 msgstr "" 498 509 499 #: includes/woocommerce-businesspay-gateway.php:3 35510 #: includes/woocommerce-businesspay-gateway.php:347 500 511 msgid "Enable billet payment on checkout page" 501 512 msgstr "" 502 513 503 #: includes/woocommerce-businesspay-gateway.php:3 40514 #: includes/woocommerce-businesspay-gateway.php:352 504 515 msgid "Billet Settings" 505 516 msgstr "" 506 517 507 #: includes/woocommerce-businesspay-gateway.php:3 46518 #: includes/woocommerce-businesspay-gateway.php:358 508 519 msgid "Custom Logo URL" 509 520 msgstr "" 510 521 511 #: includes/woocommerce-businesspay-gateway.php:3 47522 #: includes/woocommerce-businesspay-gateway.php:359 512 523 msgid "URL logo image to be shown on the billet" 513 524 msgstr "" 514 525 515 #: includes/woocommerce-businesspay-gateway.php:3 52526 #: includes/woocommerce-businesspay-gateway.php:364 516 527 msgid "Number of Days" 517 528 msgstr "" 518 529 519 #: includes/woocommerce-businesspay-gateway.php:3 54530 #: includes/woocommerce-businesspay-gateway.php:366 520 531 msgid "Days of expiry of the billet after printed." 521 532 msgstr "" 522 533 523 #: includes/woocommerce-businesspay-gateway.php:3 61534 #: includes/woocommerce-businesspay-gateway.php:373 524 535 msgid "Instruction Line" 525 536 msgstr "" 526 537 527 #: includes/woocommerce-businesspay-gateway.php:3 62538 #: includes/woocommerce-businesspay-gateway.php:374 528 539 msgid "Billet instruction line" 529 540 msgstr "" 530 541 531 #: includes/woocommerce-businesspay-gateway.php:3 67542 #: includes/woocommerce-businesspay-gateway.php:379 532 543 msgid "Tools" 533 544 msgstr "" 534 545 535 #: includes/woocommerce-businesspay-gateway.php:3 73546 #: includes/woocommerce-businesspay-gateway.php:385 536 547 msgid "BusinessPay Sandbox" 537 548 msgstr "" 538 549 539 #: includes/woocommerce-businesspay-gateway.php:3 74550 #: includes/woocommerce-businesspay-gateway.php:386 540 551 msgid "Enable BusinessPay sandbox mode" 541 552 msgstr "" 542 553 543 #: includes/woocommerce-businesspay-gateway.php:3 75554 #: includes/woocommerce-businesspay-gateway.php:387 544 555 msgid "Enable BusinessPay Sandbox" 545 556 msgstr "" 546 557 547 #: includes/woocommerce-businesspay-gateway.php:3 82558 #: includes/woocommerce-businesspay-gateway.php:394 548 559 msgid "Debug" 549 560 msgstr "" 550 561 551 #: includes/woocommerce-businesspay-gateway.php:3 83562 #: includes/woocommerce-businesspay-gateway.php:395 552 563 msgid "Enable logging" 553 564 msgstr "" 554 565 555 #: includes/woocommerce-businesspay-gateway.php: 389566 #: includes/woocommerce-businesspay-gateway.php:401 556 567 msgid "Status" 557 568 msgstr "" 558 569 559 #: includes/woocommerce-businesspay-gateway.php:4 11570 #: includes/woocommerce-businesspay-gateway.php:423 560 571 msgid "Card number must be at least 16 characters." 561 572 msgstr "" 562 573 563 #: includes/woocommerce-businesspay-gateway.php:4 14574 #: includes/woocommerce-businesspay-gateway.php:426 564 575 msgid "The Card Number field must be numeric." 565 576 msgstr "" 566 577 567 #: includes/woocommerce-businesspay-gateway.php:4 17578 #: includes/woocommerce-businesspay-gateway.php:429 568 579 msgid "Invalid card number." 569 580 msgstr "" 570 581 571 #: includes/woocommerce-businesspay-gateway.php:4 24582 #: includes/woocommerce-businesspay-gateway.php:436 572 583 msgid "The Name field can not be less than 6 characters." 573 584 msgstr "" 574 585 575 #: includes/woocommerce-businesspay-gateway.php:4 27586 #: includes/woocommerce-businesspay-gateway.php:439 576 587 msgid "The Name field can not be greater than 25 characters." 577 588 msgstr "" 578 589 579 #: includes/woocommerce-businesspay-gateway.php:4 30590 #: includes/woocommerce-businesspay-gateway.php:442 580 591 msgid "The Name field can not have numbers." 581 592 msgstr "" 582 593 583 #: includes/woocommerce-businesspay-gateway.php:4 40594 #: includes/woocommerce-businesspay-gateway.php:452 584 595 msgid "The Month of Expiration field must have 2 digits." 585 596 msgstr "" 586 597 587 #: includes/woocommerce-businesspay-gateway.php:4 43598 #: includes/woocommerce-businesspay-gateway.php:455 588 599 msgid "The Month of Expiration field must be numeric." 589 600 msgstr "" 590 601 591 #: includes/woocommerce-businesspay-gateway.php:4 46602 #: includes/woocommerce-businesspay-gateway.php:458 592 603 msgid "The Year of Expiration field must be numeric." 593 604 msgstr "" 594 605 595 #: includes/woocommerce-businesspay-gateway.php:4 49606 #: includes/woocommerce-businesspay-gateway.php:461 596 607 msgid "The Year of Expiration field must have 4 digits." 597 608 msgstr "" 598 609 599 #: includes/woocommerce-businesspay-gateway.php:4 56600 #: includes/woocommerce-businesspay-gateway.php:4 62610 #: includes/woocommerce-businesspay-gateway.php:468 611 #: includes/woocommerce-businesspay-gateway.php:474 601 612 msgid "The CVC field must have 3 or 4 digits." 602 613 msgstr "" 603 614 604 #: includes/woocommerce-businesspay-gateway.php:4 59615 #: includes/woocommerce-businesspay-gateway.php:471 605 616 msgid "The CVC field must be numeric." 606 617 msgstr "" 607 618 608 #: includes/woocommerce-businesspay-gateway.php:4 69619 #: includes/woocommerce-businesspay-gateway.php:481 609 620 msgid "Please select a installment option." 610 621 msgstr "" 611 622 612 #: includes/woocommerce-businesspay-gateway.php:4 76623 #: includes/woocommerce-businesspay-gateway.php:492 613 624 msgid "The Document field must have 11 digits for CPF or 14 digits for CNPJ." 614 625 msgstr "" 615 626 616 #: includes/woocommerce-businesspay-gateway.php:4 79627 #: includes/woocommerce-businesspay-gateway.php:495 617 628 msgid "The Document field must be numeric." 618 629 msgstr "" 619 630 620 #: includes/woocommerce-businesspay-gateway.php:4 82631 #: includes/woocommerce-businesspay-gateway.php:498 621 632 msgid "The Document field as CPF is invalid." 622 633 msgstr "" 623 634 624 #: includes/woocommerce-businesspay-gateway.php: 485635 #: includes/woocommerce-businesspay-gateway.php:501 625 636 msgid "The Document field as CNPJ is invalid." 626 637 msgstr "" 627 638 628 #: includes/woocommerce-businesspay-gateway.php: 493639 #: includes/woocommerce-businesspay-gateway.php:509 629 640 msgid "Please select a origin transfer bank option." 630 641 msgstr "" 631 642 632 #: includes/woocommerce-businesspay-gateway.php: 499633 #: includes/woocommerce-businesspay-gateway.php:5 12643 #: includes/woocommerce-businesspay-gateway.php:515 644 #: includes/woocommerce-businesspay-gateway.php:528 634 645 msgid "The Neighborhood field need to be filled." 635 646 msgstr "" 636 647 637 #: includes/woocommerce-businesspay-gateway.php:5 06648 #: includes/woocommerce-businesspay-gateway.php:522 638 649 msgid "Please select a origin billet bank option." 639 650 msgstr "" 640 651 641 #: includes/woocommerce-businesspay-gateway.php:5 32652 #: includes/woocommerce-businesspay-gateway.php:546 642 653 msgid "BusinessPay | Debit Card" 643 654 msgstr "" 644 655 645 #: includes/woocommerce-businesspay-gateway.php:5 35656 #: includes/woocommerce-businesspay-gateway.php:548 646 657 msgid "BusinessPay | Credit Card" 647 658 msgstr "" 648 659 649 #: includes/woocommerce-businesspay-gateway.php:5 40660 #: includes/woocommerce-businesspay-gateway.php:550 650 661 msgid "BusinessPay | Bank Transfer" 651 662 msgstr "" 652 663 653 #: includes/woocommerce-businesspay-gateway.php:5 44664 #: includes/woocommerce-businesspay-gateway.php:552 654 665 msgid "BusinessPay | Billet" 655 666 msgstr "" 656 667 657 #: includes/woocommerce-businesspay-gateway.php:555 658 #: includes/woocommerce-businesspay-gateway.php:1138 659 msgid "" 660 "BusinessPay: There was an error performing the transaction. Please contact " 661 "us." 662 msgstr "" 663 664 #: includes/woocommerce-businesspay-gateway.php:556 665 #: includes/woocommerce-businesspay-gateway.php:983 666 #: includes/woocommerce-businesspay-gateway.php:1024 667 msgid "Could not receive a valid server response. Please try again." 668 msgstr "" 669 670 #: includes/woocommerce-businesspay-gateway.php:579 671 #: includes/woocommerce-businesspay-gateway.php:626 672 #: includes/woocommerce-businesspay-gateway.php:675 673 #: includes/woocommerce-businesspay-gateway.php:729 674 msgid "Woocommerce Order" 675 msgstr "" 676 677 #: includes/woocommerce-businesspay-gateway.php:980 668 #: includes/woocommerce-businesspay-gateway.php:732 678 669 msgid "" 679 670 "The credentials for this virtual store are not valid on the BusinessPay " … … 681 672 msgstr "" 682 673 683 #: includes/woocommerce-businesspay-gateway.php:1021 674 #: includes/woocommerce-businesspay-gateway.php:735 675 #: includes/woocommerce-businesspay-gateway.php:1311 676 msgid "Could not receive a valid server response. Please try again." 677 msgstr "" 678 679 #: includes/woocommerce-businesspay-gateway.php:828 680 msgid "BusinessPay Status: " 681 msgstr "" 682 683 #: includes/woocommerce-businesspay-gateway.php:1022 684 msgid "Transaction started but not confirmed." 685 msgstr "" 686 687 #: includes/woocommerce-businesspay-gateway.php:1025 688 msgid "Awating payment." 689 msgstr "" 690 691 #: includes/woocommerce-businesspay-gateway.php:1028 692 msgid "Transaction effectivated." 693 msgstr "" 694 695 #: includes/woocommerce-businesspay-gateway.php:1031 696 msgid "Transaction under analysis." 697 msgstr "" 698 699 #: includes/woocommerce-businesspay-gateway.php:1034 700 msgid "Transaction expired." 701 msgstr "" 702 703 #: includes/woocommerce-businesspay-gateway.php:1037 704 msgid "Transaction authorized." 705 msgstr "" 706 707 #: includes/woocommerce-businesspay-gateway.php:1040 708 msgid "Transaction confirmed." 709 msgstr "" 710 711 #: includes/woocommerce-businesspay-gateway.php:1043 712 msgid "Transaction denied." 713 msgstr "" 714 715 #: includes/woocommerce-businesspay-gateway.php:1046 716 msgid "Cancellation in progress." 717 msgstr "" 718 719 #: includes/woocommerce-businesspay-gateway.php:1049 720 msgid "Transaction Canceled." 721 msgstr "" 722 723 #: includes/woocommerce-businesspay-gateway.php:1052 724 msgid "Transaction pending of confirmation." 725 msgstr "" 726 727 #: includes/woocommerce-businesspay-gateway.php:1055 728 msgid "Failure to communicate with the provider." 729 msgstr "" 730 731 #: includes/woocommerce-businesspay-gateway.php:1058 732 msgid "No valid server response." 733 msgstr "" 734 735 #: includes/woocommerce-businesspay-gateway.php:1077 736 msgid "payment made less than the value of the order." 737 msgstr "" 738 739 #: includes/woocommerce-businesspay-gateway.php:1308 684 740 msgid "" 685 741 "The credentials for this virtual store are not valid on the BusinessPay " … … 687 743 msgstr "" 688 744 689 #: includes/woocommerce-businesspay-gateway.php:1120 690 msgid "BusinessPay Status: " 691 msgstr "" 692 693 #: includes/woocommerce-businesspay-gateway.php:1366 694 msgid "Transaction started but not confirmed." 695 msgstr "" 696 697 #: includes/woocommerce-businesspay-gateway.php:1369 698 msgid "Awating payment." 699 msgstr "" 700 701 #: includes/woocommerce-businesspay-gateway.php:1372 702 msgid "Transaction effectivated." 703 msgstr "" 704 705 #: includes/woocommerce-businesspay-gateway.php:1375 706 msgid "Transaction under analysis." 707 msgstr "" 708 709 #: includes/woocommerce-businesspay-gateway.php:1378 710 msgid "Transaction expired." 711 msgstr "" 712 713 #: includes/woocommerce-businesspay-gateway.php:1381 714 msgid "Transaction authorized." 715 msgstr "" 716 717 #: includes/woocommerce-businesspay-gateway.php:1384 718 msgid "Transaction confirmed." 719 msgstr "" 720 721 #: includes/woocommerce-businesspay-gateway.php:1387 722 msgid "Transaction denied." 723 msgstr "" 724 725 #: includes/woocommerce-businesspay-gateway.php:1390 726 msgid "Cancellation in progress." 727 msgstr "" 728 729 #: includes/woocommerce-businesspay-gateway.php:1393 730 msgid "Transaction Canceled." 731 msgstr "" 732 733 #: includes/woocommerce-businesspay-gateway.php:1396 734 msgid "Transaction pending of confirmation." 735 msgstr "" 736 737 #: includes/woocommerce-businesspay-gateway.php:1399 738 msgid "Failure to communicate with the provider." 739 msgstr "" 740 741 #: includes/woocommerce-businesspay-gateway.php:1402 742 msgid "No valid server response." 743 msgstr "" 744 745 #: includes/woocommerce-businesspay-gateway.php:1410 746 msgid "The order will be analyzed by antifraud software" 747 msgstr "" 748 749 #: includes/woocommerce-businesspay-gateway.php:1417 750 msgid "payment made less than the value of the order." 751 msgstr "" 752 753 #: includes/woocommerce-businesspay-gateway.php:2631 754 #: includes/woocommerce-businesspay-gateway.php:2638 745 #: includes/woocommerce-businesspay-gateway.php:1354 746 msgid "Antifraud Status: " 747 msgstr "" 748 749 #: includes/woocommerce-businesspay-gateway.php:1486 750 msgid "" 751 "Order was automatically approved according to parameters defined in the " 752 "automatic approval rule." 753 msgstr "" 754 755 #: includes/woocommerce-businesspay-gateway.php:1489 756 msgid "Order is queued for analysis." 757 msgstr "" 758 759 #: includes/woocommerce-businesspay-gateway.php:1492 760 msgid "Order manually approved by decision-making of an analyst." 761 msgstr "" 762 763 #: includes/woocommerce-businesspay-gateway.php:1495 764 msgid "" 765 "Order approved automatically by client-established policy or antifraud " 766 "software rule." 767 msgstr "" 768 769 #: includes/woocommerce-businesspay-gateway.php:1498 770 msgid "Canceled by customer or duplicated order." 771 msgstr "" 772 773 #: includes/woocommerce-businesspay-gateway.php:1501 774 msgid "" 775 "Order imputed as fraud confirmed by contact with the card administrator and " 776 "/ or contact with the card holder or CPF of the registry that is unaware of " 777 "the purchase." 778 msgstr "" 779 780 #: includes/woocommerce-businesspay-gateway.php:1504 781 msgid "Order imported and not classified Score by the analyzer yet." 782 msgstr "" 783 784 #: includes/woocommerce-businesspay-gateway.php:1507 785 msgid "" 786 "Order Automatically Disapproved by some type of business rule that needs to " 787 "be applied." 788 msgstr "" 789 790 #: includes/woocommerce-businesspay-gateway.php:1510 791 msgid "" 792 "Order disapproved without suspicion by lack of contact with the client " 793 "within the agreed period and / or social security number of restrictive " 794 "policies (Irregular, SUS or Canceled)." 795 msgstr "" 796 797 #: includes/woocommerce-businesspay-gateway.php:1513 798 msgid "" 799 "Order disapproved automatically by policy established by customer or " 800 "antifraud software." 801 msgstr "" 802 803 #: includes/woocommerce-businesspay-gateway.php:1516 804 msgid "" 805 "Order automatically approved by policy established by the customer or " 806 "antifraud software." 807 msgstr "" 808 809 #: includes/woocommerce-businesspay-gateway.php:1639 810 msgid "Woocommerce Order" 811 msgstr "" 812 813 #: includes/woocommerce-businesspay-gateway.php:2974 814 #: includes/woocommerce-businesspay-gateway.php:2981 755 815 msgid "BusinessPay Disabled" 756 816 msgstr "" 757 817 758 #: includes/woocommerce-businesspay-gateway.php:2 632818 #: includes/woocommerce-businesspay-gateway.php:2975 759 819 msgid "You must enable at least one form of payment." 760 820 msgstr "" 761 821 762 #: includes/woocommerce-businesspay-gateway.php:2 633822 #: includes/woocommerce-businesspay-gateway.php:2976 763 823 msgid "Click here to configure!" 764 824 msgstr "" 765 825 766 #: includes/woocommerce-businesspay-gateway.php:2 639826 #: includes/woocommerce-businesspay-gateway.php:2982 767 827 #, php-format 768 828 msgid "" -
woo-businesspay/trunk/readme.txt
r1969509 r1977545 20 20 Através do painel de administração dos pedidos do WooCommerce, você tem acesso a todas as informações disponíveis sobre a transação, os status informados pelo software antifraude e rede adquirente e a captura, para que você tenha total segurança em cada operação. 21 21 Este plugin utiliza antifraude da ClearSale nativamente, isso significa que você não precisa se preocupar com configurações, nós cuidamos de tudo pra você. 22 O software antifraude da ClearSale verifica a possibilidade de fraude em uma transação e impede que ela seja realizada. Caso não seja possível detectar a fraude, o valor da transação é ressarcido em sua intregralidade, fazendo com que sua taxa de chargeback sempre fique baixa. 22 23 = Os seguintes produtos antifraude da ClearSale são compatíveis: = 24 * Realtime Decision; 25 * ClearSale Total; 26 * Total Garantido; 27 * Application; 28 23 29 Saiba mais em [ClearSale para E-Commerce](https://br.clear.sale/antifraude/ecommerce). 24 30 … … 27 33 = Para Compradores = 28 34 Para o comprador, oferecemos a melhor experiência de compra, com facilidade de uso e segurança sempre. 29 O comprador conta também com um cartão visual na página de finalização do pedido para facilitar a inserção das informações. 35 Oferecemos também um cartão visual na página de finalização do pedido para facilitar a inserção dos dados do cartão. 36 37 = Os seguintes meios de pagamento são compatíveis: = 38 * Cartão de Crédito; 39 * Cartão de débito; 40 * Boleto Bancário via Bradesco ou Itaú; 41 * Transferência bancária via Bradesco ou Itaú; 42 43 = As seguintes bandeiras de cartão de crédito são compatíveis: = 44 * American Express; 45 * Aura; 46 * Discover; 47 * Elo; 48 * Hiper; 49 * Hipercard; 50 * JCB; 51 * Mastercard; 52 * Visa; 30 53 31 54 = Compatibilidade = … … 57 80 * Não, sua conta da BusinessPay estará integrada automaticamente. 58 81 82 == Upgrade Notice == 83 = 1.0.6 - 2018/11/20 = 84 * Add | Inserted Default Authentication Key and API to sandbox mode. 85 * Add | Admin panel antifraud product info. 86 * Add | Antifraud product Realtime Decision compatibility. 87 * Add | Async antifraud webhook consult status. 88 * Fix | Void index.php created in each plugin folder. 89 * Fix | Performance and code structure improvement. 90 59 91 == Changelog == 60 = 1.0.0 - 2018/10/25 = 61 * Add | initial upload to plugin repository. 62 63 = 1.0.1 - 2018/10/25 = 64 * Add | Presentation and information contact updated. 65 * Fix | initial upload to plugin repository. 66 67 = 1.0.2 - 2018/10/25 = 68 * Fix | Fixed an issue with .po and .mo files. 69 * Fix | Fixed authentication issues. 70 * Add | Woocommerce version compatibility declaration. 71 72 = 1.0.3 - 2018/10/31 = 73 * Add | Ajust WooCommerce order metadata to be hidden. 74 * Add | Antifraud info panel on admin order edit page. 75 * Fix | CamelCase translations fixed. 76 77 = 1.0.4 - 2018/11/01 = 78 * Fix | Fixed missing sanitize fields. 79 * Fix | Antifraud address neighborhood missing. 80 * Fix | Antifraud address complement missing. 92 = 1.0.6 - 2018/11/20 = 93 * Add | Inserted Default Authentication Key and API to sandbox mode. 94 * Add | Admin panel antifraud product info. 95 * Add | Antifraud product Realtime Decision compatibility. 96 * Add | Async antifraud webhook consult status. 97 * Fix | Void index.php created in each plugin folder. 98 * Fix | Performance and code structure improvement. 81 99 82 100 = 1.0.5 - 2018/11/05 = … … 92 110 * Fix | Fix date calculation error. 93 111 94 == Upgrade Notice == 95 = 1.0.5 - 2018/11/05 = 96 * Fix | Plugin readme updated. 97 * Add | Added WooCommerce 3.5 compatibility. 98 * Add | Added Storefront theme 2.3.5 compatibility. 99 * Add | Added Screenshoots. 100 * Add | Added Screenshoots descriptions. 101 * Add | Added WooCommerce Visual Card dependency. 102 * Fix | Wrong WooCommerce Visual Card slug. 103 * Fix | Old WooCommerce version compatibility with get_option. 104 * Fix | Better variables naming convention. 105 * Fix | Fix date calculation error. 112 = 1.0.4 - 2018/11/01 = 113 * Fix | Fixed missing sanitize fields. 114 * Fix | Antifraud address neighborhood missing. 115 * Fix | Antifraud address complement missing. 116 117 = 1.0.3 - 2018/10/31 = 118 * Add | Ajust WooCommerce order metadata to be hidden. 119 * Add | Antifraud info panel on admin order edit page. 120 * Fix | CamelCase translations fixed. 121 122 = 1.0.2 - 2018/10/25 = 123 * Fix | Fixed an issue with .po and .mo files. 124 * Fix | Fixed authentication issues. 125 * Add | Woocommerce version compatibility declaration. 126 127 = 1.0.1 - 2018/10/25 = 128 * Add | Presentation and information contact updated. 129 * Fix | initial upload to plugin repository. 130 131 = 1.0.0 - 2018/10/25 = 132 * Add | initial upload to plugin repository. -
woo-businesspay/trunk/templates/businesspay-panel-antifraud.php
r1966657 r1977545 14 14 $af_transaction_id = get_post_meta( $oid, '_businesspay-antifraud-transaction-id', true ); 15 15 if ( strlen( $af_transaction_id ) > 0 ) { 16 $af_woo_currency = get_woocommerce_currency_symbol(); 16 $af_id = get_post_meta( $oid, '_businesspay-antifraud-transaction-id', true ); 17 17 18 $af_transaction_date = str_replace( 'T', ' ', get_post_meta( $oid, '_businesspay-antifraud-transaction-date', true ) ); 18 19 $af_transaction_date = date_create_from_format( $bpConfig->get_date_format(), $af_transaction_date ); 19 20 $af_transaction_date = $af_transaction_date->format( 'd/m/Y ' . esc_html__( '\a\t', 'woocommerce-businesspay' ) . ' H:i:s' ); 20 21 21 $af_id = get_post_meta( $oid, '_businesspay-antifraud-id', true );22 23 22 $af_transaction_status = get_post_meta( $oid, '_businesspay-antifraud-status-code', true ) . ' - ' . get_post_meta( $oid, '_businesspay-antifraud-status', true ); 24 $af_message = get_post_meta( $oid, '_businesspay-antifraud-message', true ); 23 $af_score = get_post_meta( $oid, '_businesspay-antifraud-score', true ); 24 $af_message = get_post_meta( $oid, '_businesspay-antifraud-message', true ); 25 25 26 26 ?> … … 28 28 <h3><?php esc_html_e( 'Antifraud', 'woosommerce-businesspay' ); ?></h3> 29 29 <div class="businesspay-admin-order-payment"> 30 <img src='<?php echo plugins_url( 'assets/img/businesspay-logotipo-clearsale.png', dirname( __FILE__ ) ); ?>' style='width: 108px;'> 30 <img src='<?php echo plugins_url( 'assets/img/businesspay-logotipo-clearsale.png', dirname( __FILE__ ) ); ?>' 31 style='width: 108px;'> 31 32 <p> 32 33 <strong><?php esc_html_e( 'Analysis Information', 'woocommerce-businesspay' ); ?></strong><br/> 33 <strong><?php esc_html_e( 'Token: ', 'woocommerce-businesspay' ); ?></strong><?php echo $af_transaction_id; ?> 34 <br/> 35 <strong><?php esc_html_e( 'ID: ', 'woocommerce-businesspay' ); ?></strong><?php echo $af_id; ?> 34 <strong><?php esc_html_e( 'ID: ', 'woocommerce-businesspay' ); ?></strong><?php echo $af_transaction_id; ?> 36 35 <br/> 37 36 <strong><?php esc_html_e( 'Date: ', 'woocommerce-businesspay' ); ?></strong><?php echo $af_transaction_date; ?> … … 39 38 <strong><?php esc_html_e( 'Status: ', 'woocommerce-businesspay' ); ?></strong><?php echo $af_transaction_status; ?> 40 39 <br/> 41 <strong><?php esc_html_e( 'Message: ', 'woocommerce-businesspay' ); ?></strong><?php echo $af_message; ?> 40 <strong><?php esc_html_e( 'Score: ', 'woocommerce-businesspay' ); ?></strong><?php echo $af_score; ?> 41 <br/> 42 <strong><?php esc_html_e( 'Message: ', 'woocommerce-businesspay' ); ?></strong><?php echo $af_score; ?> 42 43 <br/> 43 44 </p> -
woo-businesspay/trunk/templates/businesspay-panel-gateway.php
r1966657 r1977545 8 8 9 9 if ( isset( $bpConfig ) ) { 10 11 10 $order = wc_get_order( $post->ID ); 12 11 $oid = $bpConfig->get_order_id( $order ); -
woo-businesspay/trunk/woocommerce-businesspay.php
r1969506 r1977545 6 6 * Author: BusinessPay 7 7 * Author URI: https://www.businesspay.com.br/ 8 * Version: 1.0. 58 * Version: 1.0.6 9 9 * Text Domain: woocommerce-businesspay 10 10 * Domain Path: /languages … … 19 19 20 20 class WC_BusinessPay { 21 const VERSION = '1.0. 5';21 const VERSION = '1.0.6'; 22 22 const VERSION_MIN_PHP = '5.4'; 23 23 const VERSION_MIN_WP = '4.7'; … … 29 29 30 30 public function __construct() { 31 32 31 add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); 33 32 if ( $this->check_dependency() ) { … … 86 85 return $methods; 87 86 } 87 88 88 89 89
Note: See TracChangeset
for help on using the changeset viewer.