You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

<?php
namespace app\common\payment;
use think\Exception;
use app\common\payment\LinePay;
use app\common\payment\EcpayCredit;
use app\common\payment\GomypayATM;
use app\common\payment\GomyPayCVS;
use app\common\payment\GomypayCredit;
use app\common\payment\EcpayCVS;
use app\common\payment\EcpayATM;
use app\common\payment\TapPayCredit;
class PaymentFactory
{
public static function createPaymentService($serviceName) {
switch ($serviceName) {
case 'linepay':
return new LinePay();
break;
case 'eccredit':
return new EcpayCredit();
break;
case 'gmpatm':
return new GomypayATM();
break;
case 'gmpcvs':
return new GomyPayCVS();
break;
case 'gmpcredit':
return new GomypayCredit();
break;
case 'eccvs':
return new EcpayCVS();
break;
case 'ecatm':
return new EcpayATM();
break;
case 'tpcredit':
return new TapPayCredit();
break;
default:
throw new Exception("Unsupported payment service: $serviceName");
}
}
}