src/Client.php
protected function waitForReceipt($receipt)
    {
        $stopAfter = $this->calculateReceiptWaitEnd();
        while (true) {
            if ($frame = $this->connection->readFrame()) {
                if ($frame->getCommand() == 'RECEIPT') {
                    if ($frame['receipt-id'] == $receipt) {
                        return true;
                    } else {
                        throw new UnexpectedResponseException($frame, sprintf('Expected receipt id %s', $receipt));
                    }
                } else {
                    $this->unprocessedFrames[] = $frame;
                }
            }
            if (microtime(true) >= $stopAfter) {
                break;
            }
        }
        throw new MissingReceiptException($receipt);
    }
protected function waitForReceipt($receipt)
    {
        $stopAfter = $this->calculateReceiptWaitEnd();
        while (true) {
            if ($frame = $this->connection->readFrame()) {
                if ($frame->getCommand() == 'RECEIPT') {
                    if ($frame['receipt-id'] == $receipt) {
                        return true;
                    } else {
                        throw new UnexpectedResponseException($frame, sprintf('Expected receipt id %s', $receipt));
                    }
                } else {
                    $this->unprocessedFrames[] = $frame;
                }
            }
            if (microtime(true) >= $stopAfter) {
                break;
            }
        }
        throw new MissingReceiptException($receipt);
    }
protected function waitForReceipt ( $ receipt ) { $ stopAfter = $ this -> calculateReceiptWaitEnd ( ) ; while ( true ) { if ( $ frame = $ this -> connection -> readFrame ( ) ) { if ( $ frame -> getCommand ( ) == 'RECEIPT' ) { if ( $ frame [ 'receipt-id' ] == $ receipt ) { return true ; } else { throw new UnexpectedResponseException ( $ frame , sprintf ( 'Expected receipt id %s' , $ receipt ) ) ; } } else { $ this -> unprocessedFrames [ ] = $ frame ; } } if ( microtime ( true ) >= $ stopAfter ) { break ; } } throw new MissingReceiptException ( $ receipt ) ; }
Wait for an receipt

@param string $receipt
@return boolean
@throws UnexpectedResponseException If response has an invalid receipt.
@throws MissingReceiptException     If no receipt is received.
Wait for an receipt