ScanGateway.php 776 B

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