Dim basicAuth As String
basicAuth = $"${Main.PUBLIC_KEY}:${Main.PRIVATE_KEY}"$
Dim job As HttpJob
job.Initialize("",Me)
job.PostString("https://apify.epayco.co/login?",$""$)
job.GetRequest.SetHeader("Authorization", $"Basic ${su.EncodeBase64(basicAuth.GetBytes("UTF8"))}:"$)
job.GetRequest.SetContentType("application/json")
Wait For (job) JobDone(job As HttpJob)
Log("Result Token: " & job.Success)
If job.Success Then
Log(job.GetString)
Dim parser As JSONParser
parser.Initialize(job.GetString)
Dim RootMap As Map = parser.NextObject
Dim token As String = RootMap.Get("token")
Main.TokenJWT = token
Else
Log(job.ErrorMessage)
End If
job.Release