Skip to content

Commit 1ff2057

Browse files
committed
Merge pull request #14 from alexandernst/master
Use Yii methods in example controller
2 parents 5df4fdb + 27cbc56 commit 1ff2057

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

docs/get-it-started.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,12 @@ class PaypalController extends CController
125125
$token = $this->getPayum()->getHttpRequestVerifier()->verify($_REQUEST);
126126
$payment = $this->getPayum()->getRegistry()->getPayment($token->getPaymentName());
127127

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

130-
$content = '';
131-
if ($status->isSuccess()) {
132-
$content .= '<h3>Payment status is success.</h3>';
133-
} else {
134-
$content .= '<h3>Payment status IS NOT success.</h3>';
135-
}
136-
137-
$content .= '<br /><br />'.json_encode(iterator_to_array($status->getModel()), JSON_PRETTY_PRINT);
138-
139-
echo '<pre>',$content,'</pre>';
140-
exit;
131+
echo CHtml::tag('h3', array(), 'Payment status is ' . $status->getStatus());
132+
echo CHtml::tag('pre', array(), json_encode(iterator_to_array($status->getModel()), JSON_PRETTY_PRINT));
133+
Yii::app()->end();
141134
}
142135

143136
/**

0 commit comments

Comments
 (0)