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


PHP Payment::config方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     Payment::config()->allowed_gateways = array('PayPal_Express', 'PaymentExpress_PxPay', 'Manual', 'Dummy');
     Payment::config()->parameters = array('PaymentExpress_PxPay' => array('username' => 'EXAMPLEUSER', 'password' => '235llgwxle4tol23l'));
     //set up a payment here to make tests shorter
     $this->payment = Payment::create()->setGateway("Dummy")->setAmount(1222)->setCurrency("GBP");
     PaymentService::set_http_client($this->getHttpClient());
     PaymentService::set_http_request($this->getHttpRequest());
 }
开发者ID:helpfulrobot,项目名称:silverstripe-silverstripe-omnipay,代码行数:10,代码来源:PaymentTest.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     ShopTest::setConfiguration();
     //set supported gateways
     Payment::config()->allowed_gateways = array('Dummy', 'Manual', 'PaymentExpress_PxPay', 'PaymentExpress_PxPost');
     PaymentService::set_http_client($this->getHttpClient());
     PaymentService::set_http_request($this->getHttpRequest());
     //publish products
     $this->objFromFixture("Product", "socks")->publish('Stage', 'Live');
     $this->objFromFixture("CheckoutPage", "checkout")->publish('Stage', 'Live');
     $this->objFromFixture("CartPage", "cart")->publish('Stage', 'Live');
 }
开发者ID:helpfulrobot,项目名称:silvershop-core,代码行数:13,代码来源:ShopPaymentTest.php

示例3: __construct

 public function __construct($controller, $name, DataObjectInterface $payable, $amount)
 {
     if (!is_numeric($amount)) {
         throw new InvalidArgumentException("Amount must be numeric");
     }
     $record = new Page(array('ID' => -1, 'Title' => $controller->Title, 'ParentID' => $controller->ID, 'URLSegment' => $name));
     parent::__construct($record);
     $this->payable = $payable;
     $this->amount = $amount;
     //get currency from defaults
     $defaults = Payment::config()->defaults;
     if (isset($defaults['MoneyCurrency'])) {
         $this->currency = $defaults['MoneyCurrency'];
     }
     $this->successurl = $controller->Link();
 }
开发者ID:8secs,项目名称:cocina,代码行数:16,代码来源:PaymentController.php

示例4: logToFile

 /**
  * Helper function for logging gateway requests
  */
 protected function logToFile($data, $type = "")
 {
     if ($logstyle = Payment::config()->file_logging) {
         $title = $type . " (" . $this->payment->Gateway . ")";
         if ($logstyle === "verbose") {
             Debug::log($title . "\n\n" . print_r($data, true));
         } elseif ($logstyle) {
             Debug::log(implode(", ", array($title, isset($data['Message']) ? $data['Message'] : " ", isset($data['Code']) ? $data['Code'] : " ")));
         }
     }
 }
开发者ID:ss23,项目名称:silverstripe-omnipay,代码行数:14,代码来源:PaymentService.php

示例5: getParameters

 /**
  * Get the gateway config-parameters.
  *
  * @param string $gateway the gateway name
  * @return array|null gateway parameters
  */
 public static function getParameters($gateway)
 {
     $params = \Payment::config()->parameters;
     if (isset($params[$gateway])) {
         \Deprecation::notice('3.0', 'Please refrain from setting Gateway parameters under Payment. ' . 'Use GatewayInfo instead (see docs).');
         return $params[$gateway];
     }
     $params = self::getConfigSetting($gateway, 'parameters');
     return is_array($params) ? $params : null;
 }
开发者ID:bummzack,项目名称:silverstripe-omnipay,代码行数:16,代码来源:GatewayInfo.php

示例6: setConfig

 public function setConfig($config)
 {
     $this->payment = new Payment();
     $this->payment->config($config);
 }
开发者ID:ayaya118,项目名称:cicc,代码行数:5,代码来源:Cicc.php

示例7: setUpOnce

 public function setUpOnce()
 {
     //add reverse has_one relation to Payment for Payable
     Payment::config()->has_one = array("Payable" => "PaymentControllerTest_Payable");
     parent::setUpOnce();
 }
开发者ID:8secs,项目名称:cocina,代码行数:6,代码来源:PaymentControllerTest.php

示例8: _respond

 /**
  * 支付响应
  *
  * @param  string  $adapter
  * @return Payment_Respond_Abstract
  * @throws Exception
  */
 protected function _respond($adapter)
 {
     if (empty($adapter)) {
         throw new Exception('发生错误');
     }
     Payment::log($adapter);
     $config = Payment::config($adapter);
     // 读取配置
     $respond = Payment::respond($adapter);
     // 创建支付响应实例
     $respond->set_key($config->pay_key)->parse($_REQUEST);
     if ($respond->is_paid() or $respond->is_success()) {
         $order_sn = $order_merged_id = $respond->get_id();
         // 获取订单编号
         // 判断存在
         $row = DB::select('*')->from('imgup_upgrade')->where('orderno', '=', $order_sn)->fetch_row();
         $uid = (int) $row['uid'];
         if (empty($row)) {
             throw new Exception('订单号不存在!');
         } else {
             if ($row['status'] == 1) {
                 return;
             }
             if ($row['month'] == 12) {
                 $fee_day = DB::select(DB::expr("(fee_year / 365) AS count"))->from('imgup_group')->where('id', '=', $row['dest_group'])->execute()->get('count');
             } else {
                 $fee_day = DB::select(DB::expr("(fee_month / 30) AS count"))->from('imgup_group')->where('id', '=', $row['dest_group'])->execute()->get('count');
             }
             # 修改订单状态
             $order_data = array('status' => 1, 'submit_time' => date('Y-m-d H:i:s'), 'operator' => $respond->get_pay_user(), 'trade_no' => $respond->get_payment_no(), 'notify_id' => $respond->get_id());
             DB::update('imgup_upgrade')->set($order_data)->where('id', '=', $row['id'])->execute();
             $user_time = ORM::factory('user', $uid)->expire_time;
             $order_data = array('status' => 'approved', 'expire_time' => strtotime($row['will_exceed']), 'fee_day' => round($fee_day, 2), 'rank' => $row['dest_group']);
             // 赠送空间数
             switch ($row['dest_group']) {
                 default:
                     $gift = 0;
                     break;
             }
             $order_data['gift'] = $gift;
             DB::update('users')->set($order_data)->where('uid', '=', $row['uid'])->execute();
             # 处理屏蔽表数据
             DB::update('imgup_deny_user')->set(array('status' => 0))->where('uid', '=', $row['uid'])->execute();
             # 发送通知邮件
             $ret = DB::select('username', 'email', 'expire_time')->from('users')->where('uid', '=', $row['uid'])->fetch_row();
             $receiver = $ret['username'];
             $receiver_email = $ret['email'];
             $exceed_date = date("Y-m-d", strtotime($ret['expire_time']));
             $ret = DB::select('group_name')->from('imgup_group')->where('id', '=', $row['current_group'])->fetch_row();
             $v_email = $ret['group_name'] . ',';
             $ret = DB::select('group_name')->from('imgup_group')->where('id', '=', $row['dest_group'])->fetch_row();
             $v_email = $v_email . $ret['group_name'] . ',' . $row['will_exceed'];
             $email_template = 'F1';
             $this->send_email($email_template, $receiver, $receiver_email, $v_email);
             # 开放屏蔽帐号
             $disks = ORM::factory('img_disk')->find_all();
             foreach ($disks as $disk) {
                 $dir = '/server/wal8/www/' . $disk->disk_name . '/' . ORM::factory('user', $row['uid'])->save_dir;
                 if (@substr(sprintf('%o', fileperms($dir)), -4) == '0000') {
                     @chmod($dir, 0777);
                 }
             }
         }
         return $respond;
     } else {
         throw new Exception('支付失败,请联系联系客服..');
     }
 }
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:75,代码来源:payment.php


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