Skip to content

Commit c12af94

Browse files
authored
Merge pull request #3132 from catchpoint/state_fallback
fallback on country if state is missing
2 parents 82ddbd4 + 5893964 commit c12af94

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/Handlers/AccountTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,9 @@ public function testGetUpdatePaymentMethodAddressPage(): void
798798
'subscriptionPrice' => 10.00,
799799
'status' => 'ACTIVE',
800800
'wptPlanName' => '',
801-
'monthlyRuns' => 8
801+
'monthlyRuns' => 8,
802+
'creditCardBillingCountry' => 'US',
803+
'creditCardBillingState' => 'US'
802804
]);
803805
$wpt_api_key_list = new ApiKeyList();
804806
$paid_page_info = new PaidPageInfo($customer, $wpt_api_key_list);

www/src/CPGraphQlTypes/Customer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public function __construct(array $options)
7272
new DateTime($options['planRenewalDate']) : null;
7373
$this->next_wpt_plan_id = $options['nextWptPlanId'] ?? null;
7474
$this->address = null;
75+
76+
if (!isset($options['creditCardBillingState']) || strlen(trim($options['creditCardBillingState'])) == 0) {
77+
$options['creditCardBillingState'] = $options['creditCardBillingCountry'];
78+
}
79+
7580
if (
7681
isset($options['creditCardBillingCountry']) &&
7782
isset($options['creditCardBillingZip']) &&

0 commit comments

Comments
 (0)