Test routes for gateways

This commit is contained in:
David Bomba 2024-03-15 12:52:08 +11:00
parent 1595c9d1f7
commit 5f1e1ac174
4 changed files with 42 additions and 0 deletions

View File

@ -195,4 +195,9 @@ class AuthorizePaymentDriver extends BaseDriver
{
return (new AuthorizeCustomer($this))->importCustomers();
}
public function auth(): bool
{
return $this->init()->getPublicClientKey() ?? false;
}
}

View File

@ -806,4 +806,9 @@ class BaseDriver extends AbstractPaymentDriver
{
return true;
}
public function auth(): bool
{
return true;
}
}

View File

@ -420,4 +420,20 @@ class MolliePaymentDriver extends BaseDriver
{
return \number_format((float) $amount, 2, '.', '');
}
public function auth(): bool
{
$this->init();
try {
$p = $this->gateway->payments->page();
return true;
}
catch(\Exception $e){
}
return false;
}
}

View File

@ -990,4 +990,20 @@ class StripePaymentDriver extends BaseDriver
return mb_convert_encoding(pack('H*', $matches[1]), 'UTF-8', 'UCS-2BE');
}, $string);
}
public function auth(): bool
{
$this->init();
try {
$this->verifyConnect();
return true;
}
catch(\Exception $e) {
}
return false;
}
}