Skip to content

💸 SPL token cashback through webhooks after each successful payment

Notifications You must be signed in to change notification settings

candypay-examples/cashback-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cashback Example server

This is a base example server that lets you implement SPL token cashback through webhooks after each successful payment. For more details, head over to Docs.

Deployment

  1. Fork the repo and make sure to change these 4 params,
  • tokenAddress : Mint Address of SPL token which will be used as cashback
  • tokenDecimal : Decimals of that token
  • cashback : Amount of tokens to cashback for each $1 spent
  • connection : Use custom RPC for reliable and fast experience
  1. Deploy the repo on a server platform like Railway
  2. Copy URL of the deployed server and head over to CandyPay dashboard. In the bottom of settings page, create a new webhook service entering name, description and URL of the server.
  3. On creation a webhook secret key will be generated, copy the secret key and add as env in the server
WEBHOOK_SECRET= 'webhook secret key' 
SOLANA_PRIVATE_KEY= 'private key of solana wallet that will fund cashback tokens and gas fees'
  1. Add envs and redploy the server, and the cashback system is ready to go into action!

About

💸 SPL token cashback through webhooks after each successful payment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published