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)
122122 * PayPal\Express => \Omnipay\PayPal\ExpressGateway
123123 * PayPal_Express => \Omnipay\PayPal\ExpressGateway
124124 *
125- * @param string $shortName The short gateway name
125+ * @param string $shortName The short gateway name or the FQCN
126126 * @return string The fully namespaced gateway class name
127127 */
128128 public static function getGatewayClassName ($ shortName )
129129 {
130130 if (0 === strpos ($ shortName , '\\' )) {
131131 return $ shortName ;
132132 }
133+ if (0 === strpos ($ shortName , 'Omnipay \\' )) {
134+ return $ shortName ;
135+ }
133136
134137 // replace underscores with namespace marker, PSR-0 style
135138 $ shortName = str_replace ('_ ' , '\\' , $ shortName );
Original file line number Diff line number Diff line change @@ -143,4 +143,10 @@ public function testGetGatewayClassNameUnderscoreNamespace()
143143 $ class = Helper::getGatewayClassName ('PayPal_Express ' );
144144 $ this ->assertEquals ('\\Omnipay \\PayPal \\ExpressGateway ' , $ class );
145145 }
146+
147+ public function testGetGatewayClassNameFQCN ()
148+ {
149+ $ class = Helper::getGatewayClassName ('Omnipay\Stripe\PaymentIntentsGateway ' );
150+ $ this ->assertEquals ('Omnipay\Stripe\PaymentIntentsGateway ' , $ class );
151+ }
146152}
You can’t perform that action at this time.
0 commit comments