Ruslan,
I have corrected your scripts somewhat and commented heavily in them.
You would run them in order, 1 then 2. Assuming that no PIN capture is done in 1. You will see when you open the zip.
This is as much as I am going to help, otherwise I would be writing the whole thing for you.
To all, I wrote this as an example of how to use Session in a set of scripts.
Steve