当前位置: 首页>>代码示例>>PHP>>正文


PHP Payment::factory方法代码示例

本文整理汇总了PHP中Payment::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::factory方法的具体用法?PHP Payment::factory怎么用?PHP Payment::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Payment的用法示例。


在下文中一共展示了Payment::factory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 function execute()
 {
     $payment = Request::get('payment');
     $method = Payment::factory($payment, 'connection');
     if (!$method) {
         echo 'error';
     }
     $model = new connectionUserBalanceModel();
     $result = $method->callback($model);
     if ($method->callback($model)) {
         $model->where(array('id' => (int) $result))->update(array('param' => $_POST));
         $model->success((int) $result);
         return 'success';
     } else {
         return 'error';
     }
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:17,代码来源:connectionFrontendPaymentCallbackProcess.action.php

示例2: stepPurse

 private function stepPurse($step)
 {
     $order = new Order();
     if (!in_array($step, $order->getStepList())) {
         $this->sendPurseData(array('error' => '[`Title undefined step purse`]'));
     }
     switch ($step) {
         case 'price':
             $price = $order->getPrice(Request::post('payment'));
             $this->sendPurseData(array('prices' => $price));
             break;
         case 'confirmation':
             $data = $order->create(Request::post('payment'), Request::post('price'));
             $method = Payment::factory(Request::post('payment'), 'connection');
             if (!$method) {
                 $this->sendPurseData(array('error' => '[`Title undefined payment method`]'));
             }
             $this->sendPurseData(array('result' => $method->payment($data)));
             break;
     }
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:21,代码来源:connectionProfilePurse.action.php

示例3: getAllPayments

 /**
  * Return an array of all existing objects of this type in the database
  */
 public static function getAllPayments()
 {
     $sql = 'select `classname` from cart_payment where status=1';
     $results = Database::singleton()->query_fetch_all($sql);
     foreach ($results as &$result) {
         $result = Payment::factory($result['classname']);
     }
     return $results;
 }
开发者ID:anas,项目名称:feedstore,代码行数:12,代码来源:Payment.php

示例4: initSessionVariables

 public static function initSessionVariables()
 {
     //This function initializes the values stored in the session IF THEY DON'T ALREADY EXIST
     //For example, the shipping object, payment, etc
     if (!isset($_SESSION['authenticated_user'])) {
         $_SESSION['authenticated_user'] = new User();
     }
     if (!isset($_SESSION['cart_basket'])) {
         $_SESSION['cart_basket'] = array();
     }
     if (!isset($_SESSION['cart_checkout']['shipping'])) {
         $_SESSION['cart_checkout']['shipping'] = Shipping::factory('EAndA');
         //Always set the shipping to EAndA
     }
     if (!isset($_SESSION['cart_checkout']['payment'])) {
         $_SESSION['cart_checkout']['payment'] = Payment::factory('Paypal');
     }
     if (!isset($_SESSION['cart_checkout']['address']['shipping_address'])) {
         $_SESSION['cart_checkout']['address']['shipping_address'] = new Address();
     }
     if (!isset($_SESSION['cart_checkout']['address']['billing_address'])) {
         $_SESSION['cart_checkout']['address']['billing_address'] = new Address();
     }
     if (!isset($_SESSION['cart_checkout']['order'])) {
         $_SESSION['cart_checkout']['order'] = new CartOrder();
     }
     if (!isset($_SESSION['cart_checkout']['orderFailureReason'])) {
         $_SESSION['cart_checkout']['orderFailureReason'] = "";
     }
 }
开发者ID:anas,项目名称:feedstore,代码行数:30,代码来源:Cart.php


注:本文中的Payment::factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。