WP Easy Paypal Payment Accept - Version 3.1

Version Description

Added an option to specify a different amount (any amount your user whish to pay) via the shortcode.

Download this release

Release Info

Developer mra13
Plugin Icon 128x128 WP Easy Paypal Payment Accept
Version 3.1
Comparing to
See all releases

Code changes from version 3.0 to 3.1

Files changed (3) hide show
  1. WP_Accept_Paypal_Payment.php +22 -13
  2. readme.txt +9 -3
  3. shortcode_view.php +42 -25
WP_Accept_Paypal_Payment.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Easy Paypal Payment Accept
4
- Version: v3.0
5
  Plugin URI: http://www.tipsandtricks-hq.com/?p=120
6
  Author: Tips and Tricks HQ
7
  Author URI: http://www.tipsandtricks-hq.com/
@@ -19,7 +19,7 @@ Description: Easy to use Wordpress plugin to accept paypal payment for a service
19
  GNU General Public License for more details.
20
  */
21
 
22
- $wp_paypal_payment_version = 3.0;
23
 
24
  // Some default options
25
  add_option('wp_pp_payment_email', 'korin.iverson@gmail.com');
@@ -39,13 +39,15 @@ add_option('wp_pp_ref_title', 'Your Email Address');
39
  add_option('wp_pp_return_url', get_bloginfo('home'));
40
 
41
  add_shortcode('wp_paypal_payment_box', 'wpapp_buy_now_button_shortcode' );
42
- function wpapp_buy_now_button_shortcode( $atts, $content ) {
 
43
  extract( shortcode_atts( array(
44
  'email' => 'your@paypal-email.com',
45
  'currency' => 'USD',
46
  'options' => 'Payment for Service 1:15.50|Payment for Service 2:30.00|Payment for Service 3:47.00',
47
  'return' => site_url(),
48
- 'reference' => 'Your Email Address'
 
49
  ) , $atts) );
50
  $options = explode( '|' , $options);
51
  $html_options = '';
@@ -58,7 +60,7 @@ function wpapp_buy_now_button_shortcode( $atts, $content ) {
58
  }
59
  $payment_button_img_src = get_option('payment_button_type');
60
  ob_start();
61
- include_once ('shortcode_view.php');
62
  $output = ob_get_contents();
63
  ob_end_clean();
64
  return $output;
@@ -227,15 +229,16 @@ function paypal_payment_options_page() {
227
 
228
  <h2>Accept Paypal Payment Settings v <?php echo $wp_paypal_payment_version; ?></h2>
229
 
230
- <p>For information and updates, please visit the plugin page at the following URL:<br />
231
- <a href="http://www.tipsandtricks-hq.com/?p=120">http://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120</a>
232
- </p>
 
233
 
234
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
235
  <input type="hidden" name="info_update" id="info_update" value="true" />
236
 
237
  <fieldset class="options">
238
- <legend>Usage:</legend>
239
 
240
  <p>There are a few ways you can use this plugin:</p>
241
  <ol>
@@ -249,7 +252,7 @@ function paypal_payment_options_page() {
249
  </fieldset>
250
 
251
  <fieldset class="options">
252
- <strong><legend>WP Paypal Payment or Donation Accept Plugin Options</legend></strong><br />
253
 
254
  <strong>WP Paypal Payment Widget Title :</strong>
255
  <input name="wp_paypal_widget_title_name" type="text" size="30" value="<?php echo get_option('wp_paypal_widget_title_name'); ?>"/>
@@ -396,11 +399,17 @@ function paypal_payment_options_page() {
396
  </fieldset>
397
 
398
  <div class="submit">
399
- <input type="submit" name="info_update" value="<?php _e('Update options'); ?> &raquo;" />
400
  </div>
401
-
402
  </form>
403
- </div><?php
 
 
 
 
 
 
 
404
  }
405
 
406
  function show_wp_paypal_payment_widget($args)
1
  <?php
2
  /*
3
  Plugin Name: WP Easy Paypal Payment Accept
4
+ Version: v3.1
5
  Plugin URI: http://www.tipsandtricks-hq.com/?p=120
6
  Author: Tips and Tricks HQ
7
  Author URI: http://www.tipsandtricks-hq.com/
19
  GNU General Public License for more details.
20
  */
21
 
22
+ $wp_paypal_payment_version = 3.1;
23
 
24
  // Some default options
25
  add_option('wp_pp_payment_email', 'korin.iverson@gmail.com');
39
  add_option('wp_pp_return_url', get_bloginfo('home'));
40
 
41
  add_shortcode('wp_paypal_payment_box', 'wpapp_buy_now_button_shortcode' );
42
+ function wpapp_buy_now_button_shortcode($atts)
43
+ {
44
  extract( shortcode_atts( array(
45
  'email' => 'your@paypal-email.com',
46
  'currency' => 'USD',
47
  'options' => 'Payment for Service 1:15.50|Payment for Service 2:30.00|Payment for Service 3:47.00',
48
  'return' => site_url(),
49
+ 'reference' => 'Your Email Address',
50
+ 'other_amount' => '',
51
  ) , $atts) );
52
  $options = explode( '|' , $options);
53
  $html_options = '';
60
  }
61
  $payment_button_img_src = get_option('payment_button_type');
62
  ob_start();
63
+ include('shortcode_view.php');
64
  $output = ob_get_contents();
65
  ob_end_clean();
66
  return $output;
229
 
230
  <h2>Accept Paypal Payment Settings v <?php echo $wp_paypal_payment_version; ?></h2>
231
 
232
+ <div style="background: none repeat scroll 0 0 #ECECEC;border: 1px solid #CFCFCF;color: #363636;margin: 10px 0 15px;padding:15px;text-shadow: 1px 1px #FFFFFF;">
233
+ For usage documentation and updates, please visit the plugin page at the following URL:<br />
234
+ <a href="http://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120" target="_blank">http://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120</a>
235
+ </div>
236
 
237
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
238
  <input type="hidden" name="info_update" id="info_update" value="true" />
239
 
240
  <fieldset class="options">
241
+ <h3>Plugin Usage:</h3>
242
 
243
  <p>There are a few ways you can use this plugin:</p>
244
  <ol>
252
  </fieldset>
253
 
254
  <fieldset class="options">
255
+ <strong>WP Paypal Payment or Donation Accept Plugin Options</strong><br />
256
 
257
  <strong>WP Paypal Payment Widget Title :</strong>
258
  <input name="wp_paypal_widget_title_name" type="text" size="30" value="<?php echo get_option('wp_paypal_widget_title_name'); ?>"/>
399
  </fieldset>
400
 
401
  <div class="submit">
402
+ <input type="submit" class="button-primary" name="info_update" value="<?php _e('Update options'); ?> &raquo;" />
403
  </div>
 
404
  </form>
405
+
406
+ <div style="background: none repeat scroll 0 0 #FFF6D5;border: 1px solid #D1B655;color: #3F2502;margin: 10px 0;padding: 5px 5px 5px 10px;text-shadow: 1px 1px #FFFFFF;">
407
+ <p>If you need a feature rich and supported plugin for accepting PayPal payment then checkout my <a href="http://www.tipsandtricks-hq.com/wordpress-estore-plugin-complete-solution-to-sell-digital-products-from-your-wordpress-blog-securely-1059" target="_blank">WP eStore Plugin</a>
408
+ </p>
409
+ </div>
410
+
411
+ </div><!-- end of .wrap -->
412
+ <?php
413
  }
414
 
415
  function show_wp_paypal_payment_widget($args)
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WP Easy Paypal Payment Accept ===
2
  Contributors: Ruhul Amin, Tips and Tricks HQ
3
  Donate link: http://www.tipsandtricks-hq.com
4
- Tags: Paypal payment, Accept payment for services or product, PayPal donation, wordpress paypal, paypal for wordpress, paypal plugin for wordpress, paypal integration, paypal
5
  Requires at least: 3.0
6
  Tested up to: 3.6.1
7
- Stable tag: 3.0
8
  License: GPLv2 or later
9
 
10
  Easy to use Wordpress plugin to accept paypal payment for a service or product or donation in one click
@@ -22,6 +22,8 @@ For information, detailed documentation and updates, please visit the [WordPress
22
  * You will need to have your own PayPal account (creating a PayPal account is free).
23
  * Integrate PayPal with your WordPress powered site.
24
  * Accept donation on your WordPress site for a cause.
 
 
25
 
26
  == Usage ==
27
 
@@ -47,7 +49,11 @@ Visit the plugin site at http://www.tipsandtricks-hq.com/?p=120 for screenshots.
47
 
48
  == Changelog ==
49
 
50
- - 3.0 - WordPress 3.6 compatibility update
 
 
 
 
51
 
52
  Changelog for old versions can be found at the following URL
53
  http://www.tipsandtricks-hq.com/?p=120
1
  === WP Easy Paypal Payment Accept ===
2
  Contributors: Ruhul Amin, Tips and Tricks HQ
3
  Donate link: http://www.tipsandtricks-hq.com
4
+ Tags: Paypal payment, Accept payment for services or product, PayPal donation, wordpress paypal, paypal for wordpress, paypal plugin for wordpress, paypal integration, paypal, buy now
5
  Requires at least: 3.0
6
  Tested up to: 3.6.1
7
+ Stable tag: 3.1
8
  License: GPLv2 or later
9
 
10
  Easy to use Wordpress plugin to accept paypal payment for a service or product or donation in one click
22
  * You will need to have your own PayPal account (creating a PayPal account is free).
23
  * Integrate PayPal with your WordPress powered site.
24
  * Accept donation on your WordPress site for a cause.
25
+ * Allow your users to specify an amount that they wish to pay. Useful when you need to accept variable payment amount.
26
+ * Ability to specify a reference value for the payment.
27
 
28
  == Usage ==
29
 
49
 
50
  == Changelog ==
51
 
52
+ = 3.1 =
53
+ Added an option to specify a different amount (any amount your user whish to pay) via the shortcode.
54
+
55
+ = 3.0 =
56
+ WordPress 3.6 compatibility update
57
 
58
  Changelog for old versions can be found at the following URL
59
  http://www.tipsandtricks-hq.com/?p=120
shortcode_view.php CHANGED
@@ -1,15 +1,24 @@
1
- <div id="wp_paypal_button_cont">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- <select id="wp_paypal_button_options">
4
- <?php echo $html_options; ?>
5
- </select>
 
6
 
7
- <br />
8
-
9
- <label for="customer_email_address"><?php echo $reference; ?></label> <br />
10
- <p><input type="text" id="customer_email_address" /></p>
11
-
12
- <form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
13
  <input type="hidden" name="cmd" value="_xclick">
14
  <input type="hidden" name="business" value="<?php echo $email; ?>">
15
  <input type="hidden" name="currency_code" value="<?php echo $currency; ?>">
@@ -17,27 +26,35 @@
17
  <input type="hidden" name="amount" value="">
18
  <input type="hidden" name="return" value="<?php echo $return; ?>" />
19
  <input type="hidden" name="email" value="" />
20
- </form>
21
- <input type="image" id="buy_now_button" src="<?php echo $payment_button_img_src; ?>" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
 
 
22
  </div>
23
 
24
  <style>
25
- #wp_paypal_button_options{
26
- margin-bottom: 15px;
 
 
 
27
  }
28
  </style>
29
 
30
  <script type="text/javascript">
31
- jQuery('#wp_paypal_button_cont #buy_now_button').click(function(e){
32
- e.preventDefault();
33
- var price = jQuery('#wp_paypal_button_options').val();
34
- var name = jQuery('#wp_paypal_button_options :selected').attr('data-product_name');
35
- var email = jQuery('#customer_email_address').val();
36
-
37
- jQuery('input[name=email]').val(email);
38
- jQuery('input[name=amount]').val(price);
39
- jQuery('input[name=item_name]').val(name);
40
-
41
- jQuery('#wp_paypal_button_cont form').submit();
 
 
 
42
  });
43
  </script>
1
+ <div class="wp_paypal_button_widget">
2
+ <form name="_xclick" class="wp_accept_pp_button_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
3
+ <div class="wp_pp_button_selection_section">
4
+ <select class="wp_paypal_button_options">
5
+ <?php echo $html_options; ?>
6
+ </select>
7
+ </div>
8
+
9
+ <?php
10
+ if(!empty($other_amount)){
11
+ echo '<div class="wp_pp_button_other_amt_section">';
12
+ echo 'Other Amount: <input type="text" name="other_amount" value="" size="4">';
13
+ echo '</div>';
14
+ }
15
+ ?>
16
 
17
+ <div class="wp_pp_button_reference_section">
18
+ <label for="wp_pp_button_reference"><?php echo $reference; ?></label>
19
+ <br /><input type="text" name="os0" class="wp_pp_button_reference" />
20
+ </div>
21
 
 
 
 
 
 
 
22
  <input type="hidden" name="cmd" value="_xclick">
23
  <input type="hidden" name="business" value="<?php echo $email; ?>">
24
  <input type="hidden" name="currency_code" value="<?php echo $currency; ?>">
26
  <input type="hidden" name="amount" value="">
27
  <input type="hidden" name="return" value="<?php echo $return; ?>" />
28
  <input type="hidden" name="email" value="" />
29
+ <div class="wp_pp_button_submit_btn">
30
+ <input type="image" id="buy_now_button" src="<?php echo $payment_button_img_src; ?>" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
31
+ </div>
32
+ </form>
33
  </div>
34
 
35
  <style>
36
+ .wp_pp_button_selection_section, .wp_pp_button_other_amt_section, .wp_pp_button_reference_section{
37
+ margin-bottom: 10px;
38
+ }
39
+ .wp_paypal_button_widget{
40
+ margin: 10px 0;
41
  }
42
  </style>
43
 
44
  <script type="text/javascript">
45
+ jQuery(document).ready(function($) {
46
+ $('.wp_accept_pp_button_form').submit(function(e){
47
+ var form_obj = $(this);
48
+ var options_name = form_obj.find('.wp_paypal_button_options :selected').attr('data-product_name');
49
+ form_obj.find('input[name=item_name]').val(options_name);
50
+
51
+ var options_val = form_obj.find('.wp_paypal_button_options').val();
52
+ var other_amt = form_obj.find('input[name=other_amount]').val();
53
+ if (!isNaN(other_amt) && other_amt.length > 0){
54
+ options_val = other_amt;
55
+ }
56
+ form_obj.find('input[name=amount]').val(options_val);
57
+ return;
58
+ });
59
  });
60
  </script>