aporat / store-receipt-validator

PHP receipt validator for Apple iTunes, Google Play and Amazon App Store
Apache License 2.0
633 stars 153 forks source link

Endpoint check #138

Closed pwellingelastique closed 3 years ago

pwellingelastique commented 3 years ago

I just began implementing this in a project. To have all testable (my own code), I decided to inject the Itunes\Validator by dependency injection (I am doing a Symfony project). I just noticed that there is a small issue in setting the endpoint.

In the contruct there is a check if the endpoint is a valid one (or production, or sandbox). In the set endpoint-method this check is missing. Obviously this is not a problem for me, but it is not logic.

It would be better to move the check to the sentEndpoint method, then call this method in the construct (preventing duplicate code obviously).

As said, not a big issue that I can work around/live with

Stafox commented 3 years ago

Thanks. Feel free to make a pull request.

pwellingelastique commented 3 years ago

Will do!

Stafox commented 3 years ago

142 merged. Thanks.