protected function getAddressData($type = 'Billing')
    {
        $card = $this->getCard();

        // Mapping is Sage Pay name => Omnipay Name

        $mapping = [
            'Firstnames'    => 'FirstName',
            'Surname'       => 'LastName',
            'Address1'      => 'Address1',
            'Address2'      => 'Address2',
            'City'          => 'City',
            'PostCode'      => 'Postcode',
            'State'         => 'State',
            'Country'       => 'Country',
            'Phone'         => 'Phone',
        ];

        $data = [];

        foreach ($mapping as $sagepayName => $omnipayName) {
            $data[$sagepayName] = call_user_func([$card, 'get' . $type . $omnipayName]);
        }

        // The state must not be set for non-US countries.

        if ($data['Country'] !== 'US') {
            $data['State'] = '';
        }

        return $data;
    }