當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WxPayUnifiedOrder::SetGoods_tag方法代碼示例

本文整理匯總了PHP中WxPayUnifiedOrder::SetGoods_tag方法的典型用法代碼示例。如果您正苦於以下問題:PHP WxPayUnifiedOrder::SetGoods_tag方法的具體用法?PHP WxPayUnifiedOrder::SetGoods_tag怎麽用?PHP WxPayUnifiedOrder::SetGoods_tag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WxPayUnifiedOrder的用法示例。


在下文中一共展示了WxPayUnifiedOrder::SetGoods_tag方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_payurl

 /**
  * 組裝包含支付信息的url(模式2)
  */
 public function get_payurl()
 {
     require_once BASE_PATH . '/api/payment/wxpay/lib/WxPay.Api.php';
     require_once BASE_PATH . '/api/payment/wxpay/WxPay.NativePay.php';
     require_once BASE_PATH . '/api/payment/wxpay/log.php';
     $logHandler = new CLogFileHandler(BASE_DATA_PATH . '/log/wxpay/' . date('Y-m-d') . '.log');
     $Logwx = Logwx::Init($logHandler, 15);
     //統一下單
     $input = new WxPayUnifiedOrder();
     $input->SetBody($this->_order_info['pay_sn'] . '訂單');
     //         $input->SetBody(C('site_name').'訂單');
     $input->SetAttach($this->_order_info['order_type'] == 'vr_order' ? 'v' : 'r');
     $input->SetOut_trade_no($this->_order_info['pay_sn']);
     $input->SetTotal_fee($this->_order_info['api_pay_amount'] * 100);
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 3600));
     $input->SetGoods_tag('');
     $input->SetNotify_url(SHOP_SITE_URL . '/api/payment/wxpay/notify_url.php');
     $input->SetTrade_type("NATIVE");
     //$input->SetOpenid($openId);
     $input->SetProduct_id($this->_order_info['pay_sn']);
     $result = WxPayApi::unifiedOrder($input);
     //         header("Content-type:text/html;charset=utf-8");
     //         print_R($result);exit;
     Logwx::DEBUG("unifiedorder-:" . json_encode($result));
     return $result["code_url"];
 }
開發者ID:dotku,項目名稱:shopnc_cnnewyork,代碼行數:30,代碼來源:wxpay.php

示例2: jsapipay

/**
 * 生成支付接口內容
 * @param $data
 * @param bool $debug
 * @return json
 */
function jsapipay($data, $debug = false)
{
    // C('weixin.weixin_')
    //①、獲取用戶openid
    $tools = new JsApiPay();
    //    $openId = $tools->GetOpenid();
    if (!empty($data['openid'])) {
        $openId = $data['openid'];
    } else {
        echo "empty openid";
        die;
    }
    //②、統一下單
    $input = new WxPayUnifiedOrder();
    $input->SetBody($data['body']);
    $input->SetAttach($data['attach']);
    $input->SetOut_trade_no($data['order_sn']);
    $input->SetTotal_fee($data['total_fee']);
    $input->SetTime_start(date("YmdHis"));
    $input->SetTime_expire(date("YmdHis", time() + 600));
    $input->SetGoods_tag($data['goods_tag']);
    $input->SetNotify_url("http://{$_SERVER[HTTP_HOST]}/weixin/notify.html");
    $input->SetTrade_type("JSAPI");
    $input->SetOpenid($openId);
    $order = WxPayApi::unifiedOrder($input);
    if ($debug) {
        echo '<font color="#f00"><b>統一下單支付單信息</b></font><br/>';
        printf_info($order);
    }
    $jsApiParameters = $tools->GetJsApiParameters($order);
    return $jsApiParameters;
}
開發者ID:ysc8620,項目名稱:zhima,代碼行數:38,代碼來源:weizhao.php

