Hi, talking about the HTML standard payment buttons then you could proceed like this:
- to leave a varaible amount do not pass the variable "amount". The checkout will then ask to the payer to fill-in the amount, or if you calculate the amount in your application/code then just pass the value to the variable "amount"
- to load a callback URL after the payment you can use the auto-return functionality, in order to enable Auto return and set the related URL follow the steps below:
- Login in your PayPal account (Live or Sandbox) - Go to "Profile" - "Profile & Settings" - Click "My Selling Preferences" - Click on "Website preferences" -> Update - Set "Auto Return: On" - Insert a Return URL including "http://" or "https://" - Click Save at the end of the page
Or alternatively, only after you already logged-in into your PayPal account, click this direct link: auto-return-page