INTRODUCTION

  • KessChat mini-app are “webview-applications” within the KessChat App.
  • We allow to build the E-commerce website and Developers can easily to integrate the payment with KessChat.

PROCESS DIAGRAM

alt

+ CDN: https://kess-cdn-prod.sgp1.digitaloceanspaces.com/mini-app/kesschatbridge.1.0.min.js

alt

SECURITY USER DATA

  • Webview will be inject kess-mini-app param to your URL :
    • kess-mini-app : The value of this param return with RSA2 encrypted code if you want to decrypt you need to request private key from us.
    • When you decrypted success you will get a JSON String:‘{"kess_id":456789acbdfghijk}’
    • kess_id : unique id for each user
< ?php
class My_Class {
public function rsaDecrypt($content, $key_path)
{
$rsa = new RSA();
$ciphertextdecode = base64_decode($content);
$key_content = $this-> fileGetContents($key_path);
$rsa->setEncryptionMode(RSA::ENCRYPTION_PKCS1);

rsa->setSignatureMode(RSA::SIGNATURE_PKCS1);
$result = $rsa->decrypt($ciphertextdecode);
return $result;
}

public function fileGetContents($filename)
{
$lines = '';
$handle = fopen($filename, "r");
$handle = fopen($filename, "r");{
$lines .= fgets($handle);
}
fclose($handle);
return $lines;
}
To decrypt:

$myCLass = new My_Class(); $privateKeyPath = 'path/private.key'; $decrypted = $myCLass -> rsaDecrypt($_GET(“kess-mini-app'”), $privateKeyPath);

if($decrypted){
echo decrypted;
}else{
echo “Failed Decrypt”;
}