示例#1
0
 public function locateByTimeInterval($from, $until, $type)
 {
     $type = (int) $type;
     $lastSyncSetting = \PLUSPEOPLE\PesaPi\Base\SettingFactory::factoryByName("LastSync");
     $lastSync = $lastSyncSetting->getValue();
     $config = \PLUSPEOPLE\PesaPi\Configuration::instantiate();
     $initSyncDate = strtotime($config->getConfig('MpesaInitialSyncDate'));
     // never go before initial sync date (not reliable to do so)
     if ($from <= 0 or $from < $initSyncDate) {
         $from = $initSyncDate;
     }
     if ($until <= 0) {
         $until = $lastSync;
     }
     // default is up until last sync, and no later to enhance default performance
     if ($until > $lastSync) {
         $this->forceSyncronisation();
     }
     return TransactionFactory::factoryByTimeInterval($from, $until, $type);
 }
示例#2
0
文件: Loader.php 项目: nyashkn/pesaPi
 private function setPassword($input)
 {
     $pwSetting = \PLUSPEOPLE\PesaPi\Base\SettingFactory::factoryByName("MpesaPassword");
     if ($input != "" and is_object($pwSetting)) {
         $pwSetting->setValueString($input);
         $pwSetting->update();
         return true;
     }
     return false;
 }