AlipayServiceProvider.php 554 B

1234567891011121314151617181920212223242526
  1. <?php
  2. declare(strict_types=1);
  3. namespace Yansongda\Pay\Service;
  4. use Yansongda\Pay\Contract\ServiceProviderInterface;
  5. use Yansongda\Pay\Exception\ContainerException;
  6. use Yansongda\Pay\Pay;
  7. use Yansongda\Pay\Provider\Alipay;
  8. class AlipayServiceProvider implements ServiceProviderInterface
  9. {
  10. /**
  11. * @param mixed $data
  12. *
  13. * @throws ContainerException
  14. */
  15. public function register($data = null): void
  16. {
  17. $service = new Alipay();
  18. Pay::set(Alipay::class, $service);
  19. Pay::set('alipay', $service);
  20. }
  21. }