App\Ninja\PaymentDrivers\BasePaymentDriver::paymentDetailsFromInput PHP Method

paymentDetailsFromInput() private method

private paymentDetailsFromInput ( $input )
    private function paymentDetailsFromInput($input)
    {
        $invoice = $this->invoice();
        $client = $this->client();
        $data = ['company' => $client->getDisplayName(), 'firstName' => isset($input['first_name']) ? $input['first_name'] : null, 'lastName' => isset($input['last_name']) ? $input['last_name'] : null, 'email' => isset($input['email']) ? $input['email'] : null, 'number' => isset($input['card_number']) ? $input['card_number'] : null, 'expiryMonth' => isset($input['expiration_month']) ? $input['expiration_month'] : null, 'expiryYear' => isset($input['expiration_year']) ? $input['expiration_year'] : null];
        // allow space until there's a setting to disable
        if (isset($input['cvv']) && $input['cvv'] != ' ') {
            $data['cvv'] = $input['cvv'];
        }
        if (isset($input['address1'])) {
            // TODO use cache instead
            $country = Country::find($input['country_id']);
            $data = array_merge($data, ['billingAddress1' => $input['address1'], 'billingAddress2' => $input['address2'], 'billingCity' => $input['city'], 'billingState' => $input['state'], 'billingPostcode' => $input['postal_code'], 'billingCountry' => $country->iso_3166_2, 'shippingAddress1' => $input['address1'], 'shippingAddress2' => $input['address2'], 'shippingCity' => $input['city'], 'shippingState' => $input['state'], 'shippingPostcode' => $input['postal_code'], 'shippingCountry' => $country->iso_3166_2]);
        }
        return $data;
    }