From f4ae17165ad0c8b4121365cc1d34665e57ded7ac Mon Sep 17 00:00:00 2001 From: Anyon Date: Thu, 12 Mar 2020 09:51:56 +0800 Subject: [PATCH] Update Trade.php --- AliPay/Trade.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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