Skip to content

Commit

Permalink
[doc][security] use generic token factory in doc examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Mar 10, 2014
1 parent e0c05d8 commit 4346afb
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Resources/docs/get-it-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,7 @@ $paymentDetails = $storage->createModel();
$paymentDetails[Constants::FIELD_PAID] = true;
$storage->updateModel($paymentDetails);

$doneToken = $tokenStorage->createModel();
$doneToken->setPaymentName('offline');
$doneToken->setDetails($storage->getIdentificator($paymentDetails));
$doneToken->setTargetUrl('http://'.$_SERVER['HTTP_HOST'].'/done.php?payum_token='.$doneToken->getHash());
$tokenStorage->updateModel($doneToken);

$captureToken = $tokenStorage->createModel();
$captureToken->setPaymentName('offline');
$captureToken->setDetails($storage->getIdentificator($paymentDetails));
$captureToken->setTargetUrl('http://'.$_SERVER['HTTP_HOST'].'/capture.php?payum_token='.$captureToken->getHash());
$captureToken->setAfterUrl($doneToken->getTargetUrl());
$tokenStorage->updateModel($captureToken);
$captureToken = $tokenFactory->createCaptureToken('offline', $paymentDetails, 'done.php');

header("Location: ".$captureToken->getTargetUrl());
```
Expand Down

0 comments on commit 4346afb

Please sign in to comment.