Skip to content

Commit

Permalink
Issue thephpleague#131 additional documentation on error recovery.
Browse files Browse the repository at this point in the history
  • Loading branch information
judgej committed Aug 24, 2019
1 parent b7f1312 commit 0454e93
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,13 +701,19 @@ user's return. This will be at your `returnUrl` endpoint:
// against the transactionId provided in the server request.
// This prevents different payments getting mixed up.

$result = $gateway->completeAuthorize(['transactionId' => $originalTransactionId])->send();
$completeRequest = $gateway->completeAuthorize(['transactionId' => $originalTransactionId]);
$result = $completeRequest->send();

$result->isSuccessful();
$result->getTransactionReference();
// etc.
```

Note that if `send()` throws an exception here due to a `transactionId` mismatch,
you can still access the decryoted data that was brought back with the user as
`$completeRequest->getData()`.
You will need to log this for later analysis.

If you already have the encrypted response string, then it can be passed in.
However, you would normally leave it for the driver to read it for you from
the current server request, so the following would not normally be necessary:
Expand Down

0 comments on commit 0454e93

Please sign in to comment.