Donations

The ultimate guide to integrate crypto donations.

DePay Donations allows you to accept donation payments made with thousands of different crypto currencies.


Preparation

In order to receive crypto donations on any blockchain you need to have your own wallet on that particular blockchain first:

Create an Ethereum wallet


Button

The DePay Donations button allows you to directly accept crypto donations on your website or Dapp without any further installation of javascript packages. Just use our button to open a donation widget that uses your configuration.

<div class="DePayButton" label="Donate" widget="Donation" arguments='{"amount": {"start": "10","min": "1","step": "1" }, "token": "0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb", "receiver": "0x4e260bB2b25EC6F3A59B478fCDe5eD5B8D783B02"}'></div>
<script src="https://depay.fi/integrate/buttons/v2.js"></script>
<noscript><a href="https://depay.fi">DePay</a> is currently not supported without JavaScript enabled.</noscript>
<script>DePayButtons.init({document: document});</script>

Use our configurator to make sure you pass the correct configuration.


Widget

If you want to open our widget directly from your application code, use our widget library.

Installation

You can either load the depay-widgets package via CDN:

<script src="https://depay.fi/integrate/widgets/v1.js"/>

or you install depay-widgets via the package manager of your choice and ship it as part of your application bundle:

yarn add depay-widgets
npm install depay-widgets --save

Load the DePayWidgets package wherever you need it and call th Donation method:

import DePayWidgets from 'depay-widgets';
DePayWidgets.Donation({
  amount: {
    start: "10",
    min: "1",
    step: "1"  
  },
  token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb',
  receiver: '0x4e260bB2b25EC6F3A59B478fCDe5eD5B8D783B02'
});

Configuration

You need to pass a configuration object to DePayWidgets.Donation which needs to contain the fields:

amount

The amount object contains the amount of preselected tokens when the widget opens (start), the minimum amount of tokens the user can select in the widget (min) and by which number the amount increments/decrements when changed by the user (step). "20".

The BigNumber of that amount will be calculated internally including finding the right amount of decimals for the given token. So please just pass the amount in a human readable form: e.g. "20" for 20 USDT and not "2000000" (BigNumber).

token

The address of the token you want to receive.

receiver

The address receiving the payment. Always double check that you've set the right address.

callback

A function that will be called once the payment has been successfully confirmed by the network.

The widget will call the `callback` function passing a callback object as an argument:

{
  tx: 'the transaction hash of the confirmed transaction'
}


Configurator

Use our configurator in order to simplify the configuration:

Token
DEPAY
Amount

Place the following configured html code directly into your website:

<div class="DePayButton" label="Donate" widget="Donation" arguments='{"amount": {"start": "10","min": "1","step": "1" }, "token": "0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb", "receiver": "0x4e260bB2b25EC6F3A59B478fCDe5eD5B8D783B02"}'></div>
<script src="https://depay.fi/integrate/buttons/v2.js"></script>
<noscript><a href="https://depay.fi">DePay</a> is currently not supported without JavaScript enabled.</noscript>
<script>DePayButtons.init({document: document});</script>

or call the widget directly from your application code using the following configuration:

DePayWidgets.Donation({
  amount: {
    start: "10",
    min: "1",
    step: "1"  
  },
  token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb',
  receiver: '0x4e260bB2b25EC6F3A59B478fCDe5eD5B8D783B02'
});

Support

Need additional help
?

Feel free to reach out in order to get additional help:

Ask the community
Open an issue
Start a conversation