NMKR Pay can be integrated to any website by adding a HTML snippet to your website.
Besides the single Token payment, you can also add quantity options where your customer selects the amount of tokens he want to buy from the dropdown.
NMKR Pay won't work embedded in a HTML iframe tag. If you embed NMKR Pay in an iframe it won't be able to communicate with your browser extensions.
Standard Pay button integration
For the NMKR Pay integration, please go to the price list settings of your project and to the NMKR Pay integration tab.
The NMKR Pay button comes in three different designs and three different colours that can be selected in the dropdown. Depending on your selection the button link and also the HTML snippet that you can see below the links changes.
Copy and paste the HTML snippet
Click on "copy code to clipboard" and paste the code on your website.
If you want to test it before you embed it to your website, try it with an online HTML tool.
The following is an example HTML snippet that you would copy and paste it directly to your website.
<imgsrc="https://studio.nmkr.io/images/buttons/paybutton_1_1.svg"onclick="javascript:openPaymentWindow()"><scripttype="text/javascript">functionopenPaymentWindow() {constpaymentUrl="https://pay.nmkr.io/?p=7e221683f55e48b9a1f9e2666c6551b7&c=1";// Specify the popup width and heightconstpopupWidth=500;constpopupHeight=700;// Calculate the center of the screenconstleft=window.top.outerWidth /2+window.top.screenX - ( popupWidth /2);consttop=window.top.outerHeight /2+window.top.screenY - ( popupHeight /2);constpopup=window.open(paymentUrl,"NFT-MAKER PRO Payment Gateway",`popup=1, location=1, width=${popupWidth}, height=${popupHeight}, left=${left}, top=${top}`);// Show dim backgrounddocument.body.style ="background: rgba(0, 0, 0, 0.5)";// Continuously check whether the popup has been closedconstbackgroundCheck=setInterval(function () {if(popup.closed) {clearInterval(backgroundCheck);console.log("Popup closed");// Remove dim backgrounddocument.body.style =""; } },1000); } </script>
Pay Button with quantity options
To integrate a quantity option to your NMKR Pay integration simply add the following snipped and extend with the quantity options (<option value="n">n</option>) you need for your project.
The second step is to change the parameter for the amount of the link in the HTML snippet that was copied from NMKR Studio from c=1"; to c="+NFT.value;
Only price/amount-pairs that are previously specified in the price list will work with the quantity options.
The following shows an example of an HTML integration with quantity option 1-5 NFTs per transaction.
<pstyle="text-align:center;"> <selectid="NFT"><optionvalue="None">-- Select --</option><optionvalue="1">1</option><optionvalue="2">2</option><optionvalue="3">3</option><optionvalue="4">4</option><optionvalue="5">5</option></select><br><br></script> </p><imgsrc="https://pro.nft-maker.io/images/buttons/paybutton_1_1.svg"onclick="javascript:openPaymentWindow()"><scripttype="text/javascript">functionopenPaymentWindow() {constpaymentUrl="https://pay.nmkr.io/?p=cec3419ddf2c4c5ca9b3abdbc719ff29&c="+NFT.value;// Specify the popup width and heightconstpopupWidth=500;constpopupHeight=700;// Calculate the center of the screenconstleft=window.top.outerWidth /2+window.top.screenX - ( popupWidth /2);consttop=window.top.outerHeight /2+window.top.screenY - ( popupHeight /2);constpopup=window.open(paymentUrl,"NFT-MAKER PRO Payment Gateway",`popup=1, location=1, width=${popupWidth}, height=${popupHeight}, left=${left}, top=${top}`);// Show dim backgrounddocument.body.style ="background: rgba(0, 0, 0, 0.5)";// Continuously check whether the popup has been closedconstbackgroundCheck=setInterval(function () {if(popup.closed) {clearInterval(backgroundCheck);console.log("Popup closed");// Remove dim backgrounddocument.body.style =""; } },1000); } </script>
Useful parameters for the payment link
By adding the parameter &pm=wallet or &pm=fiat at the end of your payment link, you would skip the step where the user selects what payment method he wants to use.&pm=wallet would lead directly to the payment via Cardano Wallet
&pm=fiat would lead directly to the FIAT payment option, if enabled.