# ウェブサイトの統合

NMKR Payは、あなたのウェブサイトにHTMLスニペットを追加することにより、任意のウェブサイトに統合することができます。

単一のトークン支払い以外に、顧客がドロップダウンから購入したいトークンの量を選択する[数量オプションを追加](https://docs.nmkr.io/nmkr-studio/set-up-sales/nmkr-pay/website-integration#pay-button-with-quantity-options)することもできます。

{% hint style="info" %}
NMKR Payは、HTMLのiframeタグに埋め込まれて動作しません。NMKR Payをiframeに埋め込むと、ブラウザの拡張機能と通信できなくなります。
{% endhint %}

<figure><img src="/files/maVFddx3P9pCk1nHvFa3" alt=""><figcaption></figcaption></figure>

#### 標準的な支払いボタンの統合

NMKR Payの統合については、プロジェクトの[価格リスト設定に](https://docs.nmkr.io/nmkr-studio/set-up-sales/manage-prices-pricelist)移動し、NMKR Payの統合タブに移動してください。

<figure><img src="/files/iH2TIajcOwpOMZZ4pQXj" alt=""><figcaption><p>NMKR Payの統合タブは、価格表のすぐ下にあります</p></figcaption></figure>

[価格を設定](https://docs.nmkr.io/nmkr-studio/set-up-sales/manage-prices-pricelist/create-new-prices)し、[ NMKR Payを](https://docs.nmkr.io/nmkr-studio/set-up-sales/nmkr-pay/set-up-nmkr-pay)設定した後、NMKR Payをウェブサイトに統合する準備が整いました。

**支払いボタンのデザインを設定する**

NMKR Payボタンには3種類のデザインと3種類の色があり、ドロップダウンで選択できます。選択に応じて、ボタンのリンクとリンクの下に表示されるHTMLスニペットも変わります

<figure><img src="/files/gs7yErQfVqBLC6tEFJRw" alt=""><figcaption></figcaption></figure>

**HTMLスニペットをコピー＆ペーストする**

「copy code to clipboard」（クリップボードにコードをコピー）をクリックし、あなたのウェブサイトにコードを貼り付けます。

<figure><img src="/files/u6DQDcPKmuZTtpaZqCpF" alt=""><figcaption></figcaption></figure>

ウェブサイトに埋め込む前にテストしたい場合は、[オンラインのHTMLツールで試してみてください](https://www.w3schools.com/html/tryit.asp?filename=tryhtml_default)。

以下は、HTMLスニペットの例で、これをコピーしてあなたのウェブサイトに直接貼り付けます。

```html
<img src="https://studio.nmkr.io/images/buttons/paybutton_1_1.svg" onclick="javascript:openPaymentWindow()">

<script type="text/javascript">
            function openPaymentWindow() {
                const paymentUrl = "https://pay.nmkr.io/?p=7e221683f55e48b9a1f9e2666c6551b7&c=1";

                // Specify the popup width and height
                const popupWidth = 500;
                const popupHeight = 700;

                // Calculate the center of the screen
                const left = window.top.outerWidth / 2 + window.top.screenX - ( popupWidth / 2);
                const top = window.top.outerHeight / 2 + window.top.screenY - ( popupHeight / 2);

                const popup =  window.open(paymentUrl, "NFT-MAKER PRO Payment Gateway",  `popup=1, location=1, width=${popupWidth}, height=${popupHeight}, left=${left}, top=${top}`);

                // Show dim background
                document.body.style = "background: rgba(0, 0, 0, 0.5)";

                // Continuously check whether the popup has been closed
                const backgroundCheck = setInterval(function () {
                    if(popup.closed) {
                        clearInterval(backgroundCheck);

                        console.log("Popup closed");

                        // Remove dim background
                        document.body.style = "";
                    }
                }, 1000);
            }
        </script>

```

### 数量オプション付きの支払いボタン

<figure><img src="/files/4DOwIZx1al5c4WEDNpdv" alt=""><figcaption></figcaption></figure>

NMKR Pay統合に数量オプションを統合するには、以下のコードを追加し、プロジェクトに必要な数量オプション(n)を追加するだけです。

```html
<p style="text-align:center;">  

<select id="NFT">
<option value="None">-- Select --</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
  
<br><br>
</script> </p> 
```

2つ目のステップは、NMKR StudioからコピーしたHTMLスニペットのリンク量のパラメータをc=1";からc="+NFT.valueに変更することです；

<figure><img src="/files/KXrYzwnGP10GPyzK8wwX" alt=""><figcaption><p>HTMLスニペットで支払いリンクの終了を設定する金額を変更する</p></figcaption></figure>

こんな感じになります：

```html
const paymentUrl = "https://payment.nmkr.io/?p=29e512...039&c="+NFT.value;
```

{% hint style="warning" %}
[価格リストで](https://docs.nmkr.io/nmkr-studio/set-up-sales/manage-prices-pricelist)事前に設定された価格と金額のペアのみが、数量オプションと連動します。
{% endhint %}

以下は、取引ごとに1～5NFTの数量オプションを使用したHTML統合の例です。

```html

<p style="text-align:center;">  

<select id="NFT">
<option value="None">-- Select --</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
 
<br><br>

</script> </p>

<img src="https://pro.nft-maker.io/images/buttons/paybutton_1_1.svg" onclick="javascript:openPaymentWindow()">

<script type="text/javascript">
            function openPaymentWindow() {
                const paymentUrl = "https://pay.nmkr.io/?p=cec3419ddf2c4c5ca9b3abdbc719ff29&c="+NFT.value;

                // Specify the popup width and height
                const popupWidth = 500;
                const popupHeight = 700;

                // Calculate the center of the screen
                const left = window.top.outerWidth / 2 + window.top.screenX - ( popupWidth / 2);
                const top = window.top.outerHeight / 2 + window.top.screenY - ( popupHeight / 2);

                const popup =  window.open(paymentUrl, "NFT-MAKER PRO Payment Gateway",  `popup=1, location=1, width=${popupWidth}, height=${popupHeight}, left=${left}, top=${top}`);

                // Show dim background
                document.body.style = "background: rgba(0, 0, 0, 0.5)";

                // Continuously check whether the popup has been closed
                const backgroundCheck = setInterval(function () {
                    if(popup.closed) {
                        clearInterval(backgroundCheck);

                        console.log("Popup closed");

                        // Remove dim background
                        document.body.style = "";
                    }
                }, 1000);
            }
        </script>
```

#### 支払いリンクに役立つパラメータ

支払いリンクの最後に\&pm=walletまたは\&pm=fiatパラメータを追加することで、ユーザーが使用したい支払い方法を選択するステップを省略することができます。<br>

\&pm=walletは直接Cardanoウォレット経由の支払いにつながります。<br>

\&pm=fiatが[有効であれば、フィアットの支払いオプションに](https://docs.nmkr.io/nmkr-studio/set-up-sales/nmkr-pay/fiat-eth-and-sol-payment)直接つながります。

**例：**

```
https://pay.nmkr.io/?p=c6392d1f60474xyz5a5ff48d56d3e&c=1&pm=wallet
```


---

# 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.nmkr.io/jp/nmkr-studio/fan-mai-she-ding/nmkr-pay/webusaitono.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.
