Payments

The ultimate guide to integrate crypto payments.

DePay Payments allows you to accept and perform crypto payments.


Preparation

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

Create an Ethereum wallet


Button

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

<div class="DePayButton" label="Pay" widget="Payment" arguments='{"amount": "10", "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 Payment method:

import DePayWidgets from 'depay-widgets';
DePayWidgets.Payment({
  amount: "10",
  token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb',
  receiver: '0x4e260bB2b25EC6F3A59B478fCDe5eD5B8D783B02'
});

Configuration

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

amount

The amount of tokens you want to receive. Needs to be passed as a string e.g. "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 your configuration:

Token
DEPAY
Amount

Place the following configured html code directly into your website:

<div class="DePayButton" label="Pay" widget="Payment" arguments='{"amount": "10", "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.Payment({
  amount: "10",
  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