part1: define
part2: main
function getAccessToken
function getPurchaseStatus
function processPurchaseResult
function processTrans
function setLog