Skip to content

Instantly share code, notes, and snippets.

@piotr-galas
Last active October 6, 2015 07:22
Show Gist options
  • Save piotr-galas/e8450c6947c5649b4fbe to your computer and use it in GitHub Desktop.
Save piotr-galas/e8450c6947c5649b4fbe to your computer and use it in GitHub Desktop.
wery bad code _postPayment
<?php
public function _postPayment( $data ) {
$app =JFactory::getApplication();
$html = "";
$get = $app->input->get->get('status', false);
if ( (bool) $get ) {
$vars = new JObject();
if ($app->input->get->getString('status') == self::STATUS_OK) {
$vars->message = JText::_('J2STORE_CONFIRMED');
} else {
$vars->message = JText::_('J2STORE_FAILED');
}
$html = $this->_getLayout('postpayment', $vars);
} else {
$status = $this->getValidation($app->input);
if($status === self::STATUS_OK) {
if($this->setOrderStatus($app->input->getString('control'))) {
echo self::STATUS_OK;
} else {
echo self::STATUS_FAIL;
}
} else {
echo self::STATUS_FAIL;
}
$app->close();
}
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment