PHPackages                             sjaakp/yii2-donate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sjaakp/yii2-donate

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

sjaakp/yii2-donate
==================

Donate form for Yii2, uses Mollie.

v1.0.1(1y ago)01MITPHP

Since Dec 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sjaakp/yii2-donate)[ Packagist](https://packagist.org/packages/sjaakp/yii2-donate)[ RSS](/packages/sjaakp-yii2-donate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

yii2-donate
===========

[](#yii2-donate)

#### Donation widget for Yii2

[](#donation-widget-for-yii2)

[![Latest Stable Version](https://camo.githubusercontent.com/e7684a312754908c4aa878aba0eec6d77edc4bd0ab09f8488aa35f0b94f0a643/68747470733a2f2f706f7365722e707567782e6f72672f736a61616b702f796969322d64646f6e6174652f762f737461626c65)](https://packagist.org/packages/sjaakp/yii2-donate)[![Total Downloads](https://camo.githubusercontent.com/8bc549f449677f163ed3d9414035f77d780c8e69520bc2e74807632ada2b3a2b/68747470733a2f2f706f7365722e707567782e6f72672f736a61616b702f796969322d646f6e6174652f646f776e6c6f616473)](https://packagist.org/packages/sjaakp/yii2-donate)[![License](https://camo.githubusercontent.com/b640e5edfcb8b75ae728b655f43262aa27f9cbb8b24ca3d06a59caa3da02539f/68747470733a2f2f706f7365722e707567782e6f72672f736a61616b702f796969322d646f6e6174652f6c6963656e7365)](https://packagist.org/packages/sjaakp/yii2-donate)

**Yii2-donate** is a module for the [Yii 2.0](https://yiiframework.com/ "Yii") PHP Framework to handle donations. It makes use of the payment service provider [Mollie](https://www.mollie.com/ "Mollie"), which is mainly active in Western European countries.

**Yii2-donate** sports a [widget](https://www.yiiframework.com/doc/guide/2.0/en/structure-widgets), which can be placed on any page (or even *all* pages).

Basic functionality
-------------------

[](#basic-functionality)

If a visitor selects an amount and presses the 'Donate'-button, she is transfered to a Mollie payment page. If she successfully completes the payment, she is redirected to the site's `donate/thanks` page, where she is rewarded with a joyful shower of confetti. If the visitor did supply an email address, she receives a 'Thank you' mail. The 'thanks' page also sports a button to resume her visit to the site.

If the visitor cancels the payment, she is redirected to the site's `donate/cancel` page, from where she can resume her surfing.

At any time, the site's administrator can get an overview of granted donations on the `donate` page.

Prerequisites
-------------

[](#prerequisites)

You'll need a [Mollie account](https://help.mollie.com/hc/en-us/articles/210709969-How-do-I-create-an-account). It's free, but depending on your country, you may need a valid registration as a (small) business. You'll get two API keys, one for testing purposes and one for the real work. One of the API keys is used tot initialize the module.

It is strongly advised that the app uses [Pretty URLs](https://www.yiiframework.com/doc/guide/2.0/en/runtime-routing#using-pretty-urls).

Because **Yii2-donate** may send emails, the `mailer` component of the application has to be up and running. Be sure that the `'adminEmail'` parameter of the application has a sensible value. If you prefer, you may set the `'supportEmail'` parameter as well; if set, **Yii2-donate** will use this.

Installation
------------

[](#installation)

Install **Yii2-donate** in the usual way with [Composer](https://getcomposer.org/). Add the following to the require section of your `composer.json` file:

`"sjaakp/yii2-donate": "*"`

or run:

`composer require sjaakp/yii2-donate`

You can manually install **yii2-comus** by [downloading the source in ZIP-format](https://github.com/sjaakp/yii2-donate/archive/master.zip).

#### Module

[](#module)

**Yii2-donate** is a [module](https://www.yiiframework.com/doc/guide/2.0/en/structure-modules#using-modules "Yii2")in the Yii2 framework. It has to be configured in the main configuration file, usually called `web.php` or `main.php` in the `config`directory. Add the following to the configuration array:

```

...

...

```

The small, collapsed variant is obtained by:

```

...

...

```

Module options
--------------

[](#module-options)

The **Donate** module has a range of options. They are set in the application configuration like so:

```
