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


PHP SoapClient::PaymentRequest方法代码示例

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


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

示例1: request

 /**
  * request driver.
  *
  * @param $inputs
  *
  * @return array
  */
 public function request($inputs)
 {
     $client = new \SoapClient($this->wsdlAddress, ['encoding' => 'UTF-8']);
     $result = $client->PaymentRequest($inputs);
     if ($result->Status == 100) {
         return ['Authority' => $result->Authority];
     } else {
         return ['error' => $result->Status];
     }
 }
开发者ID:RTLer,项目名称:zarinpal-composer-library,代码行数:17,代码来源:SoapDriver.php

示例2: request

 /**
  * request driver
  *
  * @param $inputs
  * @return array
  */
 public function request($inputs, $debug)
 {
     $this->debug = $debug;
     $client = new \SoapClient($this->setWsdlAddress(), array('encoding' => 'UTF-8'));
     $result = $client->PaymentRequest($inputs);
     if ($result->Status == 100) {
         return ['Authority' => $result->Authority];
     } else {
         return ['error' => $result->Status];
     }
 }
开发者ID:zartosht,项目名称:zarinpal,代码行数:17,代码来源:SoapDriver.php

示例3: zarinpal

 public function zarinpal()
 {
     $this->session->unset_userdata('Amount');
     $donate_zarinpal = $this->config->item('donate_zarinpal');
     $Amount = $this->input->post("amount");
     $Description = $this->input->post("item_name");
     $this->session->set_userdata('Amount', $Amount);
     $client = new SoapClient('https://de.zarinpal.com/pg/services/WebGate/wsdl', array('encoding' => 'UTF-8'));
     $result = $client->PaymentRequest(array('MerchantID' => $donate_zarinpal["MerchantID"], 'Amount' => $Amount, 'Description' => $Description, 'Email' => $donate_zarinpal["email"], 'Mobile' => $donate_zarinpal["Mobile"], 'CallbackURL' => $donate_zarinpal["postback_url"]));
     if ($result->Status == 100) {
         @Header('Location: https://www.zarinpal.com/pg/StartPay/' . $result->Authority);
         exit;
     } else {
         echo 'ERR: ' . $result->Status;
         exit;
     }
 }
开发者ID:ZarinPal-Lab,项目名称:FusionCMS,代码行数:17,代码来源:donate.php

示例4: display

 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $state = $this->get('State');
     $item = $this->get('Item');
     // Get the parameters
     $params = JComponentHelper::getParams('com_sibdiet');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseWarning(500, implode("\n", $errors));
         return false;
     }
     $this->state =& $state;
     $this->user =& $user;
     $this->item = $item;
     $this->item->Amount = $params->get('diet_price');
     $Authority = $app->input->get('Authority', NULL, 'STRING');
     if (empty($Authority)) {
         $MerchantID = $params->get('zarinpal_merchant_id');
         $Amount = $params->get('diet_price') / 10;
         $Description = JText::sprintf('COM_SIBDIET_ONLINE_PAYMENT_DESCRIPTION', $item->fname . ' ' . $item->lname);
         $Email = $item->email;
         $Mobile = $item->mobile;
         $CallbackURL = JUri::getInstance();
         $vars = array('MerchantID' => $MerchantID, 'Amount' => $Amount, 'Description' => $Description, 'Email' => $Email, 'Mobile' => $Mobile, 'CallbackURL' => $CallbackURL);
         $client = new SoapClient('https://ir.zarinpal.com/pg/services/WebGate/wsdl', array('encoding' => 'UTF-8'));
         $result = $client->PaymentRequest($vars);
         //Redirect to URL You can do it also by creating a form
         if ($result->Status == 100) {
             $object = new stdClass();
             $object->id = $this->item->id;
             $object->authority = $result->Authority;
             $updateResult = JFactory::getDbo()->updateObject('#__sibdiet_setdiets', $object, 'id');
             $this->action = 'https://www.zarinpal.com/pg/StartPay/' . $result->Authority;
             return parent::display($tpl);
         } else {
             //JError::raiseWarning(500, JText::_('COM_SIBDIET_ZARINPAL_ONLINE_PAYMENT_STATUS_' . $result->Status));
             return false;
         }
     }
     return parent::display($tpl);
 }
开发者ID:smhnaji,项目名称:sdnet,代码行数:50,代码来源:view.html.php

示例5: send_to_bank

function send_to_bank($Amount, $CallbackURL, $Email, $Mobile, $config, $subject, $lang)
{
    $show['massage'] = '';
    $client = new SoapClient('https://de.zarinpal.com/pg/services/WebGate/wsdl', array('encoding' => 'UTF-8'));
    $result = $client->PaymentRequest(array('MerchantID' => $config['merchent_code'], 'Amount' => $Amount / 10, 'Description' => $subject, 'Email' => $Email, 'Mobile' => $Mobile, 'CallbackURL' => $CallbackURL));
    $result1 = $result->Status;
    $resultgo = $result->Authority;
    if ($result1 == 100) {
        $show['Status'] = 1;
        $show['massage'] .= $lang['Successful']['send'];
        $show['Post_url'] = 'https://www.zarinpal.com/pg/StartPay/' . $result->Authority . '/ZarinGate';
        $show['trans_id1'] = '';
        $show['trans_id2'] = $result->Authority;
    } else {
        $show['Status'] = 0;
        $show['massage'] .= $lang['error'][$result1];
    }
    return $show;
}
开发者ID:ZarinPal-Lab,项目名称:RaPayment,代码行数:19,代码来源:function.php

示例6: doGenerateForm

 public function doGenerateForm(array $options = array())
 {
     $this->setOptions($options);
     $this->_checkRequiredOptions(array('merchantCode', 'amount', 'reservationNumber', 'redirectAddress', 'description'));
     try {
         $soapClient = new SoapClient($this->getWSDL(), array('encoding' => 'UTF-8'));
         $merchantID = $this->_config['merchantCode'];
         $amount = $this->_config['amount'];
         $callBackUrl = $this->_config['redirectAddress'] . '/in/' . $this->_config['reservationNumber'];
         $description = urlencode($this->_config['description']);
         $res = $soapClient->PaymentRequest($merchantID, $amount, $callBackUrl, $description);
     } catch (SoapFault $e) {
         $this->log($e->getMessage());
         throw new Exception('SOAP Exception: ' . $e->getMessage());
     }
     if (strlen($res) == 36) {
         $view = Zend_Layout::getMvcInstance()->getView();
         $form = '<form id="gotobank-form" method="post" action="' . sprintf($this->getEndPoint(), $res) . '" class="form-horizontal">';
         $label = isset($this->_config['submitlabel']) ? $this->_config['submitlabel'] : '';
         $submit = sprintf('<div class="control-group"><div class="controls"><input type="submit" class="btn btn-success" value="%s"></div></div>', $label);
         $form .= $submit;
         $form .= '</form>';
         return $form;
     } else {
         switch ($res) {
             case "-1":
                 $msg = static::INCOMPLETE_DATA;
                 break;
             case "-2":
                 $msg = static::INVALID_WEBSERVICE;
                 break;
             case "-3":
                 $msg = static::LOW_AMOUNT;
                 break;
             case "-4":
                 $msg = static::NOT_SILVER_USER_LEVEL;
                 break;
             default:
                 $msg = static::UNKNOWN_REQUEST_RESPONSE;
                 break;
         }
         $this->log($e->getMessage());
         throw new Exception($msg, $res);
     }
 }
开发者ID:iamtartan,项目名称:epayment,代码行数:45,代码来源:Zarinpal.php

示例7: PaymentRequest

 /**
  * Payment Request
  *
  * @return Authority
  */
 public function PaymentRequest($data)
 {
     // Get the parameters
     $params = JComponentHelper::getParams('com_sibdiet');
     $vars = array('MerchantID' => $params->get('zarinpal_merchant_id'), 'Amount' => $data['payment']['diet_price'] / 10, 'Description' => JText::sprintf('COM_SIBDIET_ONLINE_PAYMENT_DESCRIPTION', $data['profile']['fname'] . ' ' . $data['profile']['lname']), 'Email' => JFactory::getUser()->email, 'Mobile' => $data['profile']['mobile'], 'CallbackURL' => JRoute::_('http://sibdiet.com/index.php?&option=com_sibdiet&view=onlinepayment', false));
     $client = new SoapClient('https://ir.zarinpal.com/pg/services/WebGate/wsdl', array('encoding' => 'UTF-8'));
     $result = $client->PaymentRequest($vars);
     if ($result->Status == 100 && strlen($result->Authority) == 36) {
         return $result->Authority;
     }
     $this->setError(JText::_('COM_SIBDIET_ZARINPAL_ONLINE_PAYMENT_STATUS_' . $result->Status));
     return false;
 }
开发者ID:smhnaji,项目名称:sdnet,代码行数:18,代码来源:form.php


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