Invalid SOAP-Credentials throws loadXML error
zirnipa opened this issue · 6 comments
If wrong soap credentials are used, following error message appears:
Warning: DOMDocument::loadXML(): Space required after the Public Identifier in Entity, line: 1 in [...]/phpsdk/src/Responses/AbstractResponse.php on line 60 Warning: DOMDocument::loadXML(): SystemLiteral " or ' expected in Entity, line: 1 in [...]/phpsdk/src/Responses/AbstractResponse.php on line 60 Warning: DOMDocument::loadXML(): SYSTEM or PUBLIC, the URI is missing in Entity, line: 1 in[...]/phpsdk/src/Responses/AbstractResponse.php on line 60
We should present a better error message.
e.g.:
Unauthorized
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
Can you provide a example of the credentials that you used to produce this exception?
config.php:
define('MPAY24_MERCHANT_ID', '92883');
define('MPAY24_SOAP_PASS', '');
define('MPAY24_TEST_SYSTEM', true);
And then calling the seamless example.
If also no MERCHANT_ID is entered, I get:
Fatal error: Uncaught Exception in [...]/phpsdk/src/Mpay24Config.php:179 Stack trace: #0 /[...]/phpsdk/src/Mpay24Config.php(141): Mpay24\Mpay24Config->setMerchantID('') #1 [...]/phpsdk/src/Mpay24.php(33): Mpay24\Mpay24Config->__construct(Array) #2 [...]/phpsdk/examples/seamless.php(6): Mpay24\Mpay24->__construct() #3 {main} thrown in [..]/phpsdk/src/Mpay24Config.php on line 179
Ok, I checked it myself.
Here we have two issues
-
The Warning is a PHP Warning:
Warning can suppress if the php ini is set correct.
But I can suppress the warning for this single use case if required -
The Exception is intentional:
If someone uses the mPay24-php SDK a correct merchant-id is required, otherwise a Exception is thrown.
There is only one point: there should be a more descriptive message on a test system.