WP Easy Paypal Payment Accept - Version 3.6

Version Description

  • Added the ability to specify a cancel URL using the "cancel_url" parameter in the shortcode
  • Added a new shortcode that allows you to create a payment widget for any amount.
Download this release

Release Info

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

Code changes from version 3.4 to 3.6

Files changed (3) hide show
  1. WP_Accept_Paypal_Payment.php +30 -19
  2. readme.txt +12 -3
  3. shortcode_view.php +59 -2
WP_Accept_Paypal_Payment.php CHANGED
@@ -1,34 +1,45 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Easy Paypal Payment Accept
4
- Version: v3.4
5
- Plugin URI: http://www.tipsandtricks-hq.com/?p=120
6
  Author: Tips and Tricks HQ
7
  Author URI: http://www.tipsandtricks-hq.com/
8
  Description: Easy to use Wordpress plugin to accept paypal payment for a service or product or donation in one click. Can be used in the sidebar, posts and pages.
9
  License: GPL2
10
  */
11
 
12
- define('WP_PAYPAL_PAYMENT_ACCEPT_PLUGIN_VERSION', '3.4');
13
 
14
  include_once('shortcode_view.php');
15
 
16
- // Some default options
17
- add_option('wp_pp_payment_email', 'korin.iverson@gmail.com');
18
- add_option('paypal_payment_currency', 'USD');
19
- add_option('wp_pp_payment_subject', 'Plugin Service Payment');
20
- add_option('wp_pp_payment_item1', 'Basic Service - $10');
21
- add_option('wp_pp_payment_value1', '10');
22
- add_option('wp_pp_payment_item2', 'Gold Service - $20');
23
- add_option('wp_pp_payment_value2', '20');
24
- add_option('wp_pp_payment_item3', 'Platinum Service - $30');
25
- add_option('wp_pp_payment_value3', '30');
26
- add_option('wp_paypal_widget_title_name', 'Paypal Payment');
27
- add_option('payment_button_type', 'https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif');
28
- add_option('wp_pp_show_other_amount', '-1');
29
- add_option('wp_pp_show_ref_box', '1');
30
- add_option('wp_pp_ref_title', 'Your Email Address');
31
- add_option('wp_pp_return_url', home_url());
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  add_shortcode('wp_paypal_payment_box', 'wpapp_buy_now_button_shortcode' );
34
  function wpapp_buy_now_button_shortcode($args)
1
  <?php
2
  /*
3
  Plugin Name: WP Easy Paypal Payment Accept
4
+ Version: v3.6
5
+ Plugin URI: http://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120
6
  Author: Tips and Tricks HQ
7
  Author URI: http://www.tipsandtricks-hq.com/
8
  Description: Easy to use Wordpress plugin to accept paypal payment for a service or product or donation in one click. Can be used in the sidebar, posts and pages.
9
  License: GPL2
10
  */
11
 
12
+ define('WP_PAYPAL_PAYMENT_ACCEPT_PLUGIN_VERSION', '3.6');
13
 
14
  include_once('shortcode_view.php');
15
 
16
+ function wp_pp_plugin_install ()
17
+ {
18
+ // Some default options
19
+ add_option('wp_pp_payment_email', get_bloginfo('admin_email'));
20
+ add_option('paypal_payment_currency', 'USD');
21
+ add_option('wp_pp_payment_subject', 'Plugin Service Payment');
22
+ add_option('wp_pp_payment_item1', 'Basic Service - $10');
23
+ add_option('wp_pp_payment_value1', '10');
24
+ add_option('wp_pp_payment_item2', 'Gold Service - $20');
25
+ add_option('wp_pp_payment_value2', '20');
26
+ add_option('wp_pp_payment_item3', 'Platinum Service - $30');
27
+ add_option('wp_pp_payment_value3', '30');
28
+ add_option('wp_paypal_widget_title_name', 'Paypal Payment');
29
+ add_option('payment_button_type', 'https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif');
30
+ add_option('wp_pp_show_other_amount', '-1');
31
+ add_option('wp_pp_show_ref_box', '1');
32
+ add_option('wp_pp_ref_title', 'Your Email Address');
33
+ add_option('wp_pp_return_url', home_url());
34
+ }
35
+ register_activation_hook(__FILE__,'wp_pp_plugin_install');
36
+
37
+ add_shortcode('wp_paypal_payment_box_for_any_amount', 'wpapp_buy_now_any_amt_handler');
38
+ function wpapp_buy_now_any_amt_handler($args)
39
+ {
40
+ $output = wppp_render_paypal_button_with_other_amt($args);
41
+ return $output;
42
+ }
43
 
44
  add_shortcode('wp_paypal_payment_box', 'wpapp_buy_now_button_shortcode' );
