You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
741 B

3 years ago
  1. <?php namespace Wpstudio\Sber;
  2. use Wpstudio\Sber\Classes\DefaultMoneyRepair;
  3. use OFFLINE\Mall\Classes\Payments\PaymentGateway;
  4. use OFFLINE\Mall\Classes\Utils\Money;
  5. use System\Classes\PluginBase;
  6. use Wpstudio\Sber\Classes\SberCheckout;
  7. class Plugin extends PluginBase
  8. {
  9. /**
  10. * @var array Plugin dependencies
  11. */
  12. public $require = ['Offline.Mall'];
  13. final public function boot(): void
  14. {
  15. $gateway = $this->app->get(PaymentGateway::class);
  16. $gateway->registerProvider(new SberCheckout());
  17. // For solve this issue https://github.com/OFFLINE-GmbH/oc-mall-plugin/issues/258
  18. $this->app->singleton(Money::class, function () {
  19. return new DefaultMoneyRepair();
  20. });
  21. }
  22. }