Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static funciton to retrieve supported methods list. #8

Open
jedateach opened this issue Jun 9, 2012 · 1 comment
Open

Add static funciton to retrieve supported methods list. #8

jedateach opened this issue Jun 9, 2012 · 1 comment
Milestone

Comments

@jedateach
Copy link
Collaborator

In payment 0.3 you can set the supported methods, but the only way you can get them is as form fields. That's not useful if you want to display the options in a drop-down list, or some other way.

@jedateach
Copy link
Collaborator Author

This is worknig, but currently requires some extra code like this:

    $supported_methods = PaymentProcessor::get_supported_methods();
    $source = array();
    if(count($supported_methods)){
        foreach ($supported_methods as $methodName) {
            $methodConfig = PaymentFactory::get_factory_config($methodName);
            $source[$methodName] = $methodConfig['title'];
        }
    }

..where $source contains the final list of supported methods.

This code could be factored into PaymentFactory, or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant