diff --git a/samples/return.php b/samples/return.php
index f16892f6..8cf12254 100644
--- a/samples/return.php
+++ b/samples/return.php
@@ -20,12 +20,11 @@
require_once 'config.php';
try {
- $transaction = \Paynl\Transaction::getForReturn();
+ $transactionId = $_REQUEST['orderId'];
+ $transaction = \Paynl\Transaction::status($transactionId);
-
- if ($transaction->isPaid() ||
- $transaction->isPending() //manual transfer transactions are always pending when the user is returned
- ) {
+ # Manual transfer transactions are always pending when the user is returned
+ if ($transaction->isPaid() || $transaction->isPending()) {
// redirect to thank you page
echo "Thank you
New payment";
if ($transaction->isPaid()) {
@@ -41,4 +40,4 @@
}
} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
-}
+}
\ No newline at end of file