Skip to content

Commit

Permalink
Merge pull request pagseguro#1 from netoht/master
Browse files Browse the repository at this point in the history
Corrigido o bug de flag enabled com o valor 0 ou 1 para 'yes' ou 'no'
  • Loading branch information
cegoncalves committed Oct 24, 2014
2 parents cd3fd17 + 700761c commit 518bae4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: php
php:
- "5.4"
- "5.3"
- "5.2"
before_script:
- pear install --alldeps pear/PHP_CodeSniffer
- phpenv rehash
script:
- phpcs --extensions=php -p --standard=PSR2 ./
Binary file modified wpwcpagseguro.zip
Binary file not shown.
7 changes: 5 additions & 2 deletions wpwcpagseguro/wpwcpagseguro.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ public function __construct() {
add_action( 'woocommerce_update_options_payment_gateways', array( &$this, 'process_admin_options' ) );
}

$this->enabled = ( 'yes' == $this->settings['enabled'] ) && ! empty( $this->email ) && ! empty( $this->token ) && $this->is_valid_for_use();
$this->enabled = 'no';
if ((( 'yes' == $this->settings['enabled'] ) && ! empty( $this->email ) && ! empty( $this->token ) && $this->is_valid_for_use())) {
$this->enabled = 'yes';
}

// Checks if email is not empty.
if ( empty( $this->email ) ) {
Expand Down Expand Up @@ -171,7 +174,7 @@ public function init_form_fields() {

$this->form_fields = array(
'enabled' => array(
'title' => __ ( 'Enable/Disable', 'wpwcpagseguro' ),
'title' => __( 'Enable/Disable', 'wpwcpagseguro' ),
'type' => 'checkbox',
'label' => __( 'Enable module?', 'wpwcpagseguro' ),
'default' => 'yes'
Expand Down

0 comments on commit 518bae4

Please sign in to comment.