
var clearentBaseUrl = $('#PaymentUrl').val().match(/^https:\/\/[^/]+/)[0];
var publictoken = $('#PublicToken').val();
ClearentSDK.reset();
    ClearentSDK.init({
        "baseUrl": clearentBaseUrl,
        "pk": publictoken
    });
async function MYToken() {
    await TokenGenration();
    console.log("After")
    return true;
}
TokenGenration = async () => {
    var result = Promise.resolve(await ClearentSDK.getPaymentToken());
    await result.then(
        (result) => {
            var tokenvalue = result.payload['mobile-jwt'].jwt;
            if (tokenvalue != null && tokenvalue != "" && tokenvalue != "{}") {
                document.getElementById('token').value = tokenvalue;
            }
        },
        (error) => {
            var Error = "SomeThings Worng";
        });
}
const GetToken = () => {
    var value = document.getElementById('token').value;
    return value;

}