45
  function wpapp_buy_now_button_shortcode($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, buy now
5
  Requires at least: 3.0
6
- Tested up to: 3.7
7
- Stable tag: 3.4
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
@@ -30,6 +30,8 @@ For information, detailed documentation, video tutorial and updates, please visi
30
  * Create a payment button widget to accept payment in any currency accepted by PayPal.
31
  * Ability to specify a payment subject for each paypal payment widget.
32
  * Ability to specify a custom button image for the payment button.
 
 
33
 
34
  == Usage ==
35
 
@@ -55,6 +57,13 @@ Visit the plugin site at http://www.tipsandtricks-hq.com/?p=120 for screenshots.
55
 
56
  == Changelog ==
57
 
 
 
 
 
 
 
 
58
  = 3.4 =
59
  - Added an option to specify a custom button image for the payment button. You can use the "button_image" parameter in the shortcode to use a customized image for the buy button.
60
 
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, payment
5
  Requires at least: 3.0
6
+ Tested up to: 3.8.1
7
+ Stable tag: 3.6
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
30
  * Create a payment button widget to accept payment in any currency accepted by PayPal.
31
  * Ability to specify a payment subject for each paypal payment widget.
32
  * Ability to specify a custom button image for the payment button.
33
+ * Ability to specify a cancel URL for the payment widget.
34
+ * Create a payment widget to accept any amount from your customer.
35
 
36
  == Usage ==
37
 
57
 
58
  == Changelog ==
59
 
60
+ = 3.6 =
61
+ - Added the ability to specify a cancel URL using the "cancel_url" parameter in the shortcode
62
+ - Added a new shortcode that allows you to create a payment widget for any amount.
63
+
64
+ = 3.5 =
65
+ - WordPress 3.8 compatibility
66
+
67
  = 3.4 =
68
  - Added an option to specify a custom button image for the payment button. You can use the "button_image" parameter in the shortcode to use a customized image for the buy button.
69
 
shortcode_view.php CHANGED
@@ -1,5 +1,58 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  function wppp_render_paypal_button_form($args)
4
  {
5
  extract( shortcode_atts( array(
@@ -11,7 +64,8 @@ function wppp_render_paypal_button_form($args)
11
  'other_amount' => '',
12
  'country_code' => '',
13
  'payment_subject' => '',
14
- 'button_image' => ''
 
15
  ), $args));
16
 
17
  $options = explode( '|' , $options);
@@ -66,7 +120,10 @@ function wppp_render_paypal_button_form($args)
66
  <input type="hidden" name="amount" value="">
67
  <input type="hidden" name="return" value="<?php echo $return; ?>" />
68
  <input type="hidden" name="email" value="" />
69
- <?php
 
 
 
70
  if(!empty($country_code)){
71
  echo '<input type="hidden" name="lc" value="'.$country_code.'" />';
72
  }
1
  <?php
2
 
3
+ function wppp_render_paypal_button_with_other_amt($args)
4
+ {
5
+ extract( shortcode_atts( array(
6
+ 'email' => '',
7
+ 'description' => '',
8
+ 'currency' => 'USD',
9
+ 'return' => site_url(),
10
+ 'country_code' => '',
11
+ 'button_image' => '',
12
+ 'cancel_url' => '',
13
+ ), $args));
14
+
15
+ $output = "";
16
+ $payment_button_img_src = get_option('payment_button_type');
17
+ if(!empty($button_image)){
18
+ $payment_button_img_src = $button_image;
19
+ }
20
+
21
+ if(empty($email)){
22
+ $output = '<p style="color: red;">Error! Please enter your PayPal email address for the payment using the "email" parameter in the shortcode</p>';
23
+ return $output;
24
+ }
25
+
26
+ if(empty($description)){
27
+ $output = '<p style="color: red;">Error! Please enter a description for the payment using the "description" parameter in the shortcode</p>';
28
+ return $output;
29
+ }
30
+
31
+ $output .= '<div class="wp_paypal_button_widget_any_amt">';
32
+ $output .= '<form name="_xclick" class="wp_accept_pp_button_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
33
+
34
+ $output .= 'Amount: <input type="text" name="amount" value="" size="5">';
35
+
36
+ $output .= '<input type="hidden" name="cmd" value="_xclick">';
37
+ $output .= '<input type="hidden" name="business" value="'.$email.'">';
38
+ $output .= '<input type="hidden" name="currency_code" value="'.$currency.'">';
39
+ $output .= '<input type="hidden" name="item_name" value="'.stripslashes($description).'">';
40
+ $output .= '<input type="hidden" name="return" value="'.$return.'" />';
41
+ if(!empty($cancel_url)){
42
+ $output .= '<input type="hidden" name="cancel_return" value="'.$cancel_url.'" />';
43
+ }
44
+ if(!empty($country_code)){
45
+ $output .= '<input type="hidden" name="lc" value="'.$country_code.'" />';
46
+ }
47
+
48
+ $output .= '<div class="wp_pp_button_submit_btn">';
49
+ $output .= '<input type="image" id="buy_now_button" src="'.$payment_button_img_src.'" border="0" name="submit" alt="Make payments with PayPal">';
50
+ $output .= '</div>';
51
+ $output .= '</form>';
52
+ $output .= '</div>';
53
+ return $output;
54
+ }
55
+
56
  function wppp_render_paypal_button_form($args)
57
  {
58
  extract( shortcode_atts( array(
64
  'other_amount' => '',
65
  'country_code' => '',
66
  'payment_subject' => '',
67
+ 'button_image' => '',
68
+ 'cancel_url' => '',
69
  ), $args));
70
 
71
  $options = explode( '|' , $options);
120
  <input type="hidden" name="amount" value="">
121
  <input type="hidden" name="return" value="<?php echo $return; ?>" />
122
  <input type="hidden" name="email" value="" />
123
+ <?php
124
+ if(!empty($cancel_url)){
125
+ echo '<input type="hidden" name="cancel_return" value="'.$cancel_url.'" />';
126
+ }
127
  if(!empty($country_code)){
128
  echo '<input type="hidden" name="lc" value="'.$country_code.'" />';
129
  }