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
  • PAYON
  • Simple Redirect URL Implementation

Was this helpful?

  1. Work flows

Page Redirection Workflow

PreviousPayment Request WorkflowNextGenerate Checkout Link

Last updated 4 years ago

Was this helpful?

PAYON

Simple Redirect URL Implementation

public class MyController {

	@Autowired
	private RestOperations restTemplate;
	
	@RequestMapping(value="/order/complete",params={"txId"})
	public Mono<String> getOrderComplete(Model model, @RequestParam("txId") String txId) {
    
    //STEP01:Get Transaction Status endpoint
		String url = "https://pg.payon.com.kh:35505/pg/transaction/status";
		
		//STEP02: Init payment status request
		JSONObject paymentStatusReq = new JSONObject();
    paymentStatusReq.put("txId", txId);
    paymentStatusReq.put("merchantId", "YOUR MERCHANT ID");
    paymentStatusReq.put("termId", "YOUR TERM ID");
 
		//STEP03: Request to PAYON's PG server to get order's status
		MyPaymentResultModel paymentResult = restTemplate.postForObject(url, paymentStatusReq, String.class);
		
		//STEP04: Mappe payment result to model
		model.addAttribute("paymentResult", paymentResult);

		//STEP05: Render to the view and mapping with payment result
		return Mono.just("YOUR VIEW NAME");
	}
	
}

28KB
Redirection PAYON Payment Flow.pdf
pdf
PAYON_Page_Redirection_Workflow
Figure 01: PAYON Page Redirection