/**
* 构造方法
*/
public function __construct(Wechat $wechat, array $optionsForUnifiedorder)
{
// 将 trade_type 强制设为 JSAPI
$optionsForUnifiedorder['trade_type'] = self::TRADE_TYPE;
// 去统一下单接口下单
$unifiedorder = new Unifiedorder($wechat, $optionsForUnifiedorder);
// 下单结果中的 prepay_id
$response = $unifiedorder->getResponse();
$this->wechat = $wechat;
parent::__construct(array('package' => sprintf('prepay_id=%s', $response['prepay_id'])));
}