File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -122,14 +122,17 @@ public static function getGatewayShortName($className)
122
122
* PayPal\Express => \Omnipay\PayPal\ExpressGateway
123
123
* PayPal_Express => \Omnipay\PayPal\ExpressGateway
124
124
*
125
- * @param string $shortName The short gateway name
125
+ * @param string $shortName The short gateway name or the FQCN
126
126
* @return string The fully namespaced gateway class name
127
127
*/
128
128
public static function getGatewayClassName ($ shortName )
129
129
{
130
130
if (0 === strpos ($ shortName , '\\' )) {
131
131
return $ shortName ;
132
132
}
133
+ if (0 === strpos ($ shortName , 'Omnipay \\' )) {
134
+ return $ shortName ;
135
+ }
133
136
134
137
// replace underscores with namespace marker, PSR-0 style
135
138
$ shortName = str_replace ('_ ' , '\\' , $ shortName );
Original file line number Diff line number Diff line change @@ -143,4 +143,10 @@ public function testGetGatewayClassNameUnderscoreNamespace()
143
143
$ class = Helper::getGatewayClassName ('PayPal_Express ' );
144
144
$ this ->assertEquals ('\\Omnipay \\PayPal \\ExpressGateway ' , $ class );
145
145
}
146
+
147
+ public function testGetGatewayClassNameFQCN ()
148
+ {
149
+ $ class = Helper::getGatewayClassName ('Omnipay\Stripe\PaymentIntentsGateway ' );
150
+ $ this ->assertEquals ('Omnipay\Stripe\PaymentIntentsGateway ' , $ class );
151
+ }
146
152
}
You can’t perform that action at this time.
0 commit comments