Romans 8:28: "And we know that for those who love God all things work together for good, for those who are called according to his purpose."
2 Peter 3:9: "The Lord is not slow to fulfill his promise as some count slowness, but is patient toward you, not wishing that any should perish, but that all should reach repentance."
Isaiah 38:17: "Behold, it was for my welfare that I had great bitterness; but in love you have delivered my life from the pit of destruction, for you have cast all my sins behind your back."
Jeremiah 29:11: "For I know the plans I have for you, declares the LORD, plans for welfare and not for evil, to give you a future and a hope."
+++
The text is public domain:
1 I leave all things to God's direction;He loves me both in joy and woe.His will is good, sure His affection;His tender love is true, I know.My fortress and my rock is He:What pleases God, that pleases me.2 God knows what must be done to save me;His love for me will never cease.Upon His hands He did engrave meWith purest gold of loving grace.His will supreme must ever be:What pleases God, that pleases me.3 My God desires the soul's salvation;My soul He, too, desires to save.Therefore with Christian resignationAll earthly troubles I will brave.His will be done eternally:What pleases God, that pleases me.4 My God has all things in His keeping;He is the ever faithful friend.He gives me laughter after weeping,And all His ways in blessings end.His love endures eternally:What pleases God, that pleases me.
+++
All of the cited passages inform the hymn in a general manner, but there are a couple instances where one specific text is more prominent. 2 Peter 3:9 appears in the line "My God desires the soul's salvation" at the beginning of the third verse (Ezekiel 18:32 and 33:11 could also be cited), and Romans 8:28 seems to appear in the line "And all His ways in blessings end" in the fourth verse.
The line "Upon His hands He did engrave me" in the second verse comes from Isaiah 49:16 ("Behold, I have engraved you on the palms of my hands; your walls are continually before me."), and the line "He gives me laughter after weeping" in the fourth verse seems to patterned on Psalm 30:11 ("You have turned for me my mourning into dancing; you have loosed my sackcloth and clothed me with gladness"). "His will be done eternally" in the third verse is taken from the Lord's Prayer ("your will be done" in Matthew 6:10).