Process Solana payments and setup Solana webhook for payment notifications. This guide can help you if you need to setup a payment page, and get payment notifications on a particular URL (for automation). If you don't need webhooks, it is a lot more simple, this guide and code examples are only if you want to handle payments in a website or in an app.
HTML payment form to embed into website - payment link.
P-Link.io provides a variety of payment features to the community. With this platform, you can easily integrate Solana SPL-Token based payment in your website, application, or point of sale. Payments can be requested with a payment url, or a form, or a QRcode. This gateway will then use callbacks (HTTP webhook) in order to notify you about payments. P-Links can also connect with IFTTT, Make, or Zapier using our RSS p-link This allows a different method for implementing Solana SPL-Token based payments, with simple links, and HTTP webhook, that is very easy to integrate into PHP, ASP, JAVA, Ruby projects.
You can view an example of a payment page here :
https://p-link.io/Pay/FPnfgC9ppJP9qbDyL2E5ZfDuvHuabec2XFfKufawP6p4/1/46/USD/Pay%20now/PARAM
Because you need to setup a wehhook url, you first need to register your webhook on P-Link app : Payment links | P-Link.io
You need to provide your wallet, the currency you want to provide amount in (EUR / USD). When the form is submitted, you will get a link.
This link leads to a payment form, you can send by email, or use in your app, or anywhere a link can be used.
You can receive payment notification by email and on an notification URL (webhook). You can customize the amount, the title of the order, and provide an optionnal parameter that will be transmitted with the webhook and email notifications, just replace the parameter 'PARAM'. If you implemented our payment gateway and would like to be featured in the partners list, please contact us.
The payment URL is quite simple, and must respect the format :
https://p-link.io/[webHookID]/[walletAddress]/[requestedAmount]/[EUR or USD]/[Optionnal title for the order]/[OptionnalParameter]/
If you specified a webhook, a HTTP request will be made on payment on the URL you provided. The data will be sent as a JSON encoded BODY of an HTTP request with the parameters :
myParam : the parameter you provided in the payment link or form
sourcePayment : the wallet address of the payer
paidAmountInToken : the amount paid in token (bigint)
paidAmountInTokenUi : the amount paid in token user readable
tokenUsedForPayment : the mint address of token used for payment
EUR_Amount : the amount paid converted in euros
USD_Amount : the amount paid converted in USD
trx : the transaction ID
secret : your secret key
More info on P-Link can be found here : Payment links Payment links Complete documentation
This repo and source codes are under licence Creative Commons Attribution 4.0 International (CC BY 4.0).
