public function getOrderData() { if ($this->isSuccessful()) { $data = array('app_id' => $this->request->getAppId(), 'mch_id' => $this->request->getMchId(), 'prepay_id' => $this->getPrepayId(), 'package' => 'Sign=WXPay', 'nonce' => md5(uniqid()), 'timestamp' => time()); $data['sign'] = Helper::sign($data, $this->request->getApiKey()); } else { $data = null; } return $data; }
public function getJSOrderData() { if ($this->isSuccessful()) { $data = array('appId' => $this->request->getAppId(), 'package' => 'prepay_id=' . $this->getPrepayId(), 'nonceStr' => md5(uniqid()), 'timeStamp' => time()); $data['signType'] = 'MD5'; $data['paySign'] = Helper::sign($data, $this->request->getApiKey()); } else { $data = null; } return $data; }