GALAXY PAY - API Reference Guide
  • Payment Gateway
    • Payment solution
      • General integration steps
      • Modal checkout
        • Integration Guide for Web Desktop & Mobile Browser
      • Merchant checkout
      • Merchant Hosted Checkout
      • Pay with option
      • Pay with token
      • Fast pay
      • Pay with QR
      • Pay with E-Wallet
    • Demo
    • API Specification
      • Integration Keys
      • Definitions
        • Message Structure
        • Signature Algorithm
      • Data Flight
      • PAYMENT
        • Pay
        • Pay with create token
        • Pay with token
        • Pay with Option
        • Pay with QR
        • Checkout(for modal checkout)
        • Payment Link
        • Fast pay
      • TOKENIZATION
        • Merchants
          • Delete Token
        • Customers
          • Query Tokens
          • Remove Token
      • MANAGEMENT
        • Query Transaction
        • Refund Transaction
        • Void Transaction
        • Capture Transaction
      • IPN & CALLBACK
        • Result & IPN Callback
        • Cancel Callback
    • Appendix
      • Response Codes
      • Currencies
      • Domestic Banks
      • International Card Brands
      • eWallets
      • Payment Hubs
        • Apple Pay Validation
      • QR Payment Providers
      • Buy Now Pay Later
      • Test Information
      • Glossary
  • Payment Link
    • IPN callback
  • Archive
    • QR Payment (Old version)
      • API create QR
      • API query status
      • How to test
    • API create PaymentLink
Powered by GitBook
On this page
  1. Payment Gateway
  2. Payment solution
  3. Modal checkout

Integration Guide for Web Desktop & Mobile Browser

PreviousModal checkoutNextMerchant checkout

Last updated 7 months ago

  • Step 1: Import tag <meta> for responsive

  • Step 2: Import tag <script> with src:

  • Step 3: Create tag <div> with id = galaxy-pay-sdk in your checkout page

  • Step 4: Create callback function to receive payment result. See for detail.

  • Step 5: Create callback function to close modal chekout.

  • Step 6: Call function galaxyPaySubmitPayment(endpoint, callback, option)

    • endpoint: Receive from API Checkout (see ).

    • callback: The function to receive payment result.

    • option: The payment option (JSON object)

Example:

<!DOCTYPE html>
<html>
  <!-- Responsive Support -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- Import JS SDK -->
  <!-- version = Current Date with format YYYYMMDD -->
  <script src="https://uat-stc.galaxypay.vn/checkout/vietjet/script-modal.js?version=20230710"></script>
  <body>
    <button onclick="onPayment()">Payment</button>
    <!-- IFrame Container -->
    <div id="galaxy-pay-sdk"></div>
  </body>
</html>

<script>
  // Callback Function
  function callbackPaymentResult(resultData) {
    console.log(resultData);
  }

  // Callback Function close modal
  function callbackOnCloseModal() {
    console.log("====== close modal ======");
  }
  
  // Invoke Payment Function 
  function onPayment(){
    let endpoint = "https://uat-paymentv2.galaxypay.vn/checkout/2308145315460205670148885/20230814110027/2b72e3e8d594148cb4e22c987859bcd0660df7d5ce89638887dc274751557ed6";   // endpoint that is received from API checkout
    let option = {
        language: "en" // vi or en
    };

    // Call payment function from SDK
    galaxyPaySubmitPayment(endpoint, callbackPaymentResult, callbackOnCloseModal, option);
  }
</script>
https://uat-stc.galaxypay.vn/scripts/script-modal.js
Result & IPN Callback
API checkout