public static function load($paymentGateway) { self::$_instance = null; self::$_instance = new self($paymentGateway); //debug(self::$_instance);exit; return self::getInstance(); }
public function process_payment() { if (!$this->request->is('post')) { return false; } $paymentGateway = $this->_paymentGatewaySelector($this->request->data); if (!$paymentGateway) { $process = 'fail'; } if (PaymentGatewayProcessor::load($paymentGateway)->processPayment($this->request->data)) { $process = 'success'; } else { $process = 'fail'; } $this->set('process', $process); $this->redirect(array('action' => 'payment_status', 'process' => $process)); }