Start payment response
+queryRequestJson
+{{ queryRequestJson }}
+ startQueryResponseJson
+{{ startQueryResponseJson }}
+ logEntriesJson
+{{ logEntriesJson }}
+ diff --git a/composer.json b/composer.json index aa9880e..86491b7 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "ext-dom": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/guzzle": "^6.2.1", + "guzzlehttp/guzzle": "^7.0.1", "psr/log": "^1.0" }, "require-dev": { diff --git a/example/App.php b/example/App.php index 0c1220e..4635342 100644 --- a/example/App.php +++ b/example/App.php @@ -25,7 +25,7 @@ public function getSecretKey(): string public function getBaseUrl(): string { - return getenv('OTPSP_BASE_URL') ?: 'http://127.0.0.1:1234'; + return getenv('OTPSP_BASE_URL') ?: 'http://otpsp-client.test'; } public function twig() diff --git a/example/docroot/start-query.php b/example/docroot/start-query.php new file mode 100644 index 0000000..50dc3c6 --- /dev/null +++ b/example/docroot/start-query.php @@ -0,0 +1,46 @@ +setSecretKey($app->getSecretKey()); +$timeout = new DateInterval('PT5M'); + +$queryRequest = new QueryRequest(); +$queryRequest->merchant = $app->getMerchantId(); +//$queryRequest->orderRefs[] = 'my-order-id-2020-12-07-09-35-51'; +$queryRequest->salt = 'd471d2fb24c5a395563ff60f8ba769d1'; +$queryRequest->transactionIds[] = '500748082'; +//$queryRequest->salt = 'TV0ywJZVdf62p5nAJkldHWDzr2dLJRPe'; + +$startQueryResponse = $otpSimple->startQuery($queryRequest); + +// In a real application do not print anything, +// just redirect the client to $startPaymentResponse->paymentURL. +echo $app + ->twig() + ->render( + 'start-query.html.twig', + [ + 'queryRequest' => $queryRequest, + 'queryRequestJson' => $app->jsonEncode($queryRequest), + 'queryPaymentResponse' => $startQueryResponse, + 'startQueryResponseJson' => $app->jsonEncode($startQueryResponse), + 'logEntriesJson' => $app->jsonEncode($logger->records), + ] + ); diff --git a/example/templates/start-query.html.twig b/example/templates/start-query.html.twig new file mode 100644 index 0000000..90d5248 --- /dev/null +++ b/example/templates/start-query.html.twig @@ -0,0 +1,32 @@ + + +
+ + +{{ queryRequestJson }}
+ {{ startQueryResponseJson }}
+ {{ logEntriesJson }}
+