Created
January 28, 2012 18:30
-
-
Save calvinfroedge/1695358 to your computer and use it in GitHub Desktop.
payments static interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This method is here so the class can be called statically per FuelPHP standards, without dramatically changing the approach for the entire library. This is to make support (since this is a multi-framework payments package) and documentation easier. | |
*/ | |
public static function __callStatic($method, $params) | |
{ | |
$method = $method; | |
$gateway = $params[0]; | |
$params = $params[1]; | |
$payments = new self(); | |
return $payments->$method($gateway, $params); | |
} |
Yea, I think you're right. Framework agnostic library with wrappers is probably smartest approach. Otherwise, would never be able to support all of them.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it is better to make wrappers for each framework by keeping your library as is.