# Integration Guide for Web Desktop & Mobile Browser

* Step 1: Import tag \<meta> for responsive
* Step 2: Import tag \<script> with src: <https://uat-stc.galaxypay.vn/scripts/script-modal.js>
* Step 3: Create tag \<div> with id = galaxy-pay-sdk in your checkout page
* Step 4: Create callback function to receive payment result. See  [Result & IPN Callback](/upc/payment-gateway/api-specification/ipn-and-callback/result-and-ipn-callback.md) 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 [API checkout](/upc/payment-gateway/api-specification/payment/checkout-for-modal-checkout.md)).
  * callback: The function to receive payment result.
  * option: The payment option (JSON object)&#x20;

**Example:**&#x20;

```html
<!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>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.galaxypay.vn/upc/payment-gateway/payment-solution/modal-checkout/integration-guide-for-web-desktop-and-mobile-browser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
