protected function getStatus($response)
    {
        if (isset($response['refunded']) && $response['refunded'] == true) {
            return new Status('refunded');
        }

        if (!isset($response['status']) && !isset($response['type'])) {
            return;
        }

        $status = isset($response['status']) ? $response['status'] : $response['type'];

        switch ($status) {
            case 'pending':
            case 'charge.pending':
                return new Status('pending');
            case 'success':
            case 'charge.success':
                return new Status('paid');
            case 'declined':
            case 'charge.declined':
                return new Status('failed');
            case 'deleted':
            case 'charge.deleted':
                return new Status('canceled');
            case 'expired':
            case 'charge.expired':
                return new Status('voided');
                break;
        }
    }