示例3: qrcode

 /**
  * 生成微信支付二維碼
  */
 public static function qrcode($product_id, $body, $total_fee, $attach = '', $detail = '', $goods_tag = '')
 {
     // 處理金額
     if (ENV_SCENE == 'dev') {
         $total_fee = 0.01;
     }
     $total_fee *= 100;
     $notify = new NativePay();
     /**
      * 流程:
      * 1、調用統一下單,取得code_url,生成二維碼
      * 2、用戶掃描二維碼,進行支付
      * 3、支付完成之後,微信服務器會通知支付成功
      * 4、在支付成功通知中需要查單確認是否真正支付成功(見:notify.php)
      */
     $input = new WxPayUnifiedOrder();
     $input->SetBody($body);
     $input->SetAttach($product_id);
     if (!empty($detail)) {
         $input->SetDetail($detail);
     }
     $input->SetOut_trade_no(WxPayConfig::$APPID . substr($product_id, 1));
     $input->SetTotal_fee($total_fee);
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     if (!empty($goods_tag)) {
         $input->SetGoods_tag($goods_tag);
     }
     $input->SetNotify_url(WxPayConfig::$NOTIFY_URL);
     $input->SetTrade_type("NATIVE");
     $input->SetProduct_id($product_id);
     $result = $notify->GetPayUrl($input);
     return $result["code_url"];
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:37,代碼來源:Weixin.php

示例4: JsApiPay

 /**
  * jsapi支付
  * @param string  $user_id    用戶id
  * @param int     $order_id
  * @param string  $order_sn   訂單號
  * @param int     $total_fee  費用
  * @param string  $body       商品或支付單簡要描述
  * @param string  $goods_tag  商品標記
  * @param string  $attach     自定義數據
  * @return array
  */
 public function JsApiPay($user_id, $order_id, $order_sn, $total_fee, $body = '', $goods_tag = '', $attach = '')
 {
     if (empty($user_id) || empty($total_fee)) {
         return ['status' => -1, 'message' => '數據錯誤'];
     }
     $tools = new JsApiPay();
     $openId = UserModel::instance()->getOpenId($user_id);
     if (empty($openId)) {
         $openId = $tools->GetOpenid();
         //             return ['status'=> -2 , 'message'=>'user_id錯誤'];
     }
     $input = new \WxPayUnifiedOrder();
     $input->SetBody($body);
     $input->SetAttach($attach);
     $input->SetOut_trade_no($order_sn);
     //\WxPayConfig::MCHID.date("YmdHis")
     $input->SetTotal_fee($total_fee);
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag($goods_tag);
     $input->SetTrade_type("JSAPI");
     $input->SetOpenid($openId);
     $order = \WxPayApi::unifiedOrder($input);
     if ($order['return_code'] != 'SUCCESS') {
         return ['status' => -10, 'message' => $order['return_msg']];
     }
     $jsApiParameters = $tools->GetJsApiParameters($order);
     $this->addPayLog($openId, $order_id, $input);
     return ['status' => 1, 'message' => $jsApiParameters];
 }
開發者ID:xswolf,項目名稱:dc,代碼行數:41,代碼來源:PayEvent.class.php

示例5: unifiedorder

 public function unifiedorder($openId, $product_id)
 {
     //得到支付金額
     $order_pay_info = Model('order')->getOrderPayInfo(array('pay_sn' => $product_id));
     if (empty($order_pay_info)) {
         $condition = array();
         $condition['order_sn'] = $product_id;
         $condition['order_state'] = ORDER_STATE_NEW;
         $order_info = Model('vr_order')->getOrderInfo($condition, 'sum(order_amount-rcb_amount-pd_amount) as order_amount');
         $attach = 'v';
     } else {
         $condition = array();
         $condition['pay_sn'] = $product_id;
         $condition['order_state'] = ORDER_STATE_NEW;
         $order_info = Model('order')->getOrderInfo($condition, array(), 'sum(order_amount-rcb_amount-pd_amount) as order_amount');
         $attach = 'r';
     }
     //統一下單
     $input = new WxPayUnifiedOrder();
     $input->SetBody($product_id . '訂單');
     // 		$input->SetBody(C('site_name').'訂單');
     $input->SetAttach($attach);
     $input->SetOut_trade_no($product_id);
     $input->SetTotal_fee($order_info['order_amount'] * 100);
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 3600));
     $input->SetGoods_tag('');
     $input->SetNotify_url(SHOP_SITE_URL . '/api/payment/wxpay/notify_url.php');
     $input->SetTrade_type("NATIVE");
     // 		$input->SetOpenid($openId);
     $input->SetProduct_id($product_id);
     $result = WxPayApi::unifiedOrder($input);
     Log::DEBUG("unifiedorder:" . json_encode($result));
     return $result;
 }
開發者ID:dotku,項目名稱:shopnc_cnnewyork,代碼行數:35,代碼來源:native_notify.php

