diff --git a/tests/Handlers/AccountTest.php b/tests/Handlers/AccountTest.php index 724b3a3a9a..a69639795b 100644 --- a/tests/Handlers/AccountTest.php +++ b/tests/Handlers/AccountTest.php @@ -798,7 +798,9 @@ public function testGetUpdatePaymentMethodAddressPage(): void 'subscriptionPrice' => 10.00, 'status' => 'ACTIVE', 'wptPlanName' => '', - 'monthlyRuns' => 8 + 'monthlyRuns' => 8, + 'creditCardBillingCountry' => 'US', + 'creditCardBillingState' => 'US' ]); $wpt_api_key_list = new ApiKeyList(); $paid_page_info = new PaidPageInfo($customer, $wpt_api_key_list); diff --git a/www/src/CPGraphQlTypes/Customer.php b/www/src/CPGraphQlTypes/Customer.php index c9709a3431..e105773b33 100644 --- a/www/src/CPGraphQlTypes/Customer.php +++ b/www/src/CPGraphQlTypes/Customer.php @@ -72,6 +72,11 @@ public function __construct(array $options) new DateTime($options['planRenewalDate']) : null; $this->next_wpt_plan_id = $options['nextWptPlanId'] ?? null; $this->address = null; + + if (!isset($options['creditCardBillingState']) || strlen(trim($options['creditCardBillingState'])) == 0) { + $options['creditCardBillingState'] = $options['creditCardBillingCountry']; + } + if ( isset($options['creditCardBillingCountry']) && isset($options['creditCardBillingZip']) &&