Skip to content

A minimal example how to implement an webhook receiver on express js

DexKit/ecommerce-webhook-receiver-expressjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webhook receiver

Minimal example to receive webhooks from DexKit ecommerce using express js.

To use this example first install dependencies using:

npm i

To start server run:

npm start

DexKit events

On each payment start, finished and failed is sended a webhook event on follow format:

{
    event: 'payment.initiated' | 'payment.succeed' | 'payment.failed'
    data: payload,
    context: {
        webhook_version: 1,
        occurred_at: new Date(),
    },
}

where payload is

{
         orderId: string,
         hash: string,
         senderAddress: string,
         amount: string,
         tokenSymbol: string,
         chainId: number,
         contractAddress: string,
         status: OrderStatus,
       }

where status

const OrderStatus: {
         Pending: 'Pending',
         PaymentConfirmed: 'PaymentConfirmed',
         TransactionFailed: 'TransactionFailed',
         Finalized: 'Finalized',
         Refunded: 'Refunded',
         Cancelled: 'Cancelled'
       };

Support DexKit at

https://giveth.io/project/dexappbuilder-the-no-codelow-code-toolkit-of-dexkit

About

A minimal example how to implement an webhook receiver on express js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published