WP Easy Paypal Payment Accept - Version 3.2

Version Description

Added an option in the shortcode to set the country code to be used for the PayPal checkout page language.

Download this release

Release Info

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

Code changes from version 3.1 to 3.2

Files changed (3) hide show
  1. WP_Accept_Paypal_Payment.php +8 -36
  2. readme.txt +10 -3
  3. shortcode_view.php +34 -2
WP_Accept_Paypal_Payment.php CHANGED
@@ -1,25 +1,17 @@
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/
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
  */
10
 
11
- /*
12
- This program is free software; you can redistribute it
13
- under the terms of the GNU General Public License version 2,
14
- as published by the Free Software Foundation.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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,28 +31,10 @@ 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)
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 = '';
54
- foreach( $options as $option ) {
55
- $option = explode( ':' , $option );
56
- $name = esc_attr( $option[0] );
57
- $price = esc_attr( $option[1] );
58
- $html_options .= "<option data-product_name='{$name}' value='{$price}'>{$name} - {$price}</option>";
59
-
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;
@@ -188,8 +162,6 @@ function paypal_payment_add_option_pages() {
188
 
189
  function paypal_payment_options_page() {
190
 
191
- global $wp_paypal_payment_version;
192
-
193
  if (isset($_POST['info_update']))
194
  {
195
  echo '<div id="message" class="updated fade"><p><strong>';
@@ -227,7 +199,7 @@ function paypal_payment_options_page() {
227
 
228
  <div class=wrap>
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 />
1
  <?php
2
  /*
3
  Plugin Name: WP Easy Paypal Payment Accept
4
+ Version: v3.2
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.2');
 
 
 
 
 
 
 
 
 
13
 
14
+ include_once('shortcode_view.php');
15
 
16
  // Some default options
17
  add_option('wp_pp_payment_email', 'korin.iverson@gmail.com');
31
  add_option('wp_pp_return_url', get_bloginfo('home'));
32
 
33
  add_shortcode('wp_paypal_payment_box', 'wpapp_buy_now_button_shortcode' );
34
+ function wpapp_buy_now_button_shortcode($args)
35
  {
36
+ ob_start();
37
+ wppp_render_paypal_button_form($args);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  $output = ob_get_contents();
39
  ob_end_clean();
40
  return $output;
162
 
163
  function paypal_payment_options_page() {
164
 
 
 
165
  if (isset($_POST['info_update']))
166
  {
167
  echo '<div id="message" class="updated fade"><p><strong>';
199
 
200
  <div class=wrap>
201
 
202
+ <h2>Accept Paypal Payment Settings v <?php echo WP_PAYPAL_PAYMENT_ACCEPT_PLUGIN_VERSION; ?></h2>
203
 
204
  <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;">
205
  For usage documentation and updates, please visit the plugin page at the following URL:<br />
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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
@@ -23,7 +23,10 @@ For information, detailed documentation and updates, please visit the [WordPress
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,6 +52,9 @@ Visit the plugin site at http://www.tipsandtricks-hq.com/?p=120 for screenshots.
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
 
@@ -56,4 +62,5 @@ Added an option to specify a different amount (any amount your user whish to pay
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
 
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.2
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
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
+ * Add PayPal Buy Now buttons anywhere on a WordPress post or a page.
28
+ * Ability to set the country code to use a particular language for the PayPal checkout page.
29
+ * Create a payment button widget to accept payment in any currency accepted by PayPal.
30
 
31
  == Usage ==
32
 
52
 
53
  == Changelog ==
54
 
55
+ = 3.2 =
56
+ Added an option in the shortcode to set the country code to be used for the PayPal checkout page language.
57
+
58
  = 3.1 =
59
  Added an option to specify a different amount (any amount your user whish to pay) via the shortcode.
60
 
62
  WordPress 3.6 compatibility update
63
 
64
  Changelog for old versions can be found at the following URL
65
+ http://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120
66
+
shortcode_view.php CHANGED
@@ -1,3 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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">
@@ -26,6 +52,11 @@
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>
@@ -40,7 +71,6 @@ margin-bottom: 10px;
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){
@@ -57,4 +87,6 @@ jQuery(document).ready(function($) {
57
  return;
58
  });
59
  });
60
- </script>
 
 
1
+ <?php
2
+
3
+ function wppp_render_paypal_button_form($args)
4
+ {
5
+ extract( shortcode_atts( array(
6
+ 'email' => 'your@paypal-email.com',
7
+ 'currency' => 'USD',
8
+ 'options' => 'Payment for Service 1:15.50|Payment for Service 2:30.00|Payment for Service 3:47.00',
9
+ 'return' => site_url(),
10
+ 'reference' => 'Your Email Address',
11
+ 'other_amount' => '',
12
+ 'country_code' => '',
13
+ ), $args));
14
+
15
+ $options = explode( '|' , $options);
16
+ $html_options = '';
17
+ foreach( $options as $option ) {
18
+ $option = explode( ':' , $option );
19
+ $name = esc_attr( $option[0] );
20
+ $price = esc_attr( $option[1] );
21
+ $html_options .= "<option data-product_name='{$name}' value='{$price}'>{$name} - {$price}</option>";
22
+ }
23
+
24
+ $payment_button_img_src = get_option('payment_button_type');
25
+
26
+ ?>
27
  <div class="wp_paypal_button_widget">
28
  <form name="_xclick" class="wp_accept_pp_button_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
29
  <div class="wp_pp_button_selection_section">
52
  <input type="hidden" name="amount" value="">
53
  <input type="hidden" name="return" value="<?php echo $return; ?>" />
54
  <input type="hidden" name="email" value="" />
55
+ <?php
56
+ if(!empty($country_code)){
57
+ echo '<input type="hidden" name="lc" value="'.$country_code.'" />';
58
+ }
59
+ ?>
60
  <div class="wp_pp_button_submit_btn">
61
  <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!">
62
  </div>
71
  margin: 10px 0;
72
  }
73
  </style>
 
74
  <script type="text/javascript">
75
  jQuery(document).ready(function($) {
76
  $('.wp_accept_pp_button_form').submit(function(e){
87
  return;
88
  });
89
  });
90
+ </script>
91
+ <?php
92
+ }