Skip to content

Commit

Permalink
Merge pull request #14 from alexandernst/master
Browse files Browse the repository at this point in the history
Use Yii methods in example controller
  • Loading branch information
makasim committed Jul 18, 2014
2 parents 5df4fdb + 27cbc56 commit 1ff2057
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions docs/get-it-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,12 @@ class PaypalController extends CController
$token = $this->getPayum()->getHttpRequestVerifier()->verify($_REQUEST);
$payment = $this->getPayum()->getRegistry()->getPayment($token->getPaymentName());

$payment->execute($status = new \Payum\Core\Request\BinaryMaskStatusRequest($token));
$status = new \Payum\Core\Request\SimpleStatusRequest($token);
$payment->execute($status);

$content = '';
if ($status->isSuccess()) {
$content .= '<h3>Payment status is success.</h3>';
} else {
$content .= '<h3>Payment status IS NOT success.</h3>';
}

$content .= '<br /><br />'.json_encode(iterator_to_array($status->getModel()), JSON_PRETTY_PRINT);

echo '<pre>',$content,'</pre>';
exit;
echo CHtml::tag('h3', array(), 'Payment status is ' . $status->getStatus());
echo CHtml::tag('pre', array(), json_encode(iterator_to_array($status->getModel()), JSON_PRETTY_PRINT));
Yii::app()->end();
}

/**
Expand Down

0 comments on commit 1ff2057

Please sign in to comment.