Details
Description
The current default for imported cc details are problematic. For example, the default for "first_name" is null, but that is an invalid value.
In import_manager/components/migrators/whmcs/8.0/whmcs8_0.php change the code starting at line 600 from
// Save card $card = [ 'contact_id' => $this->mappings['primary_contacts'][$credit_card->client_id], 'first_name' => $credit_card->{$mapping['accounts_cc']['first_name']} ?: null, 'last_name' => $credit_card->{$mapping['accounts_cc']['last_name']} ?: null, 'address1' => $credit_card->{$mapping['accounts_cc']['address1']} ?: null, 'address2' => $credit_card->{$mapping['accounts_cc']['address2']} ?: null, 'state' => !empty($credit_card->{$mapping['accounts_cc']['state']}) ? substr($credit_card->{$mapping['accounts_cc']['state']}, 0, 2) : 'XX', 'city' => $credit_card->{$mapping['accounts_cc']['city']} ?: null, 'zip' => $credit_card->{$mapping['accounts_cc']['zip']} ?: '00000', 'country' => $credit_card->{$mapping['accounts_cc']['country']} ?: null, 'number' => isset($credit_card->{$mapping['accounts_cc']['number']}) ? $this->GatewayManager->systemEncrypt( $credit_card->{$mapping['accounts_cc']['number']} ) : null, 'expiration' => isset($credit_card->{$mapping['accounts_cc']['expiration']}) ? $this->GatewayManager->systemEncrypt( date('Ym', strtotime($credit_card->{$mapping['accounts_cc']['expiration']})) ) : null, 'last4' => isset($credit_card->{$mapping['accounts_cc']['last4']}) ? $this->GatewayManager->systemEncrypt( $credit_card->{$mapping['accounts_cc']['last4']} ) : null, 'type' => isset($credit_card->{$mapping['accounts_cc']['type']}) ? $this->getCreditCardType($credit_card->{$mapping['accounts_cc']['type']}) : 'other', 'gateway_id' => $gateway_id, 'client_reference_id' => $credit_card->{$mapping['accounts_cc']['client_reference_id']} ?: null, 'reference_id' => $credit_card->{$mapping['accounts_cc']['reference_id']} ?: null, 'status' => 'active' ];
To
// Save card $card = [ 'contact_id' => $this->mappings['primary_contacts'][$credit_card->client_id], 'first_name' => $credit_card->{$mapping['accounts_cc']['first_name']} ?? $this->default_firstname, 'last_name' => $credit_card->{$mapping['accounts_cc']['last_name']} ?? $this->default_lastname, 'address1' => $credit_card->{$mapping['accounts_cc']['address1']} ?? '', 'address2' => $credit_card->{$mapping['accounts_cc']['address2']} ?? null, 'state' => !empty($credit_card->{$mapping['accounts_cc']['state']}) ? substr($credit_card->{$mapping['accounts_cc']['state']}, 0, 2) : 'XX', 'city' => $credit_card->{$mapping['accounts_cc']['city']} ?? '', 'zip' => $credit_card->{$mapping['accounts_cc']['zip']} ?? '00000', 'country' => $credit_card->{$mapping['accounts_cc']['country']} ?? $this->default_country, 'number' => isset($credit_card->{$mapping['accounts_cc']['number']}) ? $this->GatewayManager->systemEncrypt( $credit_card->{$mapping['accounts_cc']['number']} ) : null, 'expiration' => isset($credit_card->{$mapping['accounts_cc']['expiration']}) ? $this->GatewayManager->systemEncrypt( date('Ym', strtotime($credit_card->{$mapping['accounts_cc']['expiration']})) ) : null, 'last4' => isset($credit_card->{$mapping['accounts_cc']['last4']}) ? $this->GatewayManager->systemEncrypt( $credit_card->{$mapping['accounts_cc']['last4']} ) : null, 'type' => isset($credit_card->{$mapping['accounts_cc']['type']}) ? $this->getCreditCardType($credit_card->{$mapping['accounts_cc']['type']}) : 'other', 'gateway_id' => $gateway_id, 'client_reference_id' => $credit_card->{$mapping['accounts_cc']['client_reference_id']} ?? null, 'reference_id' => $credit_card->{$mapping['accounts_cc']['reference_id']} ?? null, 'status' => 'active' ];
Activity
Jonathan Reissmueller
created issue -
Jonathan Reissmueller
made changes -
Field | Original Value | New Value |
---|---|---|
Rank | Ranked higher |
Jonathan Reissmueller
made changes -
Sprint | 5.2.0 Sprint 3 [ 140 ] |
Jonathan Reissmueller
made changes -
Rank | Ranked lower |
Jonathan Reissmueller
made changes -
Rank | Ranked higher |
Abdy Franco
made changes -
Assignee | Abdy Franco [ abdy ] |
Abdy Franco
made changes -
Status | Open [ 1 ] | In Progress [ 3 ] |
Abdy Franco
made changes -
Remaining Estimate | 0 minutes [ 0 ] | |
Time Spent | 45 minutes [ 2700 ] | |
Worklog Id | 15207 [ 15207 ] |
Abdy Franco
made changes -
Status | In Progress [ 3 ] | In Review [ 5 ] |
Resolution | Fixed [ 1 ] |
Jonathan Reissmueller
made changes -
Fix Version/s | 5.1.3 [ 11716 ] | |
Original Estimate | 0 minutes [ 0 ] |
Jonathan Reissmueller
made changes -
Rank | Ranked higher |
Jonathan Reissmueller
made changes -
Status | In Review [ 5 ] | Closed [ 6 ] |