diff --git a/README.md b/README.md index debf755..f6faeb6 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ try { } } catch (RonMelkhior\CoinpaymentsIPN\Exceptions\InvalidRequestException $e) { // The IPN data was not valid to begin with (missing data, invalid IPN method). -} catch (RonMelkhior\CoinpaymentsIPN\Exceptions\InvalidDataException $e) { +} catch (RonMelkhior\CoinpaymentsIPN\Exceptions\InsufficientDataException $e) { // Sufficient data provided, but either the merchant ID or the IPN secret didn't match. } catch (RonMelkhior\CoinpaymentsIPN\Exceptions\FailedPaymentException $e) { // IPN worked, but the payment has failed (PayPal refund/cancelled/timed out). diff --git a/src/RonMelkhior/CoinpaymentsIPN/IPN.php b/src/RonMelkhior/CoinpaymentsIPN/IPN.php index c7ef155..1550956 100644 --- a/src/RonMelkhior/CoinpaymentsIPN/IPN.php +++ b/src/RonMelkhior/CoinpaymentsIPN/IPN.php @@ -4,7 +4,7 @@ use RonMelkhior\CoinpaymentsIPN\Initialize; use RonMelkhior\CoinpaymentsIPN\Exceptions\InvalidRequestException; -use RonMelkhior\CoinpaymentsIPN\Exceptions\InvalidDataException; +use RonMelkhior\CoinpaymentsIPN\Exceptions\InsufficientDataException; use RonMelkhior\CoinpaymentsIPN\Exceptions\FailedPaymentException; class IPN @@ -29,11 +29,11 @@ public function validate(array $post_data, array $server_data) } if ($server_data['PHP_AUTH_USER'] !== $this->merchant_id) { - throw new InvalidDataException("Invalid merchant ID provided."); + throw new InsufficientDataException("Invalid merchant ID provided."); } if ($server_data['PHP_AUTH_PW'] !== $this->ipn_secret) { - throw new InvalidDataException("Invalid IPN secret provided."); + throw new InsufficientDataException("Invalid IPN secret provided."); } $order_status = $post_data['status'];