PreCreatePlugin.php 777 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. declare(strict_types=1);
  3. namespace Yansongda\Pay\Plugin\Alipay\Trade;
  4. use Yansongda\Pay\Exception\ContainerException;
  5. use Yansongda\Pay\Exception\ServiceNotFoundException;
  6. use Yansongda\Pay\Plugin\Alipay\GeneralPlugin;
  7. use Yansongda\Pay\Rocket;
  8. use Yansongda\Pay\Traits\SupportServiceProviderTrait;
  9. /**
  10. * @see https://opendocs.alipay.com/open/02ekfg?scene=common
  11. */
  12. class PreCreatePlugin extends GeneralPlugin
  13. {
  14. use SupportServiceProviderTrait;
  15. /**
  16. * @throws ContainerException
  17. * @throws ServiceNotFoundException
  18. */
  19. protected function doSomethingBefore(Rocket $rocket): void
  20. {
  21. $this->loadAlipayServiceProvider($rocket);
  22. }
  23. protected function getMethod(): string
  24. {
  25. return 'alipay.trade.precreate';
  26. }
  27. }