<?php
 namespace Module\PayCenter\Providers; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Support\ServiceProvider; use Latrell\Alipay\AlipayServiceProvider; use Module\PayCenter\Util\PayConfigUtil; class PayServiceProvider extends ServiceProvider { public function boot(Dispatcher $dispatcher) { $this->publishes([ __DIR__ . '/../Config/pay.php' => config_path('pay.php') ], 'config'); $this->app->register(AlipayServiceProvider::class); $dispatcher->subscribe(config('pay.payListener')); try { if (modstart_config('payAlipayOn', false)) { config([ 'pay.alipay' => [ 'partnerId' => modstart_config()->getWithEnv('payAlipayPartnerId'), 'sellerId' => modstart_config()->getWithEnv('payAlipaySellerId'), 'key' => modstart_config()->getWithEnv('payAlipayKey'), ] ]); } } catch (\Exception $e) { } } public function register() { $this->mergeConfigFrom( __DIR__ . '/../Config/pay.php', 'pay' ); } } 