protected function beforePay() { $profileMethod = ProfileMethod::model()->findByPk(array('profile_id' => $this->campaignModel->profile->profile_id, 'method_id' => $this->paymentMethod->method_id)); if ($profileMethod && $profileMethod->isFlag(ProfileMethod::FLAG_FILTER) && $this->paymentModel->cc_number) { if (!Bin::verificationCreditCard($this->paymentModel->cc_number)) { Attempt::setAttemptStatus($this->attemptModel, Attempt::FRAUD_STATUS); $this->_paymetnResponse->addError('error_processing_request'); $this->_paymetnResponse->addAlert('please_use_a_different_card'); $this->_paymetnResponse->status = PaymentAPIResponse::ERROR_STATUS; // log prepaid card attempt OrderLog::createLog(0, $this->orderModel->order_id, 28, 'Prepaid Card'); return false; } } return true; }