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
  • Initialize PAYON's Library
  • Get Checkout Link
  • Get API's Signature
  • Arguments

Was this helpful?

  1. PayOn Library

How to use PayOn Library

Sign is a digital signature for verifying the authenticity of digital messages or documents. Only a valid API's sign can be interact with PAYON's server.

Initialize PAYON's Library

import com.payon.pg.aggregator.ecommerce.gateway.client.CheckoutURIBuilder;
import com.payon.pg.aggregator.ecommerce.gateway.client.CheckoutURIBuilder.Environment;

public class OrderController {

    public static void main(String[] args) throws IOException, InterruptedException {

	CheckoutURIBuilder checkoutURIBuilder = CheckoutURIBuilder.builder()
						.env(Environment.UAT)// UAT:for TEST,PRODUCTION: production
						.apiKey(YOUR API KEY)
						.merchantId(YOUR MERCHANT ID)
						.termId(YOUR TERMINAL ID)
						.txId(YOUR TRANSACTION ID)
						.amount(YOUR CHECK OUT AMOUNT)
						.currency(YOUR CURRENCY)
						.build();
    }
}

<?php
	require_once('CheckoutURIBuilder.php');
	$lang        = "en";
	$merchantId  = "YOUR MERCHANT ID";
	$termId      = "YOUR TERM ID";
	$amount      = "YOUR CHECK OUT AMOUNT";
	$txId        = "YOUR TRANSACTION ID";
	$currency    = "YOUR CURRENCY";
	$apiKey        = "YOUR API KEY";
	$checkoutURIBuilder = new CheckoutURIBuilder($lang, $merchantId, $termId, $txId, $amount, $currency, $redirectUri, $apiKey);
	$env = new Environment();
	// get test url function $env::getTestUrl() and get real url function $env::getRealUrl()
	$url = $checkoutURIBuilder::toCheckoutUrlString($env::getTestUrl());
	echo "<a href='".$url."'>Click to Pay</a><br/>";
	
?>
	

Get Checkout Link

String checkoutURI = checkoutURIBuilder.toCheckoutUrlString()
 <?php
     $checkoutURI = $checkoutURIBuilder::toCheckoutUrlString();
 ?>

Get API's Signature

String sign = checkoutURIBuilder.getSign()

 <?php
     $checkoutURI = $checkoutURIBuilder::getSign();
 ?>

Arguments

env

environment mode(TEST,PRODUCTION)

apiKey

Merchant's API key, will provided after merchant registration.

termId

Merchant's terminal identification

merchantId

Merchant's identification

amount

Total amount

Currency

Currency code (KHR, USD)

PreviousPayOn LibraryNextHow to encrypt data with RSA

Last updated 2 years ago

Was this helpful?