Skip to content

Commit bb99dea

Browse files
Claudio BiselliClaudio Biselli
authored andcommitted
fallback on country if state is missing
1 parent 4e15ff7 commit bb99dea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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)