donatebutton Paypal button to Donate

  1. Requirements
  2. Install
  3. Usage
  4. Usual parameters
  5. Resources

donatebutton extension add to your site a box with a message and a button for donations through paypal.

You can optate for a fix or variable amount to be donated. For variable amount, there will be two selectors, one for amount and one for currencies.

You can set donatebutton box to be displayed vertical or horizontal, to easy integrate in your site.

donatebutton have a nice predefined box with transparent background, which you can choose to use or not.

Extension is XHTML valid.

Requirements

Tested with Yii 1.1.7.

Install

- Download the latest release package
- Unpack it in /protected/extensions/ folder

Usage

If you wish to use a variable amount place in your page next code:

<?php $this->widget('application.extensions.donatebutton.donatebutton', 
     array(
           'vertical' => false,
           'show_frame' => false,
           'biggerbutton' => false,
           'fix_amount' => false,
           'alt_button' => 'Donate',
           'business' => 'user@email.com',
	   'item_name' => 'Support Your Business',
       'message' => 'If you like our work, you may throw us some cookies. Donate ',
	   'selectable_amount' => array(
	        'min_amount'=>3,
		    'max_amount'=>10,
		    'selected_amount'=>5,
		    'selected_currency'=>'EUR',
		    'currencies'=>array('EUR', 'USD'),//or leave ''
	    )
      )
);?>

If you wish to have a fixed amount use next code:

<?php $this->widget('application.extensions.donatebutton.donatebutton', 
     array(
           'vertical' => false,
           'show_frame' => false,
           'biggerbutton' => false,
           'fix_amount' => true,
           'alt_button' => 'Donate',
           'business' => 'user@email.com',
	       'item_name' => 'Support Your Business',
           'message' => 'If you like our work, you may throw us some cookies. Donate ',
	   'donation' => array(
	        'currency_code'=>'EUR',
		    'amount'=>5
	    )
      )
);?>

Usual parameters

  • vertical: display extension as a vertical box(boolean: false, true)
  • show_frame: display a frame to extension's box(boolean: false,true)
  • biggerbutton: use a larger button(boolean:false,true)
  • fix_amount: will use a fix amount(false,true)
  • alt_button':alt tag for paypal button(string:'Donate')
  • business: email address used for your paypal account(string:'user@email.com')
  • item_name: Item description in paypal cart(string:'Support Your Business')
  • message: text to be diplayed over button(string:'If you like our work, you may throw us some cookies. Donate ')
  • donation: when use a fixed amount, here set values of currency and amount to be donated'(array('currency_code'=>'EUR','amount'=>5))
  • currency_code: the currency for donation('EUR', 'USD')
  • amount: amount to be donate(integer:5)
  • selectable_amount: when use a variable amount, here will be values(array('min_amount'=>3,'max_amount'=>10,'selected_amount'=>5,'selected_currency'=>'EUR','currencies'=>array('EUR', 'USD')))
  • min_amount:minim amount to be donated (integer:3)
  • max_amount:maxim amount to be donated(integer:10)
  • selected_currency:default currency for donation(string:'USD')
  • currencies: currencies accepted for donation. If you don't set this, will be used selected_currency as unique currency(array('EUR', 'USD'))

Hint. Default values are marked as bold. If you needed values are same as default, you don't need to specify them in your code.

Resources

3 0
7 followers
529 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Web Service
Developed by: matricks
Created on: Sep 24, 2011
Last updated: 13 years ago

Downloads

show all

Related Extensions