1
0

Cleanup, added docs & RC 2

This commit is contained in:
2017-04-04 08:26:11 +02:00
parent 21e67b0298
commit 3ee95398c4
18 changed files with 145 additions and 63 deletions

View File

@ -35,13 +35,12 @@ class Handler
* - amount
* - description
* - returnUrl
* - sha1
* - hash
*/
$this->post('/transactionRequest', function ($request, $response, $args) {
$parsedBody = $request->getParsedBody();
if (isset($parsedBody['clientId']) && isset($parsedBody['transactionId']) && isset($parsedBody['amount']) && isset($parsedBody['description']) && isset($parsedBody['returnUrl']) && isset($parsedBody['hash'])) {
// Correct request
try {
$client = new Client($parsedBody['clientId']);
$clientSecret = $client->getClientSecret();
@ -112,13 +111,12 @@ class Handler
* Requires the following POST arguments:
* - clientId
* - transactionId
* - sha1
* - hash
*/
$this->post('/statusRequest', function ($request, $response, $args) {
$parsedBody = $request->getParsedBody();
if (isset($parsedBody['clientId']) && isset($parsedBody['transactionId']) && isset($parsedBody['hash'])) {
// Correct request
try {
$client = new Client($parsedBody['clientId']);
$clientSecret = $client->getClientSecret();