From 2c0d1f4edae72375cf70a56c4e8a220f0e641b86 Mon Sep 17 00:00:00 2001 From: David Funke Date: Tue, 23 Jul 2024 09:41:19 +0200 Subject: [PATCH] Added retry example --- .../Transaction/example-authorize-retry.php | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 example/Transaction/example-authorize-retry.php diff --git a/example/Transaction/example-authorize-retry.php b/example/Transaction/example-authorize-retry.php new file mode 100644 index 0000000..c7112fc --- /dev/null +++ b/example/Transaction/example-authorize-retry.php @@ -0,0 +1,67 @@ +setCondition() +// See Saferpay documentation for available options. + +// ----------------------------- +// Step 3: +// Execute and check for successful response + +try { + $response = $authorizeRequest->execute(); +} catch (SaferpayErrorException $e) { + die ($e->getErrorResponse()->getErrorMessage()); +} + +echo 'The transaction has been successful! Transaction id: ' . $response->getTransaction()->getId() . "\n"; + +// ----------------------------- +// Step 4: +// Capture the transaction to get the cash flowing. +// see: example-capture.php