Closed Mouke closed 3 years ago
isn't this already possible?
I tried yesterday (I don't have my code under the nose so I can't give you my composer.lock exact version but it should be the latest one), it doesn't work.
When I tried to give it the FQCN, it tried to load Omnipay\Omnipay\Stripe\PaymentIntentsGateway\Gateway
Yeah I think the problem was that classes can exists (eg '\Stripe'). But we could use https://www.php.net/manual/en/function.is-subclass-of.php to check if the full name is actually a class that implements the gateway interface.
If you could make a testcase for it, that would be great!
I'll try to send you a PR with the fix and a testcase this week.
Ok got the issue : It is very weird : PaymentIntentsGateway::class (which prints 'Omnipay\Stripe\PaymentIntentsGateway') is processed as a Classname because it doesn't start by a .
yeah it checks on \
so need to change it.
I'm adding a check if it starts by Omnipay. Will do the job.
THanks. TWeaked it a bit: https://github.com/thephpleague/omnipay-common/commit/30c6db3e9c2df34c2c9ad854b8bca53b597b456a
Thanks for your reactivity :)
Hello there !
I'm testing Omnipay for the first time and I'd like to suggest an enhancement. After a small search in issues, i've seen no traces of such suggestion.
Currently, to use Omnipay/Stripe's PaymentIntents Gateway, I have to write this code :
$gateway = Omnipay\Omnipay::create('Stripe\PaymentIntents');
Why not allow to use the gateway FQCN in \Omnipay\Common\Helper::getGatewayClassName ? It would be much easier (and cleaner) to write this :
use Omnipay\Stripe\PaymentIntentsGateway; $gateway = Omnipay\Omnipay::create(PaymentIntentsGateway::class);
If you want, I would gladly make that small update and suggest a PR for that.