You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It doesn't really matter but you should choose one and stick to it, this function from omnipay-common takes care of it:
/**
* Resolve a short gateway name to a full namespaced gateway class.
*
* Class names beginning with a namespace marker (\) are left intact.
* Non-namespaced classes are expected to be in the \Omnipay namespace, e.g.:
*
* \Custom\Gateway => \Custom\Gateway
* \Custom_Gateway => \Custom_Gateway
* Stripe => \Omnipay\Stripe\Gateway
* PayPal\Express => \Omnipay\PayPal\ExpressGateway
* PayPal_Express => \Omnipay\PayPal\ExpressGateway
*
* @param string $shortName The short gateway name
* @return string The fully namespaced gateway class name
*/
public static function getGatewayClassName($shortName)
{
if (0 === strpos($shortName, '\\')) {
return $shortName;
}
// replace underscores with namespace marker, PSR-0 style
$shortName = str_replace('_', '\\', $shortName);
if (false === strpos($shortName, '\\')) {
$shortName .= '\\';
}
return '\\Omnipay\\'.$shortName.'Gateway';
}
And you are right, it should be changed in the documentation to keep it consistent.
In the docs, the gateway names are inconsistent e.g. "SagePay/Server" vs "SagePay_Server". Which should it be? Does it matter?
The text was updated successfully, but these errors were encountered: