Not a simple code available. :-)
Here’s how I’d build it:
Money Button has a feature called Webhook. It basically sends payment information to an external URL (such as your website address, like: mywebsite.com/webhook) when a payment is made.
If you verify and save the data that Webhook “ping” sends you, you can keep track of how much money has arrived.
The simplest way to do that is to create a plain text file on your website. That file would contain just a number, that is: the amount of funds that has arrived.
That number could then be updated each time a valid Webhook “ping” has arrived. You could then read the contents of that text file, and compare if it’s smaller than, equal to, or greater than the funding goal.