Impact
Merchants using GP-API HPP via Links cannot control the Billing/Shipping address match checkbox. Passing true to withAddressMatchIndicator() silently fails and results in "NO" being sent in the API payload. This is actively affecting live client integrations.
Root Cause
There is a conflicting data-type mutation between HPPBuilder.php and GpApiAuthorizationRequestBuilder.php.
HPPBuilder.php instantly mutates the injected boolean to a string:
$this->payer->addressMatchIndicator = StringUtils::boolToYesNo($indicator); (true becomes "YES")
- Later,
GpApiAuthorizationRequestBuilder.php expects the property to still be a boolean:
$requestData['payer']['address_match_indicator'] = is_bool($payer->addressMatchIndicator) ? StringUtils::boolToYesNo($payer->addressMatchIndicator) : "NO";
- Because the value was already mutated to the string
"YES" by the builder, is_bool("YES") evaluates to false, triggering the hardcoded fallback of "NO".
Steps to Reproduce
- Initialize
HPPBuilder in a PHP SDK 14.0.5 environment.
- Call
->withAddressMatchIndicator(true)
- Inspect the generated authorization request payload.
- Observe
address_match_indicator is incorrectly sent as "NO".
Suggested Fix
Either:
- Stop mutating the boolean in
HPPBuilder.php and let the request builder handle serialization at the boundary layer.
- Update the check in
GpApiAuthorizationRequestBuilder.php to handle string evaluations correctly.
Environment
- PHP SDK Version: 14.0.5
- Integration: GP-API HPP via Links
Reported by:
Rado Sheytanoff-Ruxton
Product Advocate at Global Payments Inc
Impact
Merchants using GP-API HPP via Links cannot control the Billing/Shipping address match checkbox. Passing
truetowithAddressMatchIndicator()silently fails and results in"NO"being sent in the API payload. This is actively affecting live client integrations.Root Cause
There is a conflicting data-type mutation between
HPPBuilder.phpandGpApiAuthorizationRequestBuilder.php.HPPBuilder.phpinstantly mutates the injected boolean to a string:$this->payer->addressMatchIndicator = StringUtils::boolToYesNo($indicator);(true becomes "YES")GpApiAuthorizationRequestBuilder.phpexpects the property to still be a boolean:$requestData['payer']['address_match_indicator'] = is_bool($payer->addressMatchIndicator) ? StringUtils::boolToYesNo($payer->addressMatchIndicator) : "NO";"YES"by the builder,is_bool("YES")evaluates tofalse, triggering the hardcoded fallback of"NO".Steps to Reproduce
HPPBuilderin a PHP SDK 14.0.5 environment.->withAddressMatchIndicator(true)address_match_indicatoris incorrectly sent as"NO".Suggested Fix
Either:
HPPBuilder.phpand let the request builder handle serialization at the boundary layer.GpApiAuthorizationRequestBuilder.phpto handle string evaluations correctly.Environment
Reported by:
Rado Sheytanoff-Ruxton
Product Advocate at Global Payments Inc