bunq / sdk_php

PHP SDK for bunq API
MIT License
83 stars 54 forks source link

Valid IP address rejected #223

Open steffann opened 2 years ago

steffann commented 2 years ago

Steps to reproduce:

  1. Run:
    
    $environmentType = BunqEnumApiEnvironmentType::PRODUCTION();
    $apiKey = 'xxx';
    $deviceDescription = 'yyy';
    $permittedIps = ['185.54.92.3', '2a00:8642:1000:1::3'];

$apiContext = ApiContext::create( $environmentType, $apiKey, $deviceDescription, $permittedIps );


## What should happen:
1. This should succeed, as the addresses are the correct addresses for this device

## What happens:
1. We get this error message:
```php

PHP Fatal error:  Uncaught bunq\Exception\BunqException: Invalid ip address "2a00:8642:1000:1::3" in /var/www/xxx/bunq/vendor/bunq/sdk_php/src/Util/InstallationUtil.php:216

Traceback

Stack trace:

0 /var/www/xxx/bunq/vendor/bunq/sdk_php/src/Util/InstallationUtil.php(228): bunq\Util\InstallationUtil::assertIpIsValid()

1 /var/www/xxx/bunq/vendor/bunq/sdk_php/src/Context/ApiContext.php(113): bunq\Util\InstallationUtil::assertAllIpIsValid()

2 /var/www/xxx/bunq/context.php(15): bunq\Context\ApiContext::create()

3 {main}

thrown in /var/www/xxx/bunq/vendor/bunq/sdk_php/src/Util/InstallationUtil.php on line 216

SDK version and environment

Response id

Extra info: