国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.3KB

  1. <?php
  2. namespace AliPay;
  3. if (!defined('DEDEINC')) exit ('dedebiz');
  4. use WeChat\Contracts\BasicAliPay;
  5. /**
  6. * 支付宝标准接口
  7. * Class Trade
  8. * @package AliPay
  9. */
  10. class Trade extends BasicAliPay
  11. {
  12. /**
  13. * 设置交易接口地址
  14. * @param string $method
  15. * @return $this
  16. */
  17. public function setMethod($method)
  18. {
  19. $this->options->set('method', $method);
  20. return $this;
  21. }
  22. /**
  23. * 获取交易接口地址
  24. * @return string
  25. */
  26. public function getMethod()
  27. {
  28. return $this->options->get('method');
  29. }
  30. /**
  31. * 设置接口公共参数
  32. * @param array $option
  33. * @return Trade
  34. */
  35. public function setOption($option = [])
  36. {
  37. foreach ($option as $key => $vo) {
  38. $this->options->set($key, $vo);
  39. }
  40. return $this;
  41. }
  42. /**
  43. * 获取接口公共参数
  44. * @return array|string|null
  45. */
  46. public function getOption()
  47. {
  48. return $this->options->get();
  49. }
  50. /**
  51. * 执行通过接口
  52. * @param array $options
  53. * @return array|boolean
  54. * @throws \WeChat\Exceptions\InvalidResponseException
  55. * @throws \WeChat\Exceptions\LocalCacheException
  56. */
  57. public function apply($options)
  58. {
  59. return $this->getResult($options);
  60. }
  61. }
  62. ?>