user6918: I have integrated a Cardano wallet into my site and done some basic interactions.
I am hoping to get a sample, example and/or guidance on how to build the transaction I am interested in implementing:
Scenario:

User visits my site, connects their wallet.
User pays an amount of ADA or an amount of a native token to mint an NFT.
User has NFT in their wallet now, and site can verify it is there as a means of confirming paid membership.

So the transaction I need to build:
User pays an amount of ADA or a native token to mint an NFT.
=> ADA gets transferred from the users wallet to the wallet of the site, NFT gets minted and sent to users wallet.
Has anyone here done this?

user7049: This all can be done in a single transaction using lucid. Suggest you to see examples here. You can use payToContract to pay Ada / native token and simultaneously, mintAssets to mint them (in your minting script, check script context to see whether the required amount is getting transferred to required address). Can see a similar example I coded for my project here.

6918: <p>I have integrated a Cardano wallet into my site and done some basic interactions.
I am hoping to get a sample, example and/or guidance on how to build the transaction I am interested in implementing:</p>
<p>Scenario:</p>
<ul>
<li>User visits my site, connects their wallet.</li>
<li>User pays an amount of ADA or an amount of a native token to mint an NFT.</li>
<li>User has NFT in their wallet now, and site can verify it is there as a means of confirming paid membership.</li>
</ul>
<p>So the transaction I need to build:</p>
<p>User pays an amount of ADA or a native token to mint an NFT.
=&gt; ADA gets transferred from the users wallet to the wallet of the site, NFT gets minted and sent to users wallet.</p>
<p>Has anyone here done this?</p>
 7049: <p>This all can be done in a single transaction using <a href="https://github.com/spacebudz/lucid" rel="nofollow noreferrer">lucid</a>. Suggest you to see examples <a href="https://github.com/spacebudz/lucid/tree/main/src/examples" rel="nofollow noreferrer">here</a>. You can use <code>payToContract</code> to pay Ada / native token and simultaneously, <code>mintAssets</code> to mint them (in your minting script, check script context to see whether the required amount is getting transferred to required address). Can see a similar example I coded for my project <a href="https://github.com/adaplays/adaplays.xyz/blob/main/pages/games/rps/new-game.tsx#L89" rel="nofollow noreferrer">here</a>.</p>
