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


PHP Payment::getPaymentSystemSettings方法代码示例

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


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

示例1: processCheckout

 /**
  * @param Payment $payment
  * @param CHttpRequest $request
  * @return bool
  */
 public function processCheckout(Payment $payment, CHttpRequest $request)
 {
     $amount = $request->getParam('OutSum');
     $orderId = (int) $request->getParam('InvId');
     $crc = strtoupper($request->getParam('SignatureValue'));
     $order = Order::model()->findByPk($orderId);
     if (null === $order) {
         Yii::log(Yii::t('RobokassaModule.robokassa', 'Order with id = {id} not found!', ['{id}' => $orderId]), CLogger::LEVEL_ERROR, self::LOG_CATEGORY);
         return false;
     }
     if ($order->isPaid()) {
         Yii::log(Yii::t('RobokassaModule.robokassa', 'Order with id = {id} already payed!', ['{id}' => $orderId]), CLogger::LEVEL_ERROR, self::LOG_CATEGORY);
         return false;
     }
     $settings = $payment->getPaymentSystemSettings();
     $myCrc = strtoupper(md5("{$amount}:{$orderId}:" . $settings['password2']));
     if ($myCrc !== $crc) {
         Yii::log(Yii::t('RobokassaModule.robokassa', 'Error pay order with id = {id}! Bad crc!', ['{id}' => $orderId]), CLogger::LEVEL_ERROR, self::LOG_CATEGORY);
         return false;
     }
     if ($amount != Yii::app()->money->convert($order->total_price, $payment->currency_id)) {
         Yii::log(Yii::t('RobokassaModule.robokassa', 'Error pay order with id = {id}! Incorrect price!', ['{id}' => $orderId]), CLogger::LEVEL_ERROR, self::LOG_CATEGORY);
         return false;
     }
     if ($order->pay($payment)) {
         Yii::log(Yii::t('RobokassaModule.robokassa', 'Success pay order with id = {id}!', ['{id}' => $orderId]), CLogger::LEVEL_INFO, self::LOG_CATEGORY);
         return true;
     } else {
         Yii::log(Yii::t('RobokassaModule.robokassa', 'Error pay order with id = {id}! Error change status!', ['{id}' => $orderId]), CLogger::LEVEL_ERROR, self::LOG_CATEGORY);
         return false;
     }
 }
开发者ID:alextravin,项目名称:yupe,代码行数:37,代码来源:RobokassaPaymentSystem.php

示例2: processCheckout

 /**
  * @param Payment $payment
  * @param CHttpRequest $request
  */
 public function processCheckout(Payment $payment, CHttpRequest $request)
 {
     $settings = $payment->getPaymentSystemSettings();
     $params = ['action' => $request->getParam('action'), 'orderSumAmount' => $request->getParam('orderSumAmount'), 'orderSumCurrencyPaycash' => $request->getParam('orderSumCurrencyPaycash'), 'orderSumBankPaycash' => $request->getParam('orderSumBankPaycash'), 'shopId' => $settings['shopid'], 'invoiceId' => $request->getParam('invoiceId'), 'customerNumber' => $request->getParam('customerNumber'), 'password' => $settings['password']];
     /* @var $order Order */
     $order = Order::model()->findByPk($request->getParam('orderNumber'));
     if ($order === null) {
         $message = Yii::t('YandexMoneyModule.ymoney', 'The order doesn\'t exist.');
         Yii::log($message, CLogger::LEVEL_ERROR);
         $this->showResponse($params, $message, 200);
     }
     if ($order->isPaid()) {
         $message = Yii::t('YandexMoneyModule.ymoney', 'The order #{n} is already payed.', $order->getPrimaryKey());
         Yii::log($message, CLogger::LEVEL_ERROR);
         $this->showResponse($params, $message, 200);
     }
     if ($this->getOrderCheckSum($params) !== $request->getParam('md5')) {
         $message = Yii::t('YandexMoneyModule.ymoney', 'Wrong checksum');
         Yii::log($message, CLogger::LEVEL_ERROR);
         $this->showResponse($params, $message, 200);
     }
     if ((double) $order->getTotalPriceWithDelivery() !== (double) $params['orderSumAmount']) {
         $message = Yii::t('YandexMoneyModule.ymoney', 'Wrong payment amount');
         Yii::log($message, CLogger::LEVEL_ERROR);
         $this->showResponse($params, $message, 200);
     }
     if ($params['action'] === 'checkOrder') {
         $this->showResponse($params);
     }
     if ($params['action'] === 'paymentAviso' && $order->pay($payment)) {
         Yii::log(Yii::t('YandexMoneyModule.ymoney', 'The order #{n} has been payed successfully.', $order->getPrimaryKey()), CLogger::LEVEL_INFO);
         $this->showResponse($params);
     }
 }
开发者ID:alextravin,项目名称:yupe,代码行数:38,代码来源:YandexMoneyPaymentSystem.php

示例3: __construct

 public function __construct(Payment $payment)
 {
     $settings = $payment->getPaymentSystemSettings();
     $this->key = $settings['key'];
     $this->mode = $settings['paymode'];
 }
开发者ID:real-gear-plex,项目名称:yupe-payler,代码行数:6,代码来源:Payler.php


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