Example #1
0
 public function before()
 {
     $id = $this->request->param('id');
     $this->_package = ORM::factory('Payment_Package', $id);
     if (!$this->_package->loaded()) {
         throw HTTP_Exception::factory('404', 'file not found');
     }
     if ($this->_package->type !== Model_Payment_Package::TYPE_ONCE) {
         throw HTTP_Exception::factory('404', 'file not found');
     }
     $this->_config = Kohana::$config->load('payment.gateways.paypal');
     // Create a PayPalExpressGateway.
     $this->_gateway = new Payment_PayPal_ExpressGateway();
     $this->_gateway->setUsername($this->_config['username']);
     $this->_gateway->setPassword($this->_config['password']);
     $this->_gateway->setSignature($this->_config['signature']);
     parent::before();
 }
Example #2
0
 function before()
 {
     parent::before();
     $this->qiwiConfig = array('shopID' => '', 'password' => '', 'lifetime' => 24, 'txn-prefix' => '', 'encrypt' => TRUE, 'url' => 'https://ishop.qiwi.ru/xml', 'create-agt' => 0, 'alarm-sms' => '0', 'alarm-call' => '0', 'log' => FALSE);
     $result = DB::select('system_name', 'value')->from('payment_settings')->where('status', '=', 'Y')->where('system_name', 'IN', array('qiwi_id', 'qiwi_password', 'qiwi_expires'))->execute()->as_array();
     foreach ($result as $r) {
         switch ($r['system_name']) {
             case "qiwi_id":
                 $this->qiwiConfig['shopID'] = $r['value'];
                 break;
             case "qiwi_password":
                 $this->qiwiConfig['password'] = $r['value'];
                 break;
             case "qiwi_expires":
                 $this->qiwiConfig['lifetime'] = intval($r['value']);
                 break;
         }
     }
     require_once "qiwi/qiwi.class.php";
 }
Example #3
0
 function before()
 {
     parent::before();
     $this->webmoney_key = DB::select('value')->from('payment_settings')->where('status', '=', 'Y')->where('system_name', '=', 'webmoney_key')->limit(1)->execute()->get('value');
 }