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

iTunes baseUri manipulation for test purposes #181

Closed aliozkan closed 8 months ago

Stafox commented 8 months ago

Hi. What you trying to achieve with that change? Why you won't to use setEndpoint() method for that?

aliozkan commented 8 months ago

setEndpoint() is checking if endpoint is production or sandbox, otherwise it throws InvalidArgumentException:

public function setEndpoint(string $endpoint): self
    {
        if ($endpoint !== self::ENDPOINT_PRODUCTION && $endpoint !== self::ENDPOINT_SANDBOX) {
            throw new InvalidArgumentException("Invalid endpoint '{$endpoint}'");
        }
        $this->endpoint = $endpoint;

        return $this;
    }
Stafox commented 8 months ago

Correct. What endpoint you want to specify beside prod/sandbox?

aliozkan commented 8 months ago

Custom endpoint that simulates Apple /verifyReceipt endpoint. Returns success/error response based on receipt-data input. We can run integration tests with our specific receipt-data and get success/error response without any client involved.

Stafox commented 8 months ago

Available in 4.4.3