Hi I wrote this simple collision detection and bouncing algorithm but the collision detects the y as if it was the x axis

bool Ball::DetectCollision(Paddle p)
{
if(GetPosition().y >= p.GetPosition().y + p.GetSize().y
|| GetPosition().y + GetSize().y <= p.GetPosition().y
|| GetPosition().x >= p.GetPosition().x + p.GetSize().x
|| GetPosition().x + GetSize().x <= p.GetPosition().x)
{
return false;
}
if(GetPosition().y <= p.GetPosition().y + p.GetSize().y )
{
Bounce(-1,1);
}
else if(GetPosition().y + GetSize().x >= p.GetPosition().y)
{
Bounce(-1,1);
}
else if(GetPosition().x + GetSize().x >= p.GetPosition().x )
{
Bounce(1,-1);
}
else if(GetPosition().x <= p.GetPosition().x + p.GetSize().x)
{
Bounce(1,-1);
}
return true;
}
void Ball::Bounce(int a, int b)
{
velocity = sf::Vector2f(velocity.x * a,velocity.y * b);
}
at first it seems to be working, the I found out that it only works in one axis (if the ball hits the paddle from it's bottom or top, it doesn't bounce properly and it bouces as if it hit the front surface of the paddle -> ^|)