In both 8.x-2.x and 3.x versions it's called createPayment not createPaymentMethod.
createPayment
createPaymentMethod