Single Variable Payment Option

Hello! I am looking for some help setting up a single variable payment button. I am trying to put an API to use the pay now button to allow the customer to key in any amount. I have only managed to make it do static payments. If anyone has any methods to do this or any tother work arounds that result in the same outcome I would really appreciate the help. I am new to the coding world. (I do understand security and front end and back end placement.)