示例6: index

 public function index()
 {
     require_once DIR_SYSTEM . 'library/wxpay/wxpayexception.php';
     define('WXPAY_APPID', trim($this->config->get('wxpay_appid')));
     define('WXPAY_MCHID', trim($this->config->get('wxpay_mchid')));
     define('WXPAY_KEY', trim($this->config->get('wxpay_key')));
     define('WXPAY_APPSECRET', trim($this->config->get('wxpay_appsecret')));
     define('WXPAY_SSLCERT_PATH', DIR_SYSTEM . 'helper/wxpay_key/apiclient_cert.pem');
     define('WXPAY_SSLKEY_PATH', DIR_SYSTEM . 'helper/wxpay_key/apiclient_key.pem');
     define('WXPAY_CURL_PROXY_HOST', "0.0.0.0");
     define('WXPAY_CURL_PROXY_PORT', 0);
     define('REPORT_LEVENL', 1);
     require_once DIR_SYSTEM . 'library/wxpay/wxpayconfig.php';
     require_once DIR_SYSTEM . 'library/wxpay/wxpaydata.php';
     require_once DIR_SYSTEM . 'library/wxpay/wxpayapi.php';
     require_once DIR_SYSTEM . 'library/wxpay/wxpaynativepay.php';
     $this->load->language('extension/payment/qrcode_wxpay');
     $data['button_confirm'] = $this->language->get('button_confirm');
     $this->load->model('checkout/order');
     $order_id = $this->session->data['order_id'];
     $order_info = $this->model_checkout_order->getOrder($order_id);
     $item_name = $this->config->get('config_name');
     $fullname = $order_info['payment_fullname'];
     $this->load->model('account/order');
     $shipping_cost = 0;
     $totals = $this->model_account_order->getOrderTotals($order_id);
     foreach ($totals as $total) {
         if ($total['title'] == 'shipping') {
             $shipping_cost = $total['value'];
         }
     }
     $notify_url = HTTPS_SERVER . 'catalog/controller/extension/payment/qrcode_wxpay_callback.php';
     $out_trade_no = $this->session->data['order_id'];
     $subject = $item_name . ' ' . $this->language->get('text_order') . ' ' . $order_id;
     $amount = $order_info['total'];
     $currency_value = $this->currency->getValue('CNY');
     $price = $amount * $currency_value;
     $price = number_format($price, 2, '.', '');
     $total_fee = $price * 100;
     //乘100去掉小數點,以傳遞整數給微信支付
     $notify = new NativePay();
     $input = new WxPayUnifiedOrder();
     $input->SetBody($subject);
     $input->SetAttach("mycncart");
     $input->SetOut_trade_no($order_id);
     $input->SetTotal_fee($total_fee);
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag("mycncart");
     $input->SetNotify_url(HTTPS_SERVER . "catalog/controller/extension/payment/qrcode_wxpay_callback.php");
     $input->SetTrade_type("NATIVE");
     $input->SetProduct_id($order_id);
     $result = $notify->GetPayUrl($input);
     $this->session->data['code_url'] = $result['code_url'];
     $data['redirect'] = $this->url->link('checkout/qrcode_wxpay_success');
     return $this->load->view('extension/payment/qrcode_wxpay', $data);
 }
開發者ID:brunoxu,項目名稱:mycncart,代碼行數:57,代碼來源:qrcode_wxpay.php

示例7: wxJsPay

 public function wxJsPay()
 {
     $list = isset($_SESSION['orderinfo']) ? $_SESSION['orderinfo'] : array();
     if (!isset($_SESSION['orderinfo'])) {
         header("Location:" . appurl('getMeOrder'));
         die;
     }
     //驗證是否能預定
     if (isset($_SESSION['orderList'])) {
         foreach ($_SESSION['orderList'] as $key => $value) {
             $this->checkCanSum($value['bookid'], $value);
             if (!$this->checkBook($value['bookid'])) {
                 $this->alert($value['title'] . '已經售賣結束');
                 exit;
             }
         }
     }
     //初始化日誌
     $logHandler = new CLogFileHandler("../logs/" . date('Y-m-d') . '.log');
     $log = Log::Init($logHandler, 15);
     //①、獲取用戶openid
     $tools = new JsApiPay();
     $openId = $tools->GetOpenid();
     //②、統一下單
     //價錢轉成分
     $totalFee = $list['allPrice'] * 100;
     $input = new WxPayUnifiedOrder();
     $input->SetBody("訂單");
     $input->SetAttach("訂單");
     $input->SetOut_trade_no($list['orderid']);
     $input->SetTotal_fee($totalFee);
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag("訂單");
     $input->SetNotify_url(appurl('callBack'));
     // "http://paysdk.weixin.qq.com/example/notify.php"
     $input->SetTrade_type("JSAPI");
     $input->SetOpenid($openId);
     $order = WxPayApi::unifiedOrder($input);
     echo '<font color="#f00"><b>支付中,客官請稍後....</b></font><br/>';
     // $this->printf_info($order);
     $jsApiParameters = $tools->GetJsApiParameters($order);
     //獲取共享收貨地址js函數參數
     $editAddress = $tools->GetEditAddressParameters();
     //③、在支持成功回調通知中處理成功之後的事宜,見 notify.php
     /**
      * 注意:
      * 1、當你的回調地址不可訪問的時候,回調通知會失敗,可以通過查詢訂單來確認支付是否成功
      * 2、jsapi支付時需要填入用戶openid,WxPay.JsApiPay.php中有獲取openid流程 (文檔可以參考微信公眾平台“網頁授權接口”,
      * 參考http://mp.weixin.qq.com/wiki/17/c0f37d5704f0b64713d5d2c37b468d75.html)
      */
     $data = array('jsApiParameters' => $jsApiParameters, 'editAddress' => $editAddress, 'orderid' => $list['orderid'], 'pageTitle' => '支付');
     unset($_SESSION['orderinfo']);
     $this->layoutRender('/wxpay', $data);
 }
開發者ID:aising,項目名稱:ding,代碼行數:55,代碼來源:PayController.php

示例8: getPrepayId

function getPrepayId($total_amount, $order_number, $attach)
{
    $input = new WxPayUnifiedOrder();
    $input->SetBody("美果優鮮訂單");
    $input->SetAttach("繽紛水果");
    $input->SetOut_trade_no($attach);
    $input->SetTotal_fee($total_amount * 100);
    $input->SetAttach($order_number);
    $input->SetTime_start(date("YmdHis"));
    $input->SetTime_expire(date("YmdHis", time() + 600));
    $input->SetGoods_tag("商品標簽");
    $input->SetNotify_url("https://dev1.meiguoyouxian.com/magento/custom/api/util/wx.php");
    $input->SetTrade_type("APP");
    $order = WxPayApi::unifiedOrder($input);
    return $order;
}
開發者ID:HB4daemmon,項目名稱:custom,代碼行數:16,代碼來源:wx_wap.php

示例9: pay

 public function pay($title, $price)
 {
     $notify = new NativePay();
     $input = new WxPayUnifiedOrder();
     $input->SetBody($title);
     $input->SetAttach($title);
     $input->SetOut_trade_no(WxPayConfig::MCHID . date("YmdHis"));
     $input->SetTotal_fee($price);
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag("test");
     $input->SetNotify_url("http://paysdk.weixin.qq.com/example/notify.php");
     $input->SetTrade_type("NATIVE");
     $input->SetProduct_id("123456789");
     $result = $notify->GetPayUrl($input);
     $url2 = $result["code_url"];
     return $url;
 }
開發者ID:xiaoyueguang,項目名稱:cake,代碼行數:18,代碼來源:Ci_wxpay.php

示例10: unifiedorder

 public function unifiedorder($openId, $product_id)
 {
     //統一下單
     $input = new WxPayUnifiedOrder();
     $input->SetBody("test");
     $input->SetAttach("test");
     $input->SetOut_trade_no(WxPayConfig::MCHID . date("YmdHis"));
     $input->SetTotal_fee("1");
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag("test");
     $input->SetNotify_url(Config::API_NOTIFY_URL);
     $input->SetTrade_type("NATIVE");
     $input->SetOpenid($openId);
     $input->SetProduct_id($product_id);
     $result = WxPayApi::unifiedOrder($input, Config::API_TIMEOUT);
     Log::DEBUG("unifiedorder:" . json_encode($result));
     return $result;
 }
開發者ID:xiaoziwuzui,項目名稱:gdby_github_repo,代碼行數:19,代碼來源:native_notify.php

示例11: unifiedorder

 public function unifiedorder($openId, $product_id)
 {
     //統一下單
     $input = new WxPayUnifiedOrder();
     $input->SetBody("test");
     $input->SetAttach("test");
     $input->SetOut_trade_no(WxPayConfig::MCHID . date("YmdHis"));
     $input->SetTotal_fee("1");
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag("test");
     $input->SetNotify_url("http://paysdk.weixin.qq.com/example/notify.php");
     $input->SetTrade_type("NATIVE");
     $input->SetOpenid($openId);
     $input->SetProduct_id($product_id);
     $result = WxPayApi::unifiedOrder($input);
     Log::DEBUG("unifiedorder:" . json_encode($result));
     return $result;
 }
開發者ID:aising,項目名稱:ding,代碼行數:19,代碼來源:native_notify.php

示例12: weixinPayment

 /**
  * [paymenttList 微信支付頁麵]
  * @Author   羅江濤
  * @DateTime 2016-03-07T17:01:37+0800
  */
 public function weixinPayment()
 {
     $title = I("title");
     $price = I("price");
     $reportId = I("reportId");
     $userId = I("userId");
     ini_set('date.timezone', 'Asia/Shanghai');
     require "./Application/Index/Service/weixinPayApi/WxPay.Api.php";
     require "./Application/Index/Service/weixinPayApi/WxPay.NativePay.php";
     //模式二
     $notify = new \NativePay();
     /**
      * 流程:
      * 1、調用統一下單,取得code_url,生成二維碼
      * 2、用戶掃描二維碼,進行支付
      * 3、支付完成之後,微信服務器會通知支付成功
      * 4、在支付成功通知中需要查單確認是否真正支付成功(見:notify.php)
      */
     // $input = new \Index\Service\weixinPayApi\lib\WxPayUnifiedOrder();
     $input = new \WxPayUnifiedOrder();
     $input->SetBody($title);
     $input->SetAttach($userId . "|" . $reportId);
     $input->SetOut_trade_no(\WxPayConfig::MCHID . date("YmdHis"));
     // $input->SetOut_trade_no($reportId);
     $input->SetTotal_fee($price);
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag("SetGoods_tag");
     // $input->SetNotify_url("http://qingdao.luojiangtao.com/index.php/Api/Payment/getWeixinPaymentInfo");
     // $input->SetNotify_url(U("Api/Payment/getWeixinPayPost"));
     $input->SetNotify_url("http://qingdao.luojiangtao.com/vcbeat/index.php/Api/Payment/getWeixinPayPost");
     $input->SetTrade_type("NATIVE");
     $input->SetProduct_id("123456789");
     // p($_SERVER);die;
     $result = $notify->GetPayUrl($input);
     $url2 = $result["code_url"];
     // p($result);die;
     // $this->assign("url2", $url2);
     $this->url2 = $url2;
     $this->display();
 }
開發者ID:luojiangtao,項目名稱:vcbeat_my,代碼行數:46,代碼來源:PaymentController.class.php

示例13: getUnifiedOrder

 /**
  * 統一下單
  *
  * @param $amount
  *
  * @return string
  */
 private function getUnifiedOrder($amount)
 {
     $tools = new \JsApiPay();
     $openId = $tools->GetOpenid();
     //獲取用戶openID
     $outTradeNo = \tools\Tools::uuid();
     $input = new \WxPayUnifiedOrder();
     $input->SetBody($this->data['memo']);
     $input->SetAttach($this->data['id']);
     $input->SetOut_trade_no($outTradeNo);
     $input->SetTotal_fee($this->amount);
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag($this->data['memo']);
     $input->SetNotify_url($this->notify_url);
     $input->SetTrade_type("JSAPI");
     $input->SetOpenid($openId);
     $order = \WxPayApi::unifiedOrder($input);
     $jsApiParameters = $tools->GetJsApiParameters($order);
     //獲取共享收貨地址js函數參數
     $editAddress = $tools->GetEditAddressParameters();
     return ['jsApiParameters' => $jsApiParameters, 'editAddress' => $editAddress, 'amount' => $amount, 'orderId' => $this->data['id']];
 }
開發者ID:hejxing,項目名稱:jt,代碼行數:30,代碼來源:Api.php

示例14: unifiedOrder

 /**
  * 統一下單接口
  * 
  * @param array $order 站內訂單數組
  * @param string $openId openid
  * @return string
  */
 public static function unifiedOrder(array $order, $openId = '')
 {
     if (empty($order)) {
         return '';
     }
     include_once WXPAY_SDK_ROOT . "unit/WxPay.JsApiPay.php";
     //獲取用戶openid
     $tools = new JsApiPay();
     if (empty($openId)) {
         $openId = $tools->GetOpenid();
     }
     $wx_order_body = '女神送花(' . $order['player_id'] . '號)';
     $order_detail = ($order['goods_type'] == 'flower' ? "送花(" : "送吻(") . $order['goods_amount'] . ")";
     /*
     if (!empty($order['order_goods'])) {
       foreach ($order['order_goods'] As $g) {
         $order_detail .= $g['goods_name'].'('.$g['goods_price'].'x'.$g['goods_number'].")\n";
         if (''==$wx_order_body) {
           $wx_order_body = mb_truncate($g['goods_name'], 27);
         }
       }
       $order_detail = rtrim($order_detail,"\n");
     }
     */
     //統一下單
     if (1 || empty($order['pay_data1'])) {
         //訂單狀態可能會被後台更改,所以同一訂單每次支付都要重新生成提交信息
         if ('' == $wx_order_body) {
             $wx_order_body = '微信支付商品';
         }
         $now = time();
         $input = new WxPayUnifiedOrder();
         $input->SetBody($wx_order_body);
         $input->SetDetail($order_detail);
         $input->SetAttach('simphp');
         //商家自定義數據,原樣返回
         $input->SetOut_trade_no($order['order_sn']);
         $input->SetTotal_fee(intval($order['order_amount'] * 100));
         //'分'為單位
         $input->SetTime_start(date('YmdHis', $now));
         $input->SetTime_expire(date('YmdHis', $now + 60 * 15));
         //15分鍾內支付有效
         $input->SetGoods_tag('');
         //商品標記,代金券或立減優惠功能的參數
         $input->SetNotify_url(self::NOFIFY_URL);
         $input->SetTrade_type(self::TRADE_TYPE_JSAPI);
         $input->SetOpenid($openId);
         $order_wx = WxPayApi::unifiedOrder($input);
         //trace_debug('wxpay_order_wx', $order_wx);
         if ('SUCCESS' == $order_wx['return_code'] && 'SUCCESS' == $order_wx['result_code']) {
             //保存信息以防再次重複提交
             $wxpay_data = ['appid' => $order_wx['appid'], 'mch_id' => $order_wx['mch_id'], 'trade_type' => $order_wx['trade_type'], 'prepay_id' => $order_wx['prepay_id']];
             if (isset($order_wx['code_url'])) {
                 $wxpay_data['code_url'] = $order_wx['code_url'];
             }
             Goods::orderUpdate(['pay_data1' => json_encode($wxpay_data)], $order['order_id']);
         }
     } else {
         $order_wx = json_decode($order['pay_data1'], true);
     }
     $jsApiParameters = $tools->GetJsApiParameters($order_wx);
     return $jsApiParameters;
 }
開發者ID:GavinLai,項目名稱:SimMatch,代碼行數:70,代碼來源:class.Wxpay.php

示例15: dirname

<?php

require dirname(dirname(dirname(__FILE__))) . '/include/common.inc.php';
require_once SLINEINC . "/view.class.php";
$pv = new View();
require_once "lib/WxPay.Api.php";
require_once "example/WxPay.NativePay.php";
require_once 'example/log.php';
$notify = new NativePay();
$input = new WxPayUnifiedOrder();
$input->SetBody($_POST['subject']);
$input->SetAttach("");
$input->SetOut_trade_no($_POST['ordersn']);
$input->SetTotal_fee($_POST['price'] * 100);
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 600));
$input->SetGoods_tag("");
$input->SetNotify_url($GLOBALS['cfg_basehost'] . '/thirdpay/weixinpay/notify.php');
$input->SetTrade_type("NATIVE");
$input->SetProduct_id($_POST['ordersn']);
$result = $notify->GetPayUrl($input);
$url2 = urlencode($result["code_url"]);
$templet = SLINEROOT . '/thirdpay/weixinpay/tpl/native.htm';
$pv->SetTemplet($templet);
$pv->Display();
exit;
?>

開發者ID:lz1988,項目名稱:stourwebcms,代碼行數:27,代碼來源:native.php


注:本文中的WxPayUnifiedOrder::SetGoods_tag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。