thephpleague / omnipay

A framework agnostic, multi-gateway payment processing library for PHP 5.6+
http://omnipay.thephpleague.com/
MIT License
5.91k stars 925 forks source link

Fetching gateway names from gateway package #606

Closed ericwang401 closed 1 year ago

ericwang401 commented 4 years ago

Hi, I am developing a flexible eCommerce panel, and I am trying to implement Omnipay.

I am trying my best to not make it so that users can add supported payment gateways on https://github.com/thephpleague/omnipay#payment-gateways

After a user runs "composer require [payment-gateway]", they would register the payment gateway in my panel.

My panel would auto detect the payment gateway by looking into the composer.lock for the keyword "omnipay"

The problem is, now I know the gateway exists. I have no way of accessing it because each gateway have different sub gateways (PayPal Express, PayPal REST API, PayPal Pro).

I want to be able to call the package "PayPal" and get PayPal Express, PayPal REST API, and PayPal Pro and the names to call them by when I run Omnipay::create("Gateway_Package")

tl;dr : let's say I installed the PayPal package, I want to know what sub gateways are available (PayPal Express, PayPal Pro, etc) and display them programmatically so it works with all other supported gateways.