options->set('method', $method); return $this; } /** * 获取当前交易接口方法名 * @return string */ public function getMethod() { return $this->options->get('method'); } /** * 设置公共参数(透传到 options) * @param array $option key-value 公共参数 * @return Trade */ public function setOption($option = []) { foreach ($option as $key => $vo) { $this->options->set($key, $vo); } return $this; } /** * 获取当前公共参数 * @return array|string|null */ public function getOption() { return $this->options->get(); } /** * 执行当前设置的交易接口 * @param array $options 业务参数(写入 biz_content) * @return array 接口返回结果 * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function apply($options) { return $this->getResult($options); } }