Skip to content

Commit

Permalink
Added event to extend payment gateway objects.
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Feb 2, 2023
1 parent 9254450 commit 8da055c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions payments/AuthorizeNetAim.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ protected function createGateway()
$gateway->setTestMode($this->isTestMode());
$gateway->setDeveloperMode($this->isTestMode());

$this->fireSystemEvent('payregister.authorizenetaim.extendGateway', [$gateway]);

return $gateway;
}

Expand Down
2 changes: 2 additions & 0 deletions payments/Mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ protected function createGateway()

$gateway->setApiKey($this->getApiKey());

$this->fireSystemEvent('payregister.mollie.extendGateway', [$gateway]);

return $gateway;
}

Expand Down
2 changes: 2 additions & 0 deletions payments/PaypalExpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ protected function createGateway()
$gateway->setTestMode($this->isSandboxMode());
$gateway->setBrandName(setting('site_name'));

$this->fireSystemEvent('payregister.paypalexpress.extendGateway', [$gateway]);

return $gateway;
}

Expand Down
2 changes: 2 additions & 0 deletions payments/Square.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ protected function createGateway()
$gateway->setAccessToken($this->getAccessToken());
$gateway->setLocationId($this->getLocationId());

$this->fireSystemEvent('payregister.square.extendGateway', [$gateway]);

return $gateway;
}

Expand Down
2 changes: 1 addition & 1 deletion payments/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ protected function createGateway()
'api_key' => $this->getSecretKey(),
]);

$this->fireSystemEvent('payregister.stripe.extendClient', [$stripeClient]);
$this->fireSystemEvent('payregister.stripe.extendGateway', [$stripeClient]);

return $stripeClient;
}
Expand Down

0 comments on commit 8da055c

Please sign in to comment.