<?php  namespace App\Services\Orders;  use App\Models\Order; use BigFish\PDF417\PDF417; use Srmklive\PayPal\Services\PayPal; use App\Contracts\OrderFinalizationInterface; use App\Services\Orders\Payments\GenerateSlip; use App\Services\Orders\Payments\PayOnDelivery; use App\Services\Orders\Payments\CorvusPaymentService; use App\Services\Orders\Payments\PayPalPaymentService; use App\Services\Orders\Payments\PaymentSlipCreation\BarCodeGenerator; use App\Services\Orders\Payments\PaymentSlipCreation\PaymentSlipGenerator;  class OrderFinalizationServiceFactory { 	/** 	 * @return CorvusPaymentService|GenerateSlip|PayOnDelivery|PayPalPaymentService|null 	 */ 	public static function make(int $type, ?int $provider = null): ?OrderFinalizationInterface 	{ 		switch ($type) { 			case Order::PAYMENT_METHOD_CARD:  				switch ($provider) { 					case Order::PAYMENT_PROVIDER_PAYPAL: return new PayPalPaymentService(new PayPal);  					case Order::PAYMENT_PROVIDER_CORVUS: return new CorvusPaymentService; 				}  			case Order::PAYMENT_METHOD_VIRMAN: return new GenerateSlip(new BarCodeGenerator(new PDF417), new PaymentSlipGenerator, setting('iban'), storage_path('app'));  			case Order::PAYMENT_METHOD_POUZECE: 			case Order::PAYMENT_METHOD_GIFT_CODE: return new PayOnDelivery; 		}  		return null; 	} }