People used to do this all the time in thanksgiving to God for answered prayer. King Richard the Lionheart offered a tremendous sum to a church for God saving him during a terrible storm. As long as you understand that God cannot be bribed, bargained with, or coerced; and that you use your gift for alms giving in grateful thanks, then I wouldn’t see what was wrong with the gesture. Thanks be to God for your answered prayer!