Ejemplo n.º 1
0
 function eventCheckOpenIdCallBack(EventControler $eventControler)
 {
     if (!file_exists("Zend/OpenId/Consumer.php")) {
         return false;
     }
     $message_status = "";
     if ($_GET['openid_mode'] == 'id_res') {
         $consumer = new Zend_OpenId_Consumer();
         if ($consumer->verify($_GET, $this->openid_identifier)) {
             //$conx = $eventControler->getDbCon();
             $qCheck = new sqlQuery($this->getDbCon());
             $eventControler->setLog("\n OpenId check," . $this->openid_identifier . " table:" . $this->getTable());
             $this->query("select * from `" . $this->getTable() . "` where `openid`='" . $this->openid_identifier . "'");
             $eventControler->setLog("\n Query executed for sign on:" . $this->getSqlQuery());
             $eventControler->setLog("\n RegPage:" . $this->openid_regPage . " goto:" . $this->openid_goto . " errPage:" . $this->openid_errPage);
             if ($qCheck->getNumrows() == 1) {
                 $userdata = array();
                 $userdata['id'] = $this->getPrimaryKeyValue();
                 //$userdata['id'] = $this->iduser;
                 $userdata['firstname'] = $this->firstname;
                 $userdata['lastname'] = $this->lastname;
                 $userdata['email'] = $this->{$this->getEmailField()};
                 $userdata['username'] = $this->{$this->getUsernameField()};
                 if ($this->isadmin) {
                     $userdata['isadmin'] = 1;
                 }
                 $userdata['user_table'] = $user_table;
                 $_SESSION['userdata'] = $userdata;
                 if (!$this->isPersistent()) {
                     $this->sessionPersistent("do_" . $this->getObjectName(), "signout.php", 36000);
                 }
                 $eventControler->goto = $this->openid_goto;
                 $eventControler->setUrlNext($this->openid_goto);
                 return true;
             } else {
                 $eventControler->setLog("\n this user need to register:" . $this->openid_regPage);
                 $eventControler->goto = $this->openid_regPage;
                 $eventControler->setUrlNext($this->openid_regPage);
                 $eventControler->setLog("\n Redirected set to:" . $eventControler->getUrlNext());
                 return true;
             }
         } else {
             $message_status = 'The OpenID is invalid.';
         }
     } elseif ($_GET['openid_mode'] == 'cancel') {
         $message_status = 'The OpenID login was cancelled.';
     } else {
         $message_status = 'The OpenID is invalid.';
     }
     if (!empty($message_status)) {
         $err_disp = new Display($this->openid_errPage);
         $err_disp->addParam("openidmessage", $message_status);
         $eventControler->setDisplayNext($err_disp);
         return false;
     }
 }
Ejemplo n.º 2
0
         // Format Should be yyyy-mm-dd
         $do_ofuz->invoice_term = 'Upon Receipt';
         $do_ofuz->invoice_note = 'Thanks for the business';
         $do_ofuz->description = 'User Membership Recurrent Billing';
         $do_ofuz->discount = '';
         // Should be as 10,10.55,0.50,.5
         $do_ofuz->amt_due = '24.00';
         $do_ofuz->sub_total = '24.00';
         $do_ofuz->net_total = '24.00';
         $idinvoice = $do_ofuz->cron_billing_add_invoice($iduser);
     }
 }
 $read_qry2 = new sqlQuery($conx);
 $sql_get_ccdetails = "SELECT token  from cc_details where iduser = '******'";
 $read_qry2->query($sql_get_ccdetails);
 if ($read_qry2->getNumrows() > 0) {
     $read_qry2->fetch();
     $user_tokenid = $read_qry2->getData('token');
 } else {
     $user_tokenid = '';
 }
 if (!empty($user_tokenid)) {
     $name = $read_qry->getData('name');
     $email = $read_qry->getData('email');
     $description = $name;
     $srtipecustomer_id = $user_tokenid;
     //Amount need to conver to cents
     $total_amount = $membership_amount * 100;
     $payment = new StripeGateWay(false, $stripe_api_key);
     if (!empty($srtipecustomer_id)) {
         $result = $payment->ChargeExsistingCustomer($srtipecustomer_id, $total_amount);