PAYON Payment Gateway
  • Table of Contents
  • Revision History
  • How is Work
    • PAYON PG PAYMENT
      • PAYON's Wallet Payment via PAYON Mobile App
      • PAYON Payment via PAYON's Card
      • CREDIT/DEBIT Online Payment
      • PPCBank Mobile Pay via PPCBank Mobile App(Coming Soon)
      • KHQR Online Payment
      • Binding Payment via PAYON's Card
      • Binding Payment via Credit/Debit's Card
  • PayOn PG Overview
    • Desktop Views
      • PAYON Payment Method
        • PAYON Card Payment
        • PAYON QR Payment
      • Credit/Debit Payment
      • KHQR Payment
      • PPCBank Payment
    • Mobile Views
      • PAYON Payment Method
      • Credit/Debit Payment Method
      • KHQR Payment
        • Bakong APP
        • PPCBank App
        • Other Bank App
      • PPCBank Payment
    • Obtain your API Keys
    • Platform Application Settings
  • Work flows
    • Payment Request Workflow
    • Page Redirection Workflow
  • Getting Started
    • Generate Checkout Link
    • Try redirect to Checkout Link
    • Test your payment
    • Add Card(Create Binding)
  • PAYON API Reference
    • Payment Order Registration
    • Cancellation Payment
    • Pre Auth Completion Payment
    • Refunds Payment
    • Transaction Orders History
    • Get Transaction Status
    • Push Back Notification
    • Create Binding
    • Get Binding List
    • Create Binding PIN
    • Enable / Disable PIN
    • Merchant Reconciliation
  • TEST Cards and Accounts
    • Test Card&Account
  • PAYON Library
  • PayOn Library
    • How to use PayOn Library
    • How to encrypt data with RSA
  • PAYON APPS
    • Environments
  • 3RD PARTY APPS
    • PPCBANK Environment
    • Bakong Environment
Powered by GitBook
On this page
  • Init required library to you page
  • Prepare your JavaScript

Was this helpful?

  1. PayOn Library

How to encrypt data with RSA

Init required library to you page

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
      <script th:src="@{https://pg.payon.com.kh/PGV2/static/js/jquery-3.4.1.min.js}" charset="utf-8" type="text/javascript"></script>
      <script th:src="@{https://pg.payon.com.kh/PGV2/static/js/jsencrypt.min.js}" charset="utf-8" type="text/javascript"></script>
      <script th:src="@{https://pg.payon.com.kh/PGV2/static/js/crypto-js.min.js}" charset="utf-8" type="text/javascript"></script>
 <head> 
 
 </html>   

Prepare your JavaScript

   let encrypt = new JSEncrypt({
        default_key_size: 2048
    })
    
    //YOUR PUBLIC KEY 
    var publicKey = $('#pubKey').val();
    
    var data = "TO BE ENCRYPTED DATA"
    
    encrypt.setPublicKey(publicKey);
    
    var _encryptedData = encrypt.encrypt(data);
    

PreviousHow to use PayOn LibraryNextEnvironments

Last updated 3 years ago

Was this helpful?