PayFactory.php
380 Bytes
<?php
namespace WebPlugin\Pay;
class PayFactory {
static public function factory(array $paymentParams) {
$payCode = $paymentParams['pay_code'];
if(empty($payCode)) {
return false;
}
$className = __NAMESPACE__ . '\\' . $payCode . '\\Service';
if(class_exists($className)){
return new $className ( $paymentParams );
}
return false;
}
}