PosGateway.php 921 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Yansongda\Pay\Gateways\Wechat;
  3. use Yansongda\Pay\Exceptions\InvalidArgumentException;
  4. class PosGateway extends Wechat
  5. {
  6. /**
  7. * @var string
  8. */
  9. protected $gateway_order = 'pay/micropay';
  10. /**
  11. * get trade type config.
  12. *
  13. * @author yansongda <me@yansongda.cn>
  14. *
  15. * @return string
  16. */
  17. protected function getTradeType()
  18. {
  19. return 'MICROPAY';
  20. }
  21. /**
  22. * pay a order.
  23. *
  24. * @author yansongda <me@yansongda.cn>
  25. *
  26. * @param array $config_biz
  27. *
  28. * @return array
  29. */
  30. public function pay(array $config_biz = [])
  31. {
  32. if (is_null($this->user_config->get('app_id'))) {
  33. throw new InvalidArgumentException('Missing Config -- [app_id]');
  34. }
  35. unset($this->config['trade_type']);
  36. unset($this->config['notify_url']);
  37. return $this->preOrder($config_biz);
  38. }
  39. }