Payment from variable amount

Thank you for your reply, I have tried moving the import to the top and inserting the onready function. It then says I need the export at the top too! So also tried that without luck. It states the “charge” isn’t defined This charge comes from button9 and inserted into group2. Button19 is the tester button to trigger of payment.