Exemplo n.º 1
0
 public function getUrl(PwPayVo $vo)
 {
     $strTransactionId = $vo->getOrderNo();
     $strBillDate = substr($strTransactionId, 10, 8);
     $strSpBillNo = substr($strTransactionId, -10);
     $param = array('cmdno' => '1', 'date' => $strBillDate, 'bargainor_id' => $this->tenpay, 'transaction_id' => $strTransactionId, 'sp_billno' => $strSpBillNo, 'total_fee' => $vo->getFee() * 100, 'bank_type' => 0, 'fee_type' => 1, 'return_url' => $this->baseurl, 'attach' => 'my_magic_string', 'desc' => Pw::convert($vo->getTitle(), 'gbk'));
     return $this->_bulidUrl($this->tenpay_url, $this->tenpay_key, $param);
 }
Exemplo n.º 2
0
 public function getUrl(PwPayVo $vo)
 {
     $url = $this->paypal_url;
     $param = array('cmd' => '_xclick', 'invoice' => $vo->getOrderNo(), 'business' => $this->paypal, 'item_name' => $vo->getTitle(), 'item_number' => 'phpw*', 'amount' => $vo->getFee(), 'no_shipping' => 0, 'no_note' => 1, 'currency_code' => 'CNY', 'bn' => 'phpwind', 'charset' => $this->charset);
     foreach ($param as $key => $value) {
         $url .= $key . "=" . urlencode($value) . "&";
     }
     return $url;
 }
Exemplo n.º 3
0
 public function getUrl(PwPayVo $vo)
 {
     strlen($this->bill) == 11 && ($this->bill .= '01');
     $param = array('inputCharset' => $this->charset == 'gbk' ? 2 : 1, 'pageUrl' => $this->baseurl, 'version' => 'v2.0', 'language' => 1, 'signType' => 1, 'merchantAcctId' => $this->bill, 'payerName' => 'admin', 'orderId' => $vo->getOrderNo(), 'orderAmount' => $vo->getFee() * 100, 'orderTime' => Pw::time2str(Pw::getTime(), 'YmdHis'), 'productName' => $vo->getBody(), 'productNum' => 1, 'payType' => '00', 'redoFlag' => 1);
     $url = $this->bill_url;
     $arg = '';
     foreach ($param as $key => $value) {
         $value = trim($value);
         if (strlen($value) > 0) {
             $arg .= "{$key}={$value}&";
             $url .= "{$key}=" . urlencode($value) . "&";
             //$inputMsg .= "<input type=\"hidden\" name=\"$key\" value=\"$value\" />";
         }
     }
     $url .= 'signMsg=' . strtoupper(md5($arg . 'key=' . $this->bill_key));
     return $url;
 }
Exemplo n.º 4
0
 public function getUrl(PwPayVo $vo)
 {
     $param = array('payment_type' => '1', '_input_charset' => $this->charset, 'seller_email' => $this->alipay, 'notify_url' => $this->baseurl, 'return_url' => $this->baseurl, 'out_trade_no' => $vo->getOrderNo(), 'subject' => $vo->getTitle(), 'body' => $vo->getBody(), 'extend_param' => 'isv^pw11');
     if (!$this->alipay_interface) {
         $param["service"] = 'trade_create_by_buyer';
         $param["price"] = $vo->getFee();
         $param["quantity"] = '1';
         $param["logistics_fee"] = '0.00';
         $param["logistics_type"] = 'EXPRESS';
         $param["logistics_payment"] = 'SELLER_PAY';
     } else {
         $param['service'] = 'create_direct_pay_by_user';
         $param['total_fee'] = $vo->getFee();
     }
     return $this->_bulidUrl($this->alipay_url, $this->alipay_partnerID, $this->alipay_key, $param);
 }
Exemplo n.º 5
0
 /**
  * 现金充值
  */
 public function payAction()
 {
     $config = Wekit::C('pay');
     if (!$config['ifopen']) {
         $this->showError($config['reason']);
     }
     list($credit, $pay, $paymethod) = $this->getInput(array('credit', 'pay', 'paymethod'));
     if (!in_array($paymethod, array('1', '2', '3', '4'))) {
         $this->showError('onlinepay.paymethod.select');
     }
     $onlinepay = Wekit::load('pay.srv.PwPayService')->getPayMethod($paymethod);
     if (($result = $onlinepay->check()) instanceof PwError) {
         $this->showError($result->getError());
     }
     $recharge = Wekit::C('credit', 'recharge');
     $creditBo = PwCreditBo::getInstance();
     if (!isset($recharge[$credit]) || !isset($creditBo->cType[$credit])) {
         $this->showError('CREDIT:pay.type.error');
     }
     $pay = round($pay, 2);
     $min = max(0, $recharge[$credit]['min']);
     if ($pay < $min) {
         $this->showError(array('CREDIT:pay.num.min', array('{min}' => $min)));
     }
     $creditName = $creditBo->cType[$credit];
     $order_no = $onlinepay->createOrderNo();
     Wind::import('SRV:pay.dm.PwOrderDm');
     $dm = new PwOrderDm();
     $dm->setOrderNo($order_no)->setPrice($pay)->setNumber(1)->setState(0)->setPaytype(1)->setBuy($credit)->setCreatedUserid($this->loginUser->uid)->setCreatedTime(Pw::getTime());
     Wekit::load('pay.PwOrder')->addOrder($dm);
     Wind::import('SRV:pay.vo.PwPayVo');
     $vo = new PwPayVo();
     $vo->setOrderNo($order_no)->setFee($pay)->setTitle('积分充值(订单号:' . $order_no . ')')->setBody('购买论坛' . $creditName . '(论坛UID:' . $this->loginUser->uid . ')');
     $this->setOutput(array('url' => $onlinepay->getUrl($vo)), 'data');
     //todo WindUrlHelper 改进
     $this->showMessage('success');
     //$this->showMessage('success', $onlinepay->getUrl($vo));
     //$this->forwardRedirect($onlinepay->getUrl($vo));
 }