You can use Borderless style in AppCompatButton like below. and use android:background with it.
style="@style/Widget.AppCompat.Button.Borderless.Colored"
Button code
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/button_visa_next"
android:background="@color/colorPrimary"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_normal"
android:text="@string/next"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
Output: