src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Samples/RefundResult.php
private function _waitUntilRefundProcessingIsCompleted($amazonRefundId)
    {
        // Check for the presence of the ipn notification
        $this->waitForNotificationToBeProcessedBeforeContinuing(
            $amazonRefundId,
            "RefundNotification"
        );
        // Notification is present, go and get the full
        // information for this notification
        $response = $this->callStepAndCheckForException(
            'getRefundDetails', array($amazonRefundId)
        );
        validateThatRefundIsCompleted($response->getGetRefundDetailsResult()->getRefundDetails());
        echo $this->printResponseToWebpage(
            "printGetRefundDetailsResponse",
            array($response)
        );
     
    }
private function _waitUntilRefundProcessingIsCompleted($amazonRefundId)
    {
        // Check for the presence of the ipn notification
        $this->waitForNotificationToBeProcessedBeforeContinuing(
            $amazonRefundId,
            "RefundNotification"
        );
        // Notification is present, go and get the full
        // information for this notification
        $response = $this->callStepAndCheckForException(
            'getRefundDetails', array($amazonRefundId)
        );
        validateThatRefundIsCompleted($response->getGetRefundDetailsResult()->getRefundDetails());
        echo $this->printResponseToWebpage(
            "printGetRefundDetailsResponse",
            array($response)
        );
     
    }
private function _waitUntilRefundProcessingIsCompleted ( $ amazonRefundId ) { // Check for the presence of the ipn notification $ this -> waitForNotificationToBeProcessedBeforeContinuing ( $ amazonRefundId , "RefundNotification" ) ; // Notification is present, go and get the full // information for this notification $ response = $ this -> callStepAndCheckForException ( 'getRefundDetails' , array ( $ amazonRefundId ) ) ; validateThatRefundIsCompleted ( $ response -> getGetRefundDetailsResult ( ) -> getRefundDetails ( ) ) ; echo $ this -> printResponseToWebpage ( "printGetRefundDetailsResponse" , array ( $ response ) ) ; }
Check that we have received an IPN notification for the refund

For PHP, there is an IPN handler that will write the contents of the IPN to
a file in the format of
<amazonReferenceId>_RefundNotification.txt
This method will check for the presence of this file
and will loop/timeout until the notification has been handled.

Merchants can use alternative approaches such as memory caches,
shared memory or database storage so that scripts serving user
pages are able to check on the status of a notification

@param string $amazonRefundId refund transaction to query

@return void
Check that we have received an IPN notification for the refund