コード例 #1
0
 public static function load($paymentGateway)
 {
     self::$_instance = null;
     self::$_instance = new self($paymentGateway);
     //debug(self::$_instance);exit;
     return self::getInstance();
 }
コード例 #2
0
 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));
 }