I understand this is for a good cause, but isn't this just stealing money from Amazon? You are exploiting a program that is designed to encourage additional sales, not give money away from any random Amazon transaction.
But, as someone who's looked into the legality of this (I was building something very similar, but with a narrower charity set than the OP's), it is against their terms of service.