diff --git a/README.md b/README.md index 6d35e70..d68de8d 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,9 @@ Paymentwall_Base::setAppKey('YOUR_APPLICATION_KEY'); // available in your Paymen Paymentwall_Base::setSecretKey('YOUR_SECRET_KEY'); // available in your Paymentwall merchant area $pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']); if ($pingback->validate()) { + + // check if $pingback->getPingbackUniqueId() was already processed to avoid duplicate product delivery + $productId = $pingback->getProduct()->getId(); if ($pingback->isDeliverable()) { // deliver the product @@ -131,6 +134,9 @@ Paymentwall_Base::setAppKey('YOUR_APPLICATION_KEY'); // available in your Paymen Paymentwall_Base::setSecretKey('YOUR_SECRET_KEY'); // available in your Paymentwall merchant area $pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']); if ($pingback->validate()) { + + // check if $pingback->getPingbackUniqueId() was already processed to avoid duplicate product delivery + $virtualCurrency = $pingback->getVirtualCurrencyAmount(); if ($pingback->isDeliverable()) { // deliver the virtual currency @@ -204,6 +210,9 @@ Paymentwall_Base::setAppKey('YOUR_APPLICATION_KEY'); // available in your Paymen Paymentwall_Base::setSecretKey('YOUR_SECRET_KEY'); // available in your Paymentwall merchant area $pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']); if ($pingback->validate()) { + + // check if $pingback->getPingbackUniqueId() was already processed to avoid duplicate product delivery + $products = $pingback->getProducts(); if ($pingback->isDeliverable()) { // deliver products from the cart @@ -478,4 +487,4 @@ if (!empty($response['success'])) { var_dump($response['error']); var_dump($response['code']); } -``` \ No newline at end of file +```