---
description: >-
  If you want to embed the StablePay widget for donations or payments in your
  github repo or website follow the steps below. No signup or email required to
  start using StablePay.
---

# Donations

Head over to our [Widget Generator](https://stablepay.io/widget/generator) and follow these steps:

1. Choose Donation to generate your Widget.

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolNLks8CjKERnEtK_L%2F-LolNVXY5j_PE1Dy_Uyr%2Fimage.png?alt=media\&token=2f2d9bee-3b44-4afb-a6ca-9ac01d84d640)

**Note:** Donations and payments directly from the same token (e.g DAI to DAI) are free of fees to receive, and sender will only incur the gas costs of the transaction like any normal ethereum transaction. In the case of a token conversion it will incur in a small platform fee that will be deducted from the final amount. Read more here for details: [https://stablepay.io/faqs](https://stablepay.io/faqs).

1. Create your list of amount options for the user to donate in DAIs. The default amount is going to be the first in the list.

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolNeWnTHZioQJhL-GZ%2F-LolNfUBbmvS-kgV5bfd%2Fimage.png?alt=media\&token=c138c212-f56b-4611-a885-d07ba128e29f)

1. Put the address of your Ethereum wallet where you want to receive your tokens.

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolOLu2iS9d_8i9AsYq%2F-LolOVeUlsbGwiiSEdtb%2Fimage.png?alt=media\&token=32073f5f-197d-4d9b-8eb4-3f5a32706c43)

If you don't have a wallet, we suggest you start with a MetaMask wallet, is easy and fast. To learn more about it see:[https://metamask.io/](https://metamask.io/)

1. If you want your tokens to be deposited to **Compound** activate "Supply to Compound". Tokens will be supplied to Compound using your provided Wallet address where you can start earning interest on your DAI tokens. You have complete access to withdraw the tokens at any time with your wallet address.

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolOnGRDSC1PNQX5KD9%2F-LolP1RjYkKNq1tOq1BF%2Fimage.png?alt=media\&token=a2c3f6db-4bca-4df3-b936-b86e76ec881f)

To learn more about **Compound**, visit: [https://compound.finance/](https://compound.finance/)

1. Name of the owner of the Ethreum wallet(optional).&#x20;

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolP6YtyTBwuSTmihUb%2F-LolPIF73rACCWF9DX-Q%2Fimage.png?alt=media\&token=7695b6a8-1afd-4225-b3e4-5018bb061151)

1. After confirming a transaction, the widget will redirect to your web site of choice, put the web site URL here.

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolP6YtyTBwuSTmihUb%2F-LolPc-JOai3EHAGXxrX%2Fimage.png?alt=media\&token=451dae72-5ffc-4241-89f7-d40a24188a76)

## Donations in a website using HTML option

7.The code in HTML is going to be generated for you and you can paste it into your page!.

```
<!DOCTYPE html>
<html>
    <head>
        <!-- Add this <script> to the <head> tag -->
        <script src="https://unpkg.com/@stablepay/widget"></script>
    </head>
    <body>
        <!-- Add this anywhere in your site where you would like to render the Widget -->
        <div id="stablepay-widget"></div>

        <!-- Add this <script> at the end of the <body> tag -->
        <script>
            StablePay.renderWidgetButton(
                {
                    type: 'Donation',
                    source: {
                        name: 'JOHN DOE',
                        address: '0x05b54683C2C02aa690DF8b25B18Cd89C37a44f0C'
                    },
                    amount: {
                        total: 5,
                        options: [5,10,15,25,30]
                    },
                    callbackURL: 'https://mycontentsite.com/donate/success',
                    theme: 'colored',
                },
                'stablepay-widget'
            );
        </script>
    </body>
</html>
```

1. The code will create a button similar to the one below.

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolRfSB0jURslvYLlck%2F-LolRm4iXEe-HQFe-sbd%2Fimage.png?alt=media\&token=ab86c40c-5b44-4c48-b61c-a9563b46071f)

1. When the users 'click' the button, a widget like this will appear where they can choose the token they want to use for donating.

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolRpBRYp8p1sfjZ053%2F-LolV0cmDeQ-0PSY-3hj%2Fimage.png?alt=media\&token=304e23f2-9cae-4dbe-91e7-e91130698a49)

1. Wait for the transaction to be completed, and now the user can be redirected to your provided URL.

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolRpBRYp8p1sfjZ053%2F-LolWHtCASo21EE-VayJ%2Fimage.png?alt=media\&token=c370b2ed-799c-42f2-8def-2ccb8321c95d)

## Donations with Github

1. The link is going to be generated and you can copy and paste it on your Github Repository to accept tips and donations directly.

```
<a href="https://stablepay.io/checkout?data=U2FsdGVkX19IkPP%2Bx25neFHS%2Bzn97z7UwRyB1XCdy9E3Kbp4TLHCfaExoprtlIZY1u%2BHHwhkJpr9EYCNUgGPWcmh4xl22S6iWrp%2FqFkU3ZiZM4WI3B%2BkLtbAYTwBi3e4EweDpUfK1UTBtJSc57S2i1uil7DoYHbr43H%2FRfQathKzcjYM70zwZpBl77WVo6M0KMXzI5GH8pbizG8XkjwT97KqwLl3yPwHy%2B0FqLu1VGcZkRkCi8%2FfM4bs%2F0hzAy%2FdRMH%2FMpTPpTxCBTszmHc1%2FynziTH5e3eIQqk%2BL9AQqkNB6c2YNcK7e09az5PgH01m5KJA6dLoOhGRrivf2XtUunhMYmioGIAY%2B6O8zRiXAIicw15RL9y8e%2F3ZIoVBtTD0cUWuvvizGcTY3FM9xWFn7PnMqqLkN2MhXd7FFeOm1zaqgiGvwtCay4KkUSV61ilE">
    <img src="https://stablepay.io/static/DonationsButtonBlueWhite.svg" >
</a>
```

1. You can use the link in your Github repository, pasting the link in a **README.md** file repositor&#x79;**.**

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolcTIwJPUc-u6AFLbn%2F-LolctaRKhisWZqiK9vC%2Fimage.png?alt=media\&token=9ef7bb1f-887e-4c8c-8712-7bcbef4e4c2a)

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LoldyL_lWvAv1wXPPzn%2F-Lole-2vBrR2bBBtOQcc%2Fimage.png?alt=media\&token=19ebb35e-985e-4ae8-957a-7ccd69097cbf)

1. Wait for the transaction to be done, and now the user can be redirected to your Github page.

![](https://3050996466-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LcRjQr82yymxAMPBHT9%2F-LolfoJXZLZlqzm4J72e%2F-Lolh1elgomznS6hCOVh%2Fimage.png?alt=media\&token=e56f4082-4737-4898-9159-7ed1c6eae65a)

For more information, visit:[https://stablepay.io/](https://stablepay.io/)
