PayFactory.php 482 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Libs\Pay;
  3. /**
  4. * @method static \App\Libs\Pay\Merchants\UnionPay unionPay(array $data)
  5. * @method static \App\Libs\Pay\Merchants\Official official(array $data)
  6. * @method static \App\Libs\Pay\Merchants\AliPay aliPay(array $config)
  7. */
  8. class PayFactory
  9. {
  10. public static function __callStatic($name, $arguments)
  11. {
  12. $namesapce = "\\App\\Libs\\Pay\\Merchants";
  13. $application = $namesapce . "\\" . ucfirst($name);
  14. return new $application(...$arguments);
  15. }
  16. }