diff --git a/AliPay/Trade.php b/AliPay/Trade.php index e622544..aa289c9 100644 --- a/AliPay/Trade.php +++ b/AliPay/Trade.php @@ -44,6 +44,28 @@ class Trade extends BasicAliPay return $this->options->get('method'); } + /** + * 设置接口公共参数 + * @param array $option + * @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