Configure webhooks on gateway creation

This commit is contained in:
David Bomba 2022-05-30 20:08:12 +10:00
parent 4b796fe362
commit a96ff66dee
2 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@ use App\Http\Requests\CompanyGateway\UpdateCompanyGatewayRequest;
use App\Jobs\Util\ApplePayDomain;
use App\Models\Client;
use App\Models\CompanyGateway;
use App\PaymentDrivers\Stripe\Jobs\StripeWebhook;
use App\Repositories\CompanyRepository;
use App\Transformers\CompanyGatewayTransformer;
use App\Utils\Traits\MakesHash;
@ -212,6 +213,11 @@ class CompanyGatewayController extends BaseController
ApplePayDomain::dispatch($company_gateway, $company_gateway->company->db);
if(in_array($company_gateway->gateway_key, $this->stripe_keys))
{
StripeWebhook::dispatch($company_gateway->company->company_key, $company_gateway->id);
}
return $this->itemResponse($company_gateway);
}

View File

@ -81,6 +81,7 @@ class StripeWebhook implements ShouldQueue
\Stripe\WebhookEndpoint::update($endpoint->id, ['enabled_events' => $this->events], $stripe->stripe_connect_auth);
$this->url_found = true;
}
}