Skip to content

Commit

Permalink
Merge pull request #3132 from catchpoint/state_fallback
Browse files Browse the repository at this point in the history
fallback on country if state is missing
  • Loading branch information
lbartoli79 authored Jan 8, 2025
2 parents 82ddbd4 + 5893964 commit c12af94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Handlers/AccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions www/src/CPGraphQlTypes/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']) &&
Expand Down

0 comments on commit c12af94

Please sign in to comment.