Skip to content

Avoid undefined array key warnings when parsing HPP responses without uppercase keys#142

Open
SAY-5 wants to merge 1 commit into
globalpayments:masterfrom
SAY-5:fix-hosted-parse-response-undefined-keys
Open

Avoid undefined array key warnings when parsing HPP responses without uppercase keys#142
SAY-5 wants to merge 1 commit into
globalpayments:masterfrom
SAY-5:fix-hosted-parse-response-undefined-keys

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 18, 2026

Copy link
Copy Markdown

Fixes #139. HostedService::parseResponse() reads TIMESTAMP, MERCHANT_ID, ORDER_ID, RESULT, MESSAGE and PASREF with bare array access, so on PHP 8+ a response that does not contain those uppercase keys (for example a lightbox HPP response that only goes through the non-fundsstatus branch) emits one "Undefined array key" warning per field before the hash is even checked. This guards those reads with ?? "", matching the AUTHCODE/PAYMENTMETHOD lines just below them, and adds a parseResponse test that fails with the old code and passes with the guard.

… uppercase keys

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Undefined array keys in Services/HostedService.php parseResponse() - version 14.0.4

1 participant