Plugin Directory

Changeset 1292654


Ignore:
Timestamp:
11/23/2015 01:54:09 PM (10 years ago)
Author:
ConsidS5
Message:

new version 1.0.3wo

Location:
easycontract
Files:
1 deleted
5 edited
10 copied

Legend:

Unmodified
Added
Removed
  • easycontract/tags/1.0.3wo/ext/santander/src/Santander/base/Logger.php

    r1279484 r1292654  
    4242       
    4343        $this->filename = $this->savePath . DIRECTORY_SEPARATOR . $filename;
    44         //$this->sendAndDeletePreviousLog();
    4544    }
    4645   
     
    140139        }
    141140    }
    142    
    143     /**
    144      * Send/transfer previous log file to the log handler system and delete it on
    145      * the server.
    146      * @return boolean
    147      */
    148     public function sendAndDeletePreviousLog() {
    149         $yesterday = strtotime('-1 day');
    150         $filename = SANTANDER_LIB_PATH . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR . strtr($this->filenameTemplate, array('{date}' => date('Ymd', $yesterday)));
    151        
    152         if (file_exists($filename)) {
    153             /**
    154              * @todo replace mail with ftp or other type of file tranfer
    155              */
    156             $from = \Santander::$api->config->getSiteEmailAddress();
    157             $to = \Santander::$api->config->getLogEmailAddress();
    158            
    159             $message = \Swift_Message::newInstance()
    160                 ->setSubject(Message::translate('Log file from {system}', array('system' => \Santander::$api->config->getSiteName()), Language::DEFAULT_LANGUAGE))
    161                 ->setFrom($from)
    162                 ->setTo($to)
    163                 ->attach(\Swift_Attachment::fromPath($filename))
    164                 ->setBody(
    165                     Message::translate(
    166                         'Log file from {yesterday} for {system} is attached in this e-mail.',
    167                         array(
    168                             'yesterday' => date('Y-m-d', $yesterday),
    169                             'system' => \Santander::$api->config->getPlatformName()
    170                         ),
    171                         Language::DEFAULT_LANGUAGE
    172                     )
    173                 );
    174            
    175             $transport = \Swift_MailTransport::newInstance();
    176             $mailer = \Swift_Mailer::newInstance($transport);
    177            
    178             if (!$mailer->send($message, $failures)) {
    179                 $this->log(static::LEVEL_ERROR, 'Unable to send log mail', array(
    180                     'from' => $from,
    181                     'to' => $to,
    182                     'rejected' => $failures,
    183                 ));
    184                
    185                 return FALSE;
    186             }
    187            
    188             @unlink($filename);
    189             return TRUE;
    190         }
    191        
    192         return TRUE;
    193     }
    194141}
  • easycontract/tags/1.0.3wo/includes/classes/Santander_APIConnector.php

    r1279385 r1292654  
    121121   
    122122    private function _getModuleVersion() {
    123         return '1.0.0wo';
     123        return '1.0.3wo';
    124124    }
    125125   
  • easycontract/tags/1.0.3wo/readme.txt

    r1283245 r1292654  
    44Requires at least: 4.0
    55Tested up to: 4.3.1
    6 Stable tag: 1.0.2wo
     6Stable tag: 1.0.3wo
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2121
    2222== Changelog ==
     23= 1.0.3wo =
     24* Bug: Return URL did not work when permalinks had another format then ’Default’.
     25* Removed: Santander\base\sendAndDeletePreviousLog() have never been used and is now removed.
     26
    2327= 1.0.2wo =
    2428* Fix: syntax error in src/Santander/i18n/Message.php.
  • easycontract/tags/1.0.3wo/santander.php

    r1283259 r1292654  
    44Plugin URI: https://github.com/SantanderApps/SantanderPaymentProviderWooCommerce
    55Description: Integrates Santander Consumer Bank into WooCommerce.
    6 Version: 1.0.2wo
     6Version: 1.0.3wo
    77Author: Santander
    88Author URI: http://santander.consid.se
     
    107107    $santander_log_page_id = get_option( 'santander_log_page' );
    108108   
    109     if ( $query->is_main_query() && isset( $_GET['page_id'] ) && $_GET['page_id'] == $checkout_page_id && isset( $_GET['token'] ) ) {
     109    if ( $query->is_main_query() && ( ( isset( $query->query['page_id'] ) && $query->query['page_id'] == $checkout_page_id ) || ( isset( $query->queried_object) && $query->queried_object->ID == $checkout_page_id ) ) && isset( $_GET['token'] ) ) {
    110110        $santanderLoan = new Santander_Loan();
    111111        $santanderLoan->check_result( $_GET['token'] );
    112112        exit;
    113     } elseif ( $query->is_main_query() && isset( $_GET['page_id'] ) && $_GET['page_id'] == $santander_log_page_id ) {
     113    } elseif ( $query->is_main_query() && ( ( isset( $query->query['page_id'] ) && $query->query['page_id'] == $santander_log_page_id ) || ( isset( $query->queried_object) && $query->queried_object->ID == $santander_log_page_id ) ) ) {
    114114        Santander::run( new Santander_APIConnector( new Santander_Loan() ) );
    115115        print Santander::$logger->getLogFile( ( isset( $_GET['d'] ) ? (int) $_GET['d'] : time() ) );
  • easycontract/trunk/ext/santander/src/Santander/base/Logger.php

    r1279484 r1292654  
    4242       
    4343        $this->filename = $this->savePath . DIRECTORY_SEPARATOR . $filename;
    44         //$this->sendAndDeletePreviousLog();
    4544    }
    4645   
     
    140139        }
    141140    }
    142    
    143     /**
    144      * Send/transfer previous log file to the log handler system and delete it on
    145      * the server.
    146      * @return boolean
    147      */
    148     public function sendAndDeletePreviousLog() {
    149         $yesterday = strtotime('-1 day');
    150         $filename = SANTANDER_LIB_PATH . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR . strtr($this->filenameTemplate, array('{date}' => date('Ymd', $yesterday)));
    151        
    152         if (file_exists($filename)) {
    153             /**
    154              * @todo replace mail with ftp or other type of file tranfer
    155              */
    156             $from = \Santander::$api->config->getSiteEmailAddress();
    157             $to = \Santander::$api->config->getLogEmailAddress();
    158            
    159             $message = \Swift_Message::newInstance()
    160                 ->setSubject(Message::translate('Log file from {system}', array('system' => \Santander::$api->config->getSiteName()), Language::DEFAULT_LANGUAGE))
    161                 ->setFrom($from)
    162                 ->setTo($to)
    163                 ->attach(\Swift_Attachment::fromPath($filename))
    164                 ->setBody(
    165                     Message::translate(
    166                         'Log file from {yesterday} for {system} is attached in this e-mail.',
    167                         array(
    168                             'yesterday' => date('Y-m-d', $yesterday),
    169                             'system' => \Santander::$api->config->getPlatformName()
    170                         ),
    171                         Language::DEFAULT_LANGUAGE
    172                     )
    173                 );
    174            
    175             $transport = \Swift_MailTransport::newInstance();
    176             $mailer = \Swift_Mailer::newInstance($transport);
    177            
    178             if (!$mailer->send($message, $failures)) {
    179                 $this->log(static::LEVEL_ERROR, 'Unable to send log mail', array(
    180                     'from' => $from,
    181                     'to' => $to,
    182                     'rejected' => $failures,
    183                 ));
    184                
    185                 return FALSE;
    186             }
    187            
    188             @unlink($filename);
    189             return TRUE;
    190         }
    191        
    192         return TRUE;
    193     }
    194141}
  • easycontract/trunk/includes/classes/Santander_APIConnector.php

    r1279385 r1292654  
    121121   
    122122    private function _getModuleVersion() {
    123         return '1.0.0wo';
     123        return '1.0.3wo';
    124124    }
    125125   
  • easycontract/trunk/readme.txt

    r1283245 r1292654  
    44Requires at least: 4.0
    55Tested up to: 4.3.1
    6 Stable tag: 1.0.2wo
     6Stable tag: 1.0.3wo
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2121
    2222== Changelog ==
     23= 1.0.3wo =
     24* Bug: Return URL did not work when permalinks had another format then ’Default’.
     25* Removed: Santander\base\sendAndDeletePreviousLog() have never been used and is now removed.
     26
    2327= 1.0.2wo =
    2428* Fix: syntax error in src/Santander/i18n/Message.php.
  • easycontract/trunk/santander.php

    r1283259 r1292654  
    44Plugin URI: https://github.com/SantanderApps/SantanderPaymentProviderWooCommerce
    55Description: Integrates Santander Consumer Bank into WooCommerce.
    6 Version: 1.0.2wo
     6Version: 1.0.3wo
    77Author: Santander
    88Author URI: http://santander.consid.se
     
    107107    $santander_log_page_id = get_option( 'santander_log_page' );
    108108   
    109     if ( $query->is_main_query() && isset( $_GET['page_id'] ) && $_GET['page_id'] == $checkout_page_id && isset( $_GET['token'] ) ) {
     109    if ( $query->is_main_query() && ( ( isset( $query->query['page_id'] ) && $query->query['page_id'] == $checkout_page_id ) || ( isset( $query->queried_object) && $query->queried_object->ID == $checkout_page_id ) ) && isset( $_GET['token'] ) ) {
    110110        $santanderLoan = new Santander_Loan();
    111111        $santanderLoan->check_result( $_GET['token'] );
    112112        exit;
    113     } elseif ( $query->is_main_query() && isset( $_GET['page_id'] ) && $_GET['page_id'] == $santander_log_page_id ) {
     113    } elseif ( $query->is_main_query() && ( ( isset( $query->query['page_id'] ) && $query->query['page_id'] == $santander_log_page_id ) || ( isset( $query->queried_object) && $query->queried_object->ID == $santander_log_page_id ) ) ) {
    114114        Santander::run( new Santander_APIConnector( new Santander_Loan() ) );
    115115        print Santander::$logger->getLogFile( ( isset( $_GET['d'] ) ? (int) $_GET['d'] : time() ) );
Note: See TracChangeset for help on using the changeset viewer.