Gateway.php 767 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Yansongda\Pay\Gateways\Alipay;
  3. use Yansongda\Pay\Contracts\GatewayInterface;
  4. use Yansongda\Pay\Exceptions\InvalidArgumentException;
  5. use Yansongda\Supports\Collection;
  6. abstract class Gateway implements GatewayInterface
  7. {
  8. /**
  9. * Mode.
  10. *
  11. * @var string
  12. */
  13. protected $mode;
  14. /**
  15. * Bootstrap.
  16. *
  17. * @author yansongda <me@yansongda.cn>
  18. *
  19. * @throws InvalidArgumentException
  20. */
  21. public function __construct()
  22. {
  23. $this->mode = Support::getInstance()->mode;
  24. }
  25. /**
  26. * Pay an order.
  27. *
  28. * @author yansongda <me@yansongda.cn>
  29. *
  30. * @param string $endpoint
  31. *
  32. * @return Collection
  33. */
  34. abstract public function pay($endpoint, array $payload);
  35. }