PayPal Donations - Version 1.1

Version Description

Download this release

Release Info

Developer artstorm
Plugin Icon 128x128 PayPal Donations
Version 1.1
Comparing to
See all releases

Code changes from version 1.0 to 1.1

Files changed (3) hide show
  1. paypal-donations.php +42 -8
  2. readme.txt +6 -2
  3. screenshot-1.jpg +0 -0
paypal-donations.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: PayPal Donations
4
  Plugin URI: http://coding.cglounge.com/wordpress-plugins/paypal-donations/
5
  Description: Easy and simple setup and insertion of PayPal donate buttons with a shortcode. Donation purpose can be set for each button. A few other customization options are available as well.
6
- Version: 1.0
7
  Author: Johan Steen
8
  Author URI: http://coding.cglounge.com/
9
  Text Domain: paypal-donations
@@ -27,10 +27,28 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
 
28
 
29
  class paypal_donations {
30
- var $plugin_options = "paypal_donations_options";
31
- var $donate_buttons = array("small" => "https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif",
32
- "large" => "https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif",
33
- "cards" => "https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  /**
35
  * Constructor
36
  *
@@ -98,9 +116,12 @@ class paypal_donations {
98
  $paypal_btn .= '<input type="hidden" name="item_name" value="' .$purpose. '" />'; // Purpose
99
  if ($reference)
100
  $paypal_btn .= '<input type="hidden" name="item_number" value="' .$reference. '" />'; // LightWave Plugin
101
-
 
 
 
 
102
  // Settings not implemented yet
103
- // $paypal_btn .= '<input type="hidden" name="currency_code" value="SEK" />';
104
  // $paypal_btn .= '<input type="hidden" name="amount" value="20" />';
105
 
106
  // Get the button URL
@@ -145,6 +166,7 @@ class paypal_donations {
145
  $pd_options['reference'] = trim( $_POST['reference'] );
146
  $pd_options['button'] = trim( $_POST['button'] );
147
  $pd_options['button_url'] = trim( $_POST['button_url'] );
 
148
  update_option($this->plugin_options, $pd_options);
149
  $this->admin_message( __( 'The PayPal Donations settings have been updated.', 'paypal-donations' ) );
150
  }
@@ -160,6 +182,17 @@ class paypal_donations {
160
  <th scope="row"><label for="paypal_account"><?php _e( 'PayPal Account', 'paypal-donations' ) ?></label></th>
161
  <td><input name="paypal_account" type="text" id="paypal_account" value="<?php echo $pd_options['paypal_account']; ?>" class="regular-text" /><span class="setting-description"><br/><?php _e( 'Your PayPal email address or your PayPal secure merchant account ID.', 'paypal-donations' ) ?></span></td>
162
  </tr>
 
 
 
 
 
 
 
 
 
 
 
163
  </table>
164
 
165
  <h3><?php _e( 'Optional Settings', 'paypal-donations' ) ?></h3>
@@ -194,9 +227,10 @@ class paypal_donations {
194
  <fieldset><legend class="hidden">PayPal Button</legend>
195
  <?php
196
  $custom = TRUE;
 
197
  foreach ( $this->donate_buttons as $key => $button ) {
198
  echo "\t<label title='" . attribute_escape($key) . "'><input style='padding: 10px 0 10px 0;' type='radio' name='button' value='" . attribute_escape($key) . "'";
199
- if ( $pd_options['button'] === $key ) { // checked() uses "==" rather than "==="
200
  echo " checked='checked'";
201
  $custom = FALSE;
202
  }
3
  Plugin Name: PayPal Donations
4
  Plugin URI: http://coding.cglounge.com/wordpress-plugins/paypal-donations/
5
  Description: Easy and simple setup and insertion of PayPal donate buttons with a shortcode. Donation purpose can be set for each button. A few other customization options are available as well.
6
+ Version: 1.1
7
  Author: Johan Steen
8
  Author URI: http://coding.cglounge.com/
9
  Text Domain: paypal-donations
27
 
28
 
29
  class paypal_donations {
30
+ var $plugin_options = 'paypal_donations_options';
31
+ var $donate_buttons = array('small' => 'https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif',
32
+ 'large' => 'https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif',
33
+ 'cards' => 'https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif');
34
+ var $currency_codes = array('AUD' => 'Australian Dollars (A $)',
35
+ 'CAD' => 'Canadian Dollars (C $)',
36
+ 'EUR' => 'Euros (&euro;)',
37
+ 'GBP' => 'Pounds Sterling (&pound;)',
38
+ 'JPY' => 'Yen (&yen;)',
39
+ 'USD' => 'U.S. Dollars ($)',
40
+ 'NZD' => 'New Zealand Dollar ($)',
41
+ 'CHF' => 'Swiss Franc',
42
+ 'HKD' => 'Hong Kong Dollar ($)',
43
+ 'SGD' => 'Singapore Dollar ($)',
44
+ 'SEK' => 'Swedish Krona',
45
+ 'DKK' => 'Danish Krone',
46
+ 'PLN' => 'Polish Zloty',
47
+ 'NOK' => 'Norwegian Krone',
48
+ 'HUF' => 'Hungarian Forint',
49
+ 'CZK' => 'Czech Koruna',
50
+ 'ILS' => 'Israeli Shekel',
51
+ 'MXN' => 'Mexican Peso');
52
  /**
53
  * Constructor
54
  *
116
  $paypal_btn .= '<input type="hidden" name="item_name" value="' .$purpose. '" />'; // Purpose
117
  if ($reference)
118
  $paypal_btn .= '<input type="hidden" name="item_number" value="' .$reference. '" />'; // LightWave Plugin
119
+
120
+ // More Settings
121
+ if (isset($pd_options['currency_code']))
122
+ $paypal_btn .= '<input type="hidden" name="currency_code" value="' .$pd_options['currency_code']. '" />';
123
+
124
  // Settings not implemented yet
 
125
  // $paypal_btn .= '<input type="hidden" name="amount" value="20" />';
126
 
127
  // Get the button URL
166
  $pd_options['reference'] = trim( $_POST['reference'] );
167
  $pd_options['button'] = trim( $_POST['button'] );
168
  $pd_options['button_url'] = trim( $_POST['button_url'] );
169
+ $pd_options['currency_code'] = trim( $_POST['currency_code'] );
170
  update_option($this->plugin_options, $pd_options);
171
  $this->admin_message( __( 'The PayPal Donations settings have been updated.', 'paypal-donations' ) );
172
  }
182
  <th scope="row"><label for="paypal_account"><?php _e( 'PayPal Account', 'paypal-donations' ) ?></label></th>
183
  <td><input name="paypal_account" type="text" id="paypal_account" value="<?php echo $pd_options['paypal_account']; ?>" class="regular-text" /><span class="setting-description"><br/><?php _e( 'Your PayPal email address or your PayPal secure merchant account ID.', 'paypal-donations' ) ?></span></td>
184
  </tr>
185
+ <tr valign="top">
186
+ <th scope="row"><label for="currency_code"><?php _e( 'Currency', 'paypal-donations' ) ?></label></th>
187
+ <td><select name="currency_code" id="currency_code">
188
+ <?php if (isset($pd_options['currency_code'])) { $current_currency = $pd_options['currency_code']; } else { $current_currency = 'USD'; }
189
+ foreach ( $this->currency_codes as $key => $code ) {
190
+ echo '<option value="'.$key.'"';
191
+ if ($current_currency == $key) { echo ' selected="selected"'; }
192
+ echo '>'.$code.'</option>';
193
+ }?></select>
194
+ <span class="setting-description"><br/><?php _e( 'The currency to use for the donations.', 'paypal-donations' ) ?></span></td>
195
+ </tr>
196
  </table>
197
 
198
  <h3><?php _e( 'Optional Settings', 'paypal-donations' ) ?></h3>
227
  <fieldset><legend class="hidden">PayPal Button</legend>
228
  <?php
229
  $custom = TRUE;
230
+ if (isset($pd_options['button'])) { $current_button = $pd_options['button']; } else { $current_button = 'large'; }
231
  foreach ( $this->donate_buttons as $key => $button ) {
232
  echo "\t<label title='" . attribute_escape($key) . "'><input style='padding: 10px 0 10px 0;' type='radio' name='button' value='" . attribute_escape($key) . "'";
233
+ if ( $current_button === $key ) { // checked() uses "==" rather than "==="
234
  echo " checked='checked'";
235
  $custom = FALSE;
236
  }
readme.txt CHANGED
@@ -4,13 +4,13 @@ Donate link: http://coding.cglounge.com/wordpress-plugins/paypal-donations/#pint
4
  Tags: paypal, donation, shortcode, donate, button
5
  Requires at least: 2.7
6
  Tested up to: 2.7.1
7
- Stable tag: 1.0
8
 
9
  Easy and simple setup and insertion of PayPal donate buttons with a shortcode. Donation purpose can be set for each button. A few other customization options are available as well.
10
 
11
  == Description ==
12
 
13
- Adds a PayPal donation shortcode to WordPress. The options menu lets you setup you PayPal ID and a few other optional settings. You can choose which donation button you want to use or if you want to use your own button. You can also set an optional default purpose and reference which can be overridden on each inserted instance with the shortcode options. There is also settings for custom payment page style and the return page.
14
 
15
  Insert the button in your pages or posts with this shortcode
16
 
@@ -46,5 +46,9 @@ Meditation.
46
 
47
  == Changelog ==
48
 
 
 
 
 
49
  = Version 1.0 - 7 May 2009 =
50
  * Initial Release
4
  Tags: paypal, donation, shortcode, donate, button
5
  Requires at least: 2.7
6
  Tested up to: 2.7.1
7
+ Stable tag: 1.1
8
 
9
  Easy and simple setup and insertion of PayPal donate buttons with a shortcode. Donation purpose can be set for each button. A few other customization options are available as well.
10
 
11
  == Description ==
12
 
13
+ Adds a PayPal donation shortcode to WordPress. The options menu lets you setup you PayPal ID and a few other optional settings. You can choose which donation button you want to use or if you want to use your own button. You can also set an optional default purpose and reference which can be overridden on each inserted instance with the shortcode options. There is also settings for currency, custom payment page style and the return page.
14
 
15
  Insert the button in your pages or posts with this shortcode
16
 
46
 
47
  == Changelog ==
48
 
49
+ = Version 1.1 - 23 May 2009 =
50
+ * Added an option to select the currency to make the donations in.
51
+ * Changed the default button in a new install from a custom button to the large button.
52
+
53
  = Version 1.0 - 7 May 2009 =
54
  * Initial Release
screenshot-1.jpg CHANGED
Binary file