Skip to content

Commit 30c6db3

Browse files
committed
Check FQCN
1 parent d403e69 commit 30c6db3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Common/Helper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,13 @@ public static function getGatewayShortName($className)
127127
*/
128128
public static function getGatewayClassName($shortName)
129129
{
130-
if (0 === strpos($shortName, '\\')) {
130+
// If the class starts with \ or Omnipay\, assume it's a FQCN
131+
if (0 === strpos($shortName, '\\') || 0 === strpos($shortName, 'Omnipay\\')) {
131132
return $shortName;
132133
}
133-
if (0 === strpos($shortName, 'Omnipay\\')) {
134+
135+
// Check if the class exists and implements the Gateway Interface, if so -> FCQN
136+
if (is_subclass_of($shortName, GatewayInterface::class, true)) {
134137
return $shortName;
135138
}
136139

0 commit comments

Comments
 (0)