I have an ebooks selling website, where a user can download a book after he had made a purchase. I receive an IPN from Paypal and as far as I understand, sometimes the payment status comes as "In-Progress" or "Processing" if the user has chosen Credit Card as the payment method. Since Paypal then will resend the IPN when the payment is completed, what is the best way to check if the payment status is completed in order to avoid duplicates in your database?