Giter VIP home page Giter VIP logo

storefront-solana-pay's Introduction

๐Ÿ• Build a Storefront

๐ŸŽฌ Recorded Sessions

Link Instructor Event
youtube Recording Joe Caulfield N/A

A straightforward guide to Solana Pay Transaction Requests ๐Ÿ“ฒ

๐Ÿ˜ Why I like Solana Pay, and why you should too.

Solana Pay is freakin amazing. Have you ever scanned a QR Code on PayPal, Cashapp or a Wallet to send some money to your friends and thought "Oh damn this is pretty smooth". Well Solana Pay is gonna blow your mind. But there's two different "features" in Solana Pay, let's go into them: First of all what you should know that Solana Pay is actually a URL that is read by wallets with an end goal of it's user signing a transaction on the Solana network. This URL can be read by a wallet by you scanning a QR Code for example. Let's look at the differences between these URLs.

  • Transfer Requests: A transfer request is pretty easy to understand: it's a transfer request. Let's look at one of these URLs: solana:<recipient>?amount=<amount>&spl-token=<spl-token>&reference=<reference>&label=<label>&message=<message>&memo=<memo> It's pretty straightforward, the recipient is the Pubkey of the user getting a certain amount of a certain Token. The reference is a unique key that is used to difference transactions from each other. Imagine a business like amazon that accepts millions of payments per day, they somehow have to track what payment is intended for a certain purchase. That's what the reference key enables, i will give a reference key made to a checkout for a pack of cookies on my website, and as soon as a payment with that reference key is made i will be able to send the person my cookie. The other stuff in the URL is pretty useless, it's just gonna show a label/message on the users wallet when they want to sign.

  • Transaction Requests: This is where the real magic comes in. The URL would look like this in a transaction request: solana:https://example.solanapay.com/api/transaction. Looks different ? Yes! A wallet will actually go ahead and send a GET and a POST request to this endpoint. The GET request will get the Store's name and image so these can be displayed on the wallet payment screen. The POST request will return a transaction which the wallet will be able to sign. And as a merchant, you are the one creating this transaction. This enables an infinite amount of possibilities. You could offer loyalty coupons to your customer or swap the Tokens you get paid in into USDC automatically for example.

What we are going to look at in this mini course is Transaction Requests because Transfer requests are too basic for us lol.

storefront-solana-pay's People

Contributors

buffalojoec avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.