PayPal Buy Now Button - Version 1.7.2

Version Description

  • 3/30/17
  • Update - Fix - Fixed code formatting issues
  • Update - Update - Updated feature list
  • Update - Update - Updated WordPress tested version
Download this release

Release Info

Developer scottpaterson
Plugin Icon 128x128 PayPal Buy Now Button
Version 1.7.2
Comparing to
See all releases

Code changes from version 1.7.1 to 1.7.2

Files changed (2) hide show
  1. readme.txt +25 -8
  2. wp-ecommerce-paypal.php +561 -583
readme.txt CHANGED
@@ -4,8 +4,9 @@ Donate link: https://wpplugin.org/donate/
4
  Tags: PayPal, gateway, paypal button
5
  Author URI: https://wpplugin.org
6
  Requires at least: 3.0
7
- Tested up to: 4.7
8
- Stable tag: 1.7.1
 
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -16,6 +17,10 @@ Add a PayPal Buy Now Button to your website and start selling with PayPal today.
16
 
17
  This PayPal plugin will allow you to sell products or services on your website using a PayPal Buy Now Button.
18
 
 
 
 
 
19
  You can place a PayPal Buy Now button anywhere on your site where you want to sell something. Your customers can use their PayPal account to pay for your products or services or they can pay by Debit or Credit Card.
20
 
21
  What makes this PayPal plugin powerful is its simplicity. You don't have to spend days setting up an eCommerce Solution. Just install this PayPal plugin and in just a few minutes customers from around the world can start buying products or services from your website using PayPal.
@@ -45,20 +50,20 @@ WPPlugin is an offical PayPal Partner based in Boulder, Colorado. You can visit
45
  > #### PayPal Buy Now Button Pro
46
  > We offer a Pro version of this PayPal plugin for business owners who need more features.<br />
47
  >
48
- > * Manage PayPal buttons in a central location
49
- > * View sales in your Admin Page
50
  > * Coupons <br />
51
  > * Inventory Management <br />
52
  > * Charge Fixed Tax <br />
53
  > * Charge Tax Rate <br />
54
- > * Charge Shipping & Handling per item<br />
55
  > * Price Dropdown Menu<br />
56
  > * Text Dropdown Menu<br />
57
  > * Show Price Beside Button <br />
58
  > * Show Name Beside Button <br />
59
- > * Set a Quantity per item <br />
60
- > * Apply a Fixed Discount per item <br />
61
- > * Apply a Discount Rate per item<br />
62
  > * Add an Item ID or SKU<br />
63
  > * Hide Customer's Custom Note Field<br />
64
  > * Change PayPal's Return to Merchant Text<br />
@@ -99,6 +104,12 @@ Yes, there is no limit to the amount of PayPal Buy Now buttons you can put on on
99
 
100
  == Changelog ==
101
 
 
 
 
 
 
 
102
  = 1.7.1 =
103
  * 8/20/16
104
  * Update - Feature - Added notice above Buy Now button if the plugin doesn't have a PayPal account set on the settings page.
@@ -185,6 +196,12 @@ Yes, there is no limit to the amount of PayPal Buy Now buttons you can put on on
185
 
186
  == Upgrade Notice ==
187
 
 
 
 
 
 
 
188
  = 1.7.1 =
189
  * 8/20/16
190
  * Update - Feature - Added notice above Buy Now button if the plugin doesn't have a PayPal account set on the settings page.
4
  Tags: PayPal, gateway, paypal button
5
  Author URI: https://wpplugin.org
6
  Requires at least: 3.0
7
+ Tested up to: 4.9
8
+ Requires PHP: 5.4
9
+ Stable tag: 1.7.2
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
17
 
18
  This PayPal plugin will allow you to sell products or services on your website using a PayPal Buy Now Button.
19
 
20
+ Watch this 1 minute video of how the plugin works:
21
+
22
+ [youtube https://www.youtube.com/watch?v=lWlAmYeoP68]
23
+
24
  You can place a PayPal Buy Now button anywhere on your site where you want to sell something. Your customers can use their PayPal account to pay for your products or services or they can pay by Debit or Credit Card.
25
 
26
  What makes this PayPal plugin powerful is its simplicity. You don't have to spend days setting up an eCommerce Solution. Just install this PayPal plugin and in just a few minutes customers from around the world can start buying products or services from your website using PayPal.
50
  > #### PayPal Buy Now Button Pro
51
  > We offer a Pro version of this PayPal plugin for business owners who need more features.<br />
52
  >
53
+ > * Manage PayPal buttons in a Central Location
54
+ > * View Sales in your Admin
55
  > * Coupons <br />
56
  > * Inventory Management <br />
57
  > * Charge Fixed Tax <br />
58
  > * Charge Tax Rate <br />
59
+ > * Charge Shipping & Handling Per Item<br />
60
  > * Price Dropdown Menu<br />
61
  > * Text Dropdown Menu<br />
62
  > * Show Price Beside Button <br />
63
  > * Show Name Beside Button <br />
64
+ > * Set a Quantity Per Item <br />
65
+ > * Apply a Fixed Discount Per Item <br />
66
+ > * Apply a Discount Rate Per Item<br />
67
  > * Add an Item ID or SKU<br />
68
  > * Hide Customer's Custom Note Field<br />
69
  > * Change PayPal's Return to Merchant Text<br />
104
 
105
  == Changelog ==
106
 
107
+ = 1.7.2 =
108
+ * 3/30/17
109
+ * Update - Fix - Fixed code formatting issues
110
+ * Update - Update - Updated feature list
111
+ * Update - Update - Updated WordPress tested version
112
+
113
  = 1.7.1 =
114
  * 8/20/16
115
  * Update - Feature - Added notice above Buy Now button if the plugin doesn't have a PayPal account set on the settings page.
196
 
197
  == Upgrade Notice ==
198
 
199
+ = 1.7.2 =
200
+ * 3/30/17
201
+ * Update - Fix - Fixed code formatting issues
202
+ * Update - Update - Updated feature list
203
+ * Update - Update - Updated WordPress tested version
204
+
205
  = 1.7.1 =
206
  * 8/20/16
207
  * Update - Feature - Added notice above Buy Now button if the plugin doesn't have a PayPal account set on the settings page.
wp-ecommerce-paypal.php CHANGED
@@ -8,10 +8,10 @@ Tags: PayPal payment, PayPal, button, payment, online payments, pay now, buy now
8
  Author: Scott Paterson
9
  Author URI: https://wpplugin.org
10
  License: GPL2
11
- Version: 1.7.1
12
  */
13
 
14
- /* Copyright 2014-2016 Scott Paterson
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
@@ -36,64 +36,62 @@ global $pagenow, $typenow;
36
  // add media button for editor page
37
  if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) && $typenow != 'download' ) {
38
 
39
-
40
-
41
- add_action('media_buttons', 'wpecpp_add_my_media_button', 20);
42
- function wpecpp_add_my_media_button() {
43
- echo '<a href="#TB_inline?width=600&height=400&inlineId=wpecpp_popup_container" title="PayPal Button" id="insert-my-media" class="button thickbox">PayPal Button</a>';
44
- }
45
-
46
- add_action( 'admin_footer', 'wpecpp_add_inline_popup_content' );
47
- function wpecpp_add_inline_popup_content() {
48
- ?>
49
-
50
-
51
-
52
- <script type="text/javascript">
53
- function wpecpp_InsertShortcode(){
54
-
55
- var wpecpp_scname = document.getElementById("wpecpp_scname").value;
56
- var wpecpp_scprice = document.getElementById("wpecpp_scprice").value;
57
- var wpecpp_alignmentc = document.getElementById("wpecpp_alignment");
58
- var wpecpp_alignmentb = wpecpp_alignmentc.options[wpecpp_alignmentc.selectedIndex].value;
59
-
60
- if(!wpecpp_scname.match(/\S/)) { alert("Item Name is required."); return false; }
61
- if(!wpecpp_scprice.match(/\S/)) { alert("Item Price is required."); return false; }
62
- if(wpecpp_alignmentb == "none") { var wpecpp_alignment = ""; } else { var wpecpp_alignment = ' align="' + wpecpp_alignmentb + '"'; };
63
-
64
- document.getElementById("wpecpp_scname").value = "";
65
- document.getElementById("wpecpp_scprice").value = "";
66
- wpecpp_alignmentc.selectedIndex = null;
67
-
68
- window.send_to_editor('[wpecpp name="' + wpecpp_scname + '" price="' + wpecpp_scprice + '"' + wpecpp_alignment + ']');
69
- }
70
- </script>
71
-
72
-
73
- <div id="wpecpp_popup_container" style="display:none;">
74
-
75
- <h2>Insert a Buy Now Button</h2>
76
-
77
- <table><tr><td>
78
-
79
- Item Name: </td><td><input type="text" name="wpecpp_scname" id="wpecpp_scname" value="">The name of the item</td><td></td></tr><tr><td>
80
- Item Price: </td><td><input type="text" name="wpecpp_scprice" id="wpecpp_scprice" value=""> Example format: 6.99</td><td></td></tr><tr><td>
81
- Alignment: </td><td><select name="wpecpp_alignment" id="wpecpp_alignment"><option value="none"></option><option value="left">Left</option><option value="center">Center</option><option value="right">Right</option></select>
82
- Optional</td><td></td></tr><tr><td>
83
-
84
- </td></tr><tr><td>
85
-
86
- <br />
87
- </td></tr><tr><td>
88
-
89
- <input type="button" id="wpecpp-insert" class="button-primary" onclick="wpecpp_InsertShortcode();" value="Insert">
90
- <br /><br />
91
-
92
- </td></tr></table>
93
-
94
- </div>
95
- <?php
96
- }
97
  }
98
 
99
 
@@ -110,34 +108,34 @@ register_uninstall_hook( __FILE__, "wpecpp_uninstall" );
110
 
111
  function wpecpp_activate() {
112
 
113
- $wpecpp_settingsoptions = array(
114
- 'currency' => '25',
115
- 'language' => '3',
116
- 'liveaccount' => '',
117
- 'sandboxaccount' => '',
118
- 'mode' => '2',
119
- 'size' => '2',
120
- 'opens' => '2',
121
- 'cancel' => '',
122
- 'return' => '',
123
- 'note' => '1',
124
- 'tax_rate' => '',
125
- 'tax' => '',
126
- 'weight_unit' => '1',
127
- 'cbt' => '',
128
- 'upload_image' => '',
129
- 'showprice' => '2',
130
- 'showname' => '2',
131
- 'paymentaction' => '1'
132
- );
133
-
134
- add_option("wpecpp_settingsoptions", $wpecpp_settingsoptions);
135
 
136
  }
137
 
138
 
139
  function wpecpp_deactivate() {
140
- delete_option("wpecpp_my_plugin_notice_shown");
141
  }
142
 
143
  function wpecpp_uninstall() {
@@ -150,10 +148,10 @@ function wpecpp_uninstall() {
150
  add_action('admin_notices', 'wpecpp_my_plugin_admin_notices');
151
 
152
  function wpecpp_my_plugin_admin_notices() {
153
- if (!get_option('wpecpp_my_plugin_notice_shown')) {
154
- echo "<div class='updated'><p><a href='admin.php?page=wp-ecommerce-settings'>Click here to view the plugin settings</a>.</p></div>";
155
- update_option("wpecpp_my_plugin_notice_shown", "true");
156
- }
157
  }
158
 
159
 
@@ -165,31 +163,33 @@ update_option("wpecpp_my_plugin_notice_shown", "true");
165
  add_action( "admin_menu", "wpecpp_plugin_menu" );
166
 
167
  function wpecpp_plugin_menu() {
168
- add_options_page( "PayPal Button", "PayPal Button", "manage_options", "wp-ecommerce-settings", "wpecpp_plugin_options" );
169
  }
170
  add_filter('plugin_action_links', 'wpecpp_myplugin_plugin_action_links', 10, 2);
171
 
172
  function wpecpp_myplugin_plugin_action_links($links, $file) {
173
- static $this_plugin;
174
- if (!$this_plugin) {
175
- $this_plugin = plugin_basename(__FILE__);
176
- }
177
- if ($file == $this_plugin) {
178
- $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=wp-ecommerce-settings">Settings</a>';
179
- array_unshift($links, $settings_link);
180
- }
181
- return $links;
 
 
 
182
  }
183
 
184
- function wpecpp_plugin_settings_link($links)
185
- {
186
- unset($links['edit']);
187
 
188
- $forum_link = '<a target="_blank" href="https://wordpress.org/support/plugin/wp-ecommerce-paypal">' . __('Support', 'PTP_LOC') . '</a>';
189
- $premium_link = '<a target="_blank" href="https://wpplugin.org/downloads/easy-paypal-buy-now-button/">' . __('Purchase Premium', 'PTP_LOC') . '</a>';
190
- array_push($links, $forum_link);
191
- array_push($links, $premium_link);
192
- return $links;
193
  }
194
 
195
  $plugin = plugin_basename(__FILE__);
@@ -198,305 +198,286 @@ add_filter("plugin_action_links_$plugin", 'wpecpp_plugin_settings_link' );
198
 
199
 
200
  function wpecpp_plugin_options() {
201
- if ( !current_user_can( "manage_options" ) ) {
202
- wp_die( __( "You do not have sufficient permissions to access this page." ) );
203
- }
 
204
 
 
205
 
206
 
207
 
208
 
 
 
 
209
 
210
- // settings page
211
 
 
 
212
 
 
 
 
 
 
 
 
 
 
 
 
 
213
 
 
 
 
214
 
215
- echo "<table width='100%'><tr><td width='70%'><br />";
216
- echo "<label style='color: #000;font-size:18pt;'><center>PayPal Buy Now Button Settings</center></label>";
217
- echo "<form method='post' action='".$_SERVER["REQUEST_URI"]."'>";
218
 
 
 
 
219
 
220
- // save and update options
221
- if (isset($_POST['update'])) {
222
 
223
- $options['currency'] = $_POST['currency'];
224
- $options['language'] = $_POST['language'];
225
- $options['liveaccount'] = $_POST['liveaccount'];
226
- $options['sandboxaccount'] = $_POST['sandboxaccount'];
227
- $options['mode'] = $_POST['mode'];
228
- $options['size'] = $_POST['size'];
229
- $options['opens'] = $_POST['opens'];
230
- $options['cancel'] = $_POST['cancel'];
231
- $options['return'] = $_POST['return'];
232
- $options['paymentaction'] = $_POST['paymentaction'];
233
 
234
 
235
- update_option("wpecpp_settingsoptions", $options);
236
 
237
- echo "<br /><div class='updated'><p><strong>"; _e("Settings Updated."); echo "</strong></p></div>";
238
 
239
- }
240
 
 
 
 
241
 
242
- // get options
243
- $options = get_option('wpecpp_settingsoptions');
244
- foreach ($options as $k => $v ) { $value[$k] = $v; }
245
-
246
-
247
- echo "</td><td></td></tr><tr><td>";
248
-
249
-
250
-
251
-
252
-
253
- // form
254
- echo "<br />";
255
- ?>
256
-
257
- <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
258
- &nbsp; Usage
259
- </div><div style="background-color:#fff;border: 1px solid #E5E5E5;padding:5px;"><br />
260
-
261
- In a page or post editor you will see a new button called "PayPal Button" located above the text area beside the "Add Media" button. By using this you can
262
- create shortcodes which will show up as Buy Now button on your site.
263
- <br /><br />
264
-
265
- You can put the Buy Now buttons as many times in a page or post as you want, there is no limit. If you want to remove a Buy Now button, just remove the shortcode text in your page or post.
266
-
267
-
268
- <br /><br />
269
- </div><br /><br />
270
-
271
- <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
272
- &nbsp; Language & Currency
273
- </div><div style="background-color:#fff;border: 1px solid #E5E5E5;padding:5px;"><br />
274
-
275
- <b>Language:</b>
276
- <select name="language">
277
- <option <?php if ($value['language'] == "1") { echo "SELECTED"; } ?> value="1">Danish</option>
278
- <option <?php if ($value['language'] == "2") { echo "SELECTED"; } ?> value="2">Dutch</option>
279
- <option <?php if ($value['language'] == "3") { echo "SELECTED"; } ?> value="3">English</option>
280
- <option <?php if ($value['language'] == "20") { echo "SELECTED"; } ?> value="20">English - UK</option>
281
- <option <?php if ($value['language'] == "4") { echo "SELECTED"; } ?> value="4">French</option>
282
- <option <?php if ($value['language'] == "5") { echo "SELECTED"; } ?> value="5">German</option>
283
- <option <?php if ($value['language'] == "6") { echo "SELECTED"; } ?> value="6">Hebrew</option>
284
- <option <?php if ($value['language'] == "7") { echo "SELECTED"; } ?> value="7">Italian</option>
285
- <option <?php if ($value['language'] == "8") { echo "SELECTED"; } ?> value="8">Japanese</option>
286
- <option <?php if ($value['language'] == "9") { echo "SELECTED"; } ?> value="9">Norwgian</option>
287
- <option <?php if ($value['language'] == "10") { echo "SELECTED"; } ?> value="10">Polish</option>
288
- <option <?php if ($value['language'] == "11") { echo "SELECTED"; } ?> value="11">Portuguese</option>
289
- <option <?php if ($value['language'] == "12") { echo "SELECTED"; } ?> value="12">Russian</option>
290
- <option <?php if ($value['language'] == "13") { echo "SELECTED"; } ?> value="13">Spanish</option>
291
- <option <?php if ($value['language'] == "14") { echo "SELECTED"; } ?> value="14">Swedish</option>
292
- <option <?php if ($value['language'] == "15") { echo "SELECTED"; } ?> value="15">Simplified Chinese -China only</option>
293
- <option <?php if ($value['language'] == "16") { echo "SELECTED"; } ?> value="16">Traditional Chinese - Hong Kong only</option>
294
- <option <?php if ($value['language'] == "17") { echo "SELECTED"; } ?> value="17">Traditional Chinese - Taiwan only</option>
295
- <option <?php if ($value['language'] == "18") { echo "SELECTED"; } ?> value="18">Turkish</option>
296
- <option <?php if ($value['language'] == "19") { echo "SELECTED"; } ?> value="19">Thai</option>
297
- </select>
298
-
299
- PayPal currently supports 18 languages.
300
- <br /><br />
301
-
302
- <b>Currency:</b>
303
- <select name="currency">
304
- <option <?php if ($value['currency'] == "1") { echo "SELECTED"; } ?> value="1">Australian Dollar - AUD</option>
305
- <option <?php if ($value['currency'] == "2") { echo "SELECTED"; } ?> value="2">Brazilian Real - BRL</option>
306
- <option <?php if ($value['currency'] == "3") { echo "SELECTED"; } ?> value="3">Canadian Dollar - CAD</option>
307
- <option <?php if ($value['currency'] == "4") { echo "SELECTED"; } ?> value="4">Czech Koruna - CZK</option>
308
- <option <?php if ($value['currency'] == "5") { echo "SELECTED"; } ?> value="5">Danish Krone - DKK</option>
309
- <option <?php if ($value['currency'] == "6") { echo "SELECTED"; } ?> value="6">Euro - EUR</option>
310
- <option <?php if ($value['currency'] == "7") { echo "SELECTED"; } ?> value="7">Hong Kong Dollar - HKD</option>
311
- <option <?php if ($value['currency'] == "8") { echo "SELECTED"; } ?> value="8">Hungarian Forint - HUF</option>
312
- <option <?php if ($value['currency'] == "9") { echo "SELECTED"; } ?> value="9">Israeli New Sheqel - ILS</option>
313
- <option <?php if ($value['currency'] == "10") { echo "SELECTED"; } ?> value="10">Japanese Yen - JPY</option>
314
- <option <?php if ($value['currency'] == "11") { echo "SELECTED"; } ?> value="11">Malaysian Ringgit - MYR</option>
315
- <option <?php if ($value['currency'] == "12") { echo "SELECTED"; } ?> value="12">Mexican Peso - MXN</option>
316
- <option <?php if ($value['currency'] == "13") { echo "SELECTED"; } ?> value="13">Norwegian Krone - NOK</option>
317
- <option <?php if ($value['currency'] == "14") { echo "SELECTED"; } ?> value="14">New Zealand Dollar - NZD</option>
318
- <option <?php if ($value['currency'] == "15") { echo "SELECTED"; } ?> value="15">Philippine Peso - PHP</option>
319
- <option <?php if ($value['currency'] == "16") { echo "SELECTED"; } ?> value="16">Polish Zloty - PLN</option>
320
- <option <?php if ($value['currency'] == "17") { echo "SELECTED"; } ?> value="17">Pound Sterling - GBP</option>
321
- <option <?php if ($value['currency'] == "18") { echo "SELECTED"; } ?> value="18">Russian Ruble - RUB</option>
322
- <option <?php if ($value['currency'] == "19") { echo "SELECTED"; } ?> value="19">Singapore Dollar - SGD</option>
323
- <option <?php if ($value['currency'] == "20") { echo "SELECTED"; } ?> value="20">Swedish Krona - SEK</option>
324
- <option <?php if ($value['currency'] == "21") { echo "SELECTED"; } ?> value="21">Swiss Franc - CHF</option>
325
- <option <?php if ($value['currency'] == "22") { echo "SELECTED"; } ?> value="22">Taiwan New Dollar - TWD</option>
326
- <option <?php if ($value['currency'] == "23") { echo "SELECTED"; } ?> value="23">Thai Baht - THB</option>
327
- <option <?php if ($value['currency'] == "24") { echo "SELECTED"; } ?> value="24">Turkish Lira - TRY</option>
328
- <option <?php if ($value['currency'] == "25") { echo "SELECTED"; } ?> value="25">U.S. Dollar - USD</option>
329
- </select>
330
- PayPal currently supports 25 currencies.
331
- <br /><br /></div>
332
 
333
- <?php
 
 
334
 
 
335
 
336
- ?>
337
- <br /><br /><div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
338
- &nbsp; PayPal Account </div><div style="background-color:#fff;border: 1px solid #E5E5E5;padding:5px;"><br />
339
 
340
- <?php
 
341
 
342
- echo "<b>Live Account: </b><input type='text' name='liveaccount' value='".$value['liveaccount']."'> Required";
343
- echo "<br />Enter a valid Merchant account ID (strongly recommend) or PayPal account email address. All payments will go to this account.";
344
- echo "<br /><br />You can find your Merchant account ID in your PayPal account under Profile -> My business info -> Merchant account ID";
345
 
346
- echo "<br /><br />If you don't have a PayPal account, you can sign up for free at <a target='_blank' href='https://paypal.com'>PayPal</a>. <br /><br />";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
 
 
 
348
 
349
- echo "<b>Sandbox Account: </b><input type='text' name='sandboxaccount' value='".$value['sandboxaccount']."'> Optional";
350
- echo "<br />Enter a valid sandbox PayPal account email address. A Sandbox account is a PayPal accont with fake money used for testing. This is useful to make sure your PayPal account and settings are working properly being going live.";
351
- echo "<br /><br />To create a Sandbox account, you first need a Developer Account. You can sign up for free at the <a target='_blank' href='https://www.paypal.com/webapps/merchantboarding/webflow/unifiedflow?execution=e1s2'>PayPal Developer</a> site. <br /><br />";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
 
353
- echo "Once you have made an account, create a Sandbox Business and Personal Account <a target='_blank' href='https://developer.paypal.com/webapps/developer/applications/accounts'>here</a>. Enter the Business acount email on this page and use the Personal account username and password to buy something on your site as a customer. <br /><br /><br />";
354
 
355
- echo "<b>Sandbox Mode:</b>";
356
- echo "&nbsp; &nbsp; <input "; if ($value['mode'] == "1") { echo "checked='checked'"; } echo " type='radio' name='mode' value='1'>On (Sandbox mode)";
357
- echo "&nbsp; &nbsp; <input "; if ($value['mode'] == "2") { echo "checked='checked'"; } echo " type='radio' name='mode' value='2'>Off (Live mode)";
358
 
359
- echo "<br /><br /><b>Payment Action:</b>";
360
- echo "&nbsp; &nbsp; <input "; if ($value['paymentaction'] == "1") { echo "checked='checked'"; } echo " type='radio' name='paymentaction' value='1'>Sale (Default)";
361
- echo "&nbsp; &nbsp; <input "; if ($value['paymentaction'] == "2") { echo "checked='checked'"; } echo " type='radio' name='paymentaction' value='2'>Authorize (Learn more <a target='_blank' href='https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/authcapture/'>here</a>)";
362
 
363
- echo "<br /><br /></div>";
364
 
 
 
 
365
 
 
366
 
367
- ?>
368
 
369
- <br /><br />
370
- <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
371
- &nbsp; Other Settings
372
- </div><div style="background-color:#fff;border: 1px solid #E5E5E5;padding:5px;"><br />
373
 
374
- <?php
375
- echo "<table><tr><td valign='top'>";
376
 
 
 
 
377
 
 
 
 
378
 
 
379
 
380
- echo "<b>Button Size and type:</b></td><td valign='top' style='text-align: center;'>";
381
- echo "<input "; if ($value['size'] == "1") { echo "checked='checked'"; } echo " type='radio' name='size' value='1'>Small <br /><img src='https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif'></td><td valign='top' style='text-align: center;'>";
382
- echo "<input "; if ($value['size'] == "2") { echo "checked='checked'"; } echo " type='radio' name='size' value='2'>Big <br /><img src='https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif'></td><td valign='top' style='text-align: center;'>";
383
- echo "<input "; if ($value['size'] == "3") { echo "checked='checked'"; } echo " type='radio' name='size' value='3'>Big with credit cards <br /><img src='https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif'></td><td valign='top' style='text-align: center;'>";
384
- echo "<input "; if ($value['size'] == "5") { echo "checked='checked'"; } echo " type='radio' name='size' value='5'>Gold (English Only) <br /><img src='https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png'></td><td valign='top' style='text-align: center;'>";
385
 
386
 
 
387
 
 
 
 
 
388
 
389
- echo "</td></tr><tr><td><b>PayPal opens in:</b></td>";
390
- echo "<td><input "; if ($value['opens'] == "1") { echo "checked='checked'"; } echo " type='radio' name='opens' value='1'>Same window</td>";
391
- echo "<td><input "; if ($value['opens'] == "2") { echo "checked='checked'"; } echo " type='radio' name='opens' value='2'>New window</td></tr>";
392
 
393
 
394
 
395
- echo "</table><br /><br />";
396
 
 
 
 
 
 
397
 
398
 
399
- $siteurl = get_site_url();
400
 
401
- echo "<b>Cancel URL: </b>";
402
- echo "<input type='text' name='cancel' value='".$value['cancel']."'> Optional <br />";
403
- echo "If the customer goes to PayPal and clicks the cancel button, where do they go. Example: $siteurl/cancel. Max length: 1,024. <br /><br />";
404
 
405
- echo "<b>Return URL: </b>";
406
- echo "<input type='text' name='return' value='".$value['return']."'> Optional <br />";
407
- echo "If the customer goes to PayPal and successfully pays, where are they redirected to after. Example: $siteurl/thankyou. Max length: 1,024. <br /><br />";
408
 
409
- echo "Note: The Cancel and Return pages are not automatically created; /cancel and /thankyou are just possible example page names.";
410
 
411
 
412
- ?>
413
- <br /><br /></div>
414
 
415
- <input type='hidden' name='update'><br />
416
- <input type='submit' name='btn2' class='button-primary' style='font-size: 17px;line-height: 28px;height: 32px;' value='Save Settings'>
417
 
418
 
 
419
 
 
 
 
420
 
 
 
 
421
 
422
- <br /><br /><br />
423
 
424
 
425
- WPPlugin is an offical PayPal Partner. Various trademarks held by their respective owners.
 
426
 
 
 
427
 
428
- </form>
429
 
430
 
 
431
 
432
 
 
433
 
434
 
 
 
435
 
 
436
 
 
 
 
437
 
 
438
 
439
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
 
 
 
 
 
441
 
 
442
 
443
- </td><td width='5%'>
444
- </td><td width='24%' valign='top'>
445
 
446
- <br />
 
 
447
 
448
- <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
449
- &nbsp; PayPal Buy Now Button Pro
450
- </div>
451
 
452
- <div style="background-color:#fff;border: 1px solid #E5E5E5;padding:8px;">
453
 
 
454
 
455
- <center><label style="font-size:14pt;">With the Pro version you'll <br /> be able to: </label></center>
456
-
457
- <br />
458
- <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Add Dropdown Menus<br />
459
- <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Add Text Boxes<br />
460
- <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Charge Tax & Shipping <br />
461
- <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Add Item ID and SKU<br />
462
- <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Add Discounts <br />
463
- <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Change Quantity <br />
464
- <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Custom Button Image<br />
465
- <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> And More<br />
466
- <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Further Plugin Development <br />
467
 
468
- <br />
469
- <center><a target='_blank' href="https://wpplugin.org/downloads/easy-paypal-buy-now-button/" class='button-primary' style='font-size: 17px;line-height: 28px;height: 32px;'>Learn More</a></center>
470
- <br />
471
- </div>
472
 
473
- <br /><br />
474
 
 
475
 
476
- <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
477
- &nbsp; Quick Links
478
- </div>
479
 
480
- <div style="background-color:#fff;border: 1px solid #E5E5E5;padding:8px;"><br />
481
 
482
- <div class="dashicons dashicons-arrow-right" style="margin-bottom: 6px;"></div> <a target="_blank" href="https://wordpress.org/support/plugin/wp-ecommerce-paypal">Support Forum</a> <br />
483
-
484
- <div class="dashicons dashicons-arrow-right" style="margin-bottom: 6px;"></div> <a target="_blank" href="https://wpplugin.org/documentation/">FAQ</a> <br />
485
-
486
- <div class="dashicons dashicons-arrow-right" style="margin-bottom: 6px;"></div> <a target="_blank" href="https://wpplugin.org/downloads/easy-paypal-buy-now-button/">PayPal Button Pro</a> <br />
487
-
488
- <div class="dashicons dashicons-arrow-right" style="margin-bottom: 6px;"></div> <a target="_blank" href="https://wpplugin.org/ideas">Submit An Idea / Suggestion</a> <br /><br />
489
-
490
- </div>
491
-
492
- </td><td width='1%'>
493
-
494
- </td></tr></table>
495
-
496
-
497
- <?php
498
-
499
- // end settings page and required permissions
500
  }
501
 
502
 
@@ -509,278 +490,275 @@ WPPlugin is an offical PayPal Partner. Various trademarks held by their respecti
509
 
510
  add_shortcode('wpecpp', 'wpecpp_options');
511
 
512
-
513
  function wpecpp_options($atts) {
514
 
515
- // get shortcode user fields
516
- $atts = shortcode_atts(array('name' => 'Example Name','price' => '0.00','size' => '','align' => ''), $atts);
517
-
518
- // get settings page values
519
- $options = get_option('wpecpp_settingsoptions');
520
- foreach ($options as $k => $v ) { $value[$k] = $v; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
 
522
-
523
- // live of test mode
524
- if ($value['mode'] == "1") {
525
- $account = $value['sandboxaccount'];
526
- $path = "sandbox.paypal";
527
- } elseif ($value['mode'] == "2") {
528
- $account = $value['liveaccount'];
529
- $path = "paypal";
530
- }
531
-
532
- // payment action
533
- if ($value['paymentaction'] == "1") {
534
- $paymentaction = "sale";
535
- } elseif ($value['paymentaction'] == "2") {
536
- $paymentaction = "authorization";
537
- } else {
538
- $paymentaction = "sale";
539
  }
540
 
541
- // currency
542
- if ($value['currency'] == "1") { $currency = "AUD"; }
543
- if ($value['currency'] == "2") { $currency = "BRL"; }
544
- if ($value['currency'] == "3") { $currency = "CAD"; }
545
- if ($value['currency'] == "4") { $currency = "CZK"; }
546
- if ($value['currency'] == "5") { $currency = "DKK"; }
547
- if ($value['currency'] == "6") { $currency = "EUR"; }
548
- if ($value['currency'] == "7") { $currency = "HKD"; }
549
- if ($value['currency'] == "8") { $currency = "HUF"; }
550
- if ($value['currency'] == "9") { $currency = "ILS"; }
551
- if ($value['currency'] == "10") { $currency = "JPY"; }
552
- if ($value['currency'] == "11") { $currency = "MYR"; }
553
- if ($value['currency'] == "12") { $currency = "MXN"; }
554
- if ($value['currency'] == "13") { $currency = "NOK"; }
555
- if ($value['currency'] == "14") { $currency = "NZD"; }
556
- if ($value['currency'] == "15") { $currency = "PHP"; }
557
- if ($value['currency'] == "16") { $currency = "PLN"; }
558
- if ($value['currency'] == "17") { $currency = "GBP"; }
559
- if ($value['currency'] == "18") { $currency = "RUB"; }
560
- if ($value['currency'] == "19") { $currency = "SGD"; }
561
- if ($value['currency'] == "20") { $currency = "SEK"; }
562
- if ($value['currency'] == "21") { $currency = "CHF"; }
563
- if ($value['currency'] == "22") { $currency = "TWD"; }
564
- if ($value['currency'] == "23") { $currency = "THB"; }
565
- if ($value['currency'] == "24") { $currency = "TRY"; }
566
- if ($value['currency'] == "25") { $currency = "USD"; }
567
-
568
- // language
569
- if ($value['language'] == "1") {
570
- $language = "da_DK";
571
- $image = "https://www.paypalobjects.com/da_DK/i/btn/btn_buynow_SM.gif";
572
- $imageb = "https://www.paypalobjects.com/da_DK/i/btn/btn_buynow_LG.gif";
573
- $imagecc = "https://www.paypalobjects.com/da_DK/DK/i/btn/btn_buynowCC_LG.gif";
574
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
575
- } //Danish
576
-
577
- if ($value['language'] == "2") {
578
- $language = "nl_BE";
579
- $image = "https://www.paypalobjects.com/nl_NL/NL/i/btn/btn_buynow_SM.gif";
580
- $imageb = "https://www.paypalobjects.com/nl_NL/NL/i/btn/btn_buynow_LG.gif";
581
- $imagecc = "https://www.paypalobjects.com/nl_NL/NL/i/btn/btn_buynowCC_LG.gif";
582
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
583
- } //Dutch
584
-
585
- if ($value['language'] == "3") {
586
- $language = "EN_US";
587
- $image = "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif";
588
- $imageb = "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif";
589
- $imagecc = "https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif";
590
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
591
- } //English
592
-
593
- if ($value['language'] == "20") {
594
- $language = "en_GB";
595
- $image = "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif";
596
- $imageb = "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif";
597
- $imagecc = "https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif";
598
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
599
- } //English - UK
600
-
601
- if ($value['language'] == "4") {
602
- $language = "fr_CA";
603
- $image = "https://www.paypalobjects.com/fr_CA/i/btn/btn_buynow_SM.gif";
604
- $imageb = "https://www.paypalobjects.com/fr_CA/i/btn/btn_buynow_LG.gif";
605
- $imagecc = "https://www.paypalobjects.com/fr_CA/i/btn/btn_buynowCC_LG.gif";
606
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
607
- } //French
608
-
609
- if ($value['language'] == "5") {
610
- $language = "de_DE";
611
- $image = "https://www.paypalobjects.com/de_DE/DE/i/btn/btn_buynow_SM.gif";
612
- $imageb = "https://www.paypalobjects.com/de_DE/DE/i/btn/btn_buynow_LG.gif";
613
- $imagecc = "https://www.paypalobjects.com/de_DE/DE/i/btn/btn_buynowCC_LG.gif";
614
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
615
- } //German
616
-
617
- if ($value['language'] == "6") {
618
- $language = "he_IL";
619
- $image = "https://www.paypalobjects.com/he_IL/i/btn/btn_buynow_SM.gif";
620
- $imageb = "https://www.paypalobjects.com/he_IL/i/btn/btn_buynow_LG.gif";
621
- $imagecc = "https://www.paypalobjects.com/he_IL/IL/i/btn/btn_buynowCC_LG.gif";
622
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
623
- } //Hebrew
624
-
625
- if ($value['language'] == "7") {
626
- $language = "it_IT";
627
- $image = "https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynow_SM.gif";
628
- $imageb = "https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynow_LG.gif";
629
- $imagecc = "https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynowCC_LG.gif";
630
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
631
- } //Italian
632
-
633
- if ($value['language'] == "8") {
634
- $language = "ja_JP";
635
- $image = "https://www.paypalobjects.com/ja_JP/JP/i/btn/btn_buynow_SM.gif";
636
- $imageb = "https://www.paypalobjects.com/ja_JP/JP/i/btn/btn_buynow_LG.gif";
637
- $imagecc = "https://www.paypalobjects.com/ja_JP/JP/i/btn/btn_buynowCC_LG.gif";
638
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
639
- } //Japanese
640
-
641
- if ($value['language'] == "9") {
642
- $language = "no_NO";
643
- $image = "https://www.paypalobjects.com/no_NO/i/btn/btn_buynow_SM.gif";
644
- $imageb = "https://www.paypalobjects.com/no_NO/i/btn/btn_buynow_LG.gif";
645
- $imagecc = "https://www.paypalobjects.com/no_NO/NO/i/btn/btn_buynowCC_LG.gif";
646
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
647
- } //Norwgian
648
-
649
- if ($value['language'] == "10") {
650
- $language = "pl_PL";
651
- $image = "https://www.paypalobjects.com/pl_PL/PL/i/btn/btn_buynow_SM.gif";
652
- $imageb = "https://www.paypalobjects.com/pl_PL/PL/i/btn/btn_buynow_LG.gif";
653
- $imagecc = "https://www.paypalobjects.com/pl_PL/PL/i/btn/btn_buynowCC_LG.gif";
654
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
655
- } //Polish
656
-
657
- if ($value['language'] == "11") {
658
- $language = "pt_BR";
659
- $image = "https://www.paypalobjects.com/pt_PT/PT/i/btn/btn_buynow_SM.gif";
660
- $imageb = "https://www.paypalobjects.com/pt_PT/PT/i/btn/btn_buynow_LG.gif";
661
- $imagecc = "https://www.paypalobjects.com/pt_PT/PT/i/btn/btn_buynowCC_LG.gif";
662
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
663
- } //Portuguese
664
-
665
- if ($value['language'] == "12") {
666
- $language = "ru_RU";
667
- $image = "https://www.paypalobjects.com/ru_RU/i/btn/btn_buynow_SM.gif";
668
- $imageb = "https://www.paypalobjects.com/ru_RU/i/btn/btn_buynow_LG.gif";
669
- $imagecc = "https://www.paypalobjects.com/ru_RU/RU/i/btn/btn_buynowCC_LG.gif";
670
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
671
- } //Russian
672
-
673
- if ($value['language'] == "13") {
674
- $language = "es_ES";
675
- $image = "https://www.paypalobjects.com/es_ES/ES/i/btn/btn_buynow_SM.gif";
676
- $imageb = "https://www.paypalobjects.com/es_ES/ES/i/btn/btn_buynow_LG.gif";
677
- $imagecc = "https://www.paypalobjects.com/es_ES/ES/i/btn/btn_buynowCC_LG.gif";
678
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
679
- } //Spanish
680
-
681
- if ($value['language'] == "14") {
682
- $language = "sv_SE";
683
- $image = "https://www.paypalobjects.com/sv_SE/i/btn/btn_buynow_SM.gif";
684
- $imageb = "https://www.paypalobjects.com/sv_SE/i/btn/btn_buynow_LG.gif";
685
- $imagecc = "https://www.paypalobjects.com/sv_SE/SE/i/btn/btn_buynowCC_LG.gif";
686
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
687
- } //Swedish
688
-
689
- if ($value['language'] == "15") {
690
- $language = "zh_CN";
691
- $image = "https://www.paypalobjects.com/zh_XC/i/btn/btn_buynow_SM.gif";
692
- $imageb = "https://www.paypalobjects.com/zh_XC/i/btn/btn_buynow_LG.gif";
693
- $imagecc = "https://www.paypalobjects.com/zh_XC/C2/i/btn/btn_buynowCC_LG.gif";
694
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
695
- } //Simplified Chinese - China
696
-
697
- if ($value['language'] == "16") {
698
- $language = "zh_HK";
699
- $image = "https://www.paypalobjects.com/zh_HK/i/btn/btn_buynow_SM.gif";
700
- $imageb = "https://www.paypalobjects.com/zh_HK/i/btn/btn_buynow_LG.gif";
701
- $imagecc = "https://www.paypalobjects.com/zh_HK/HK/i/btn/btn_buynowCC_LG.gif";
702
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
703
- } //Traditional Chinese - Hong Kong
704
-
705
- if ($value['language'] == "17") {
706
- $language = "zh_TW";
707
- $image = "https://www.paypalobjects.com/zh_TW/TW/i/btn/btn_buynow_SM.gif";
708
- $imageb = "https://www.paypalobjects.com/zh_TW/TW/i/btn/btn_buynow_LG.gif";
709
- $imagecc = "https://www.paypalobjects.com/zh_TW/TW/i/btn/btn_buynowCC_LG.gif";
710
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
711
- } //Traditional Chinese - Taiwan
712
-
713
- if ($value['language'] == "18") {
714
- $language = "tr_TR";
715
- $image = "https://www.paypalobjects.com/tr_TR/i/btn/btn_buynow_SM.gif";
716
- $imageb = "https://www.paypalobjects.com/tr_TR/i/btn/btn_buynow_LG.gif";
717
- $imagecc = "https://www.paypalobjects.com/tr_TR/TR/i/btn/btn_buynowCC_LG.gif";
718
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
719
- } //Turkish
720
-
721
- if ($value['language'] == "19") {
722
- $language = "th_TH";
723
- $image = "https://www.paypalobjects.com/th_TH/i/btn/btn_buynow_SM.gif";
724
- $imageb = "https://www.paypalobjects.com/th_TH/i/btn/btn_buynow_LG.gif";
725
- $imagecc = "https://www.paypalobjects.com/th_TH/TH/i/btn/btn_buynowCC_LG.gif";
726
- $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
727
- } //Thai
728
-
729
- if (!empty($atts['size'])) {
730
- if ($atts['size'] == "1") { $img = $image; }
731
- if ($atts['size'] == "2") { $img = $imageb; }
732
- if ($atts['size'] == "3") { $img = $imagecc; }
733
- if ($atts['size'] == "5") { $img = $imagenew; }
734
- } else {
735
- if ($value['size'] == "1") { $img = $image; }
736
- if ($value['size'] == "2") { $img = $imageb; }
737
- if ($value['size'] == "3") { $img = $imagecc; }
738
- if ($value['size'] == "4") { $img = $value['upload_image']; }
739
- if ($value['size'] == "5") { $img = $imagenew; }
740
- }
741
-
742
- // window action
743
- if ($value['opens'] == "1") { $target = ""; }
744
- if ($value['opens'] == "2") { $target = "_blank"; }
745
-
746
- // alignment
747
- if ($atts['align'] == "left") { $alignment = "style='float: left;'"; }
748
- if ($atts['align'] == "right") { $alignment = "style='float: right;'"; }
749
- if ($atts['align'] == "center") { $alignment = "style='margin-left: auto;margin-right: auto;width:170px'"; }
750
-
751
- if (!isset($alignment)) { $alignment = ""; }
752
-
753
- if (!isset($note)) { $note = ""; }
754
-
755
-
756
-
757
- $output = "";
758
-
759
- if (empty($account)) {
760
- $output .= "(Please enter your PayPal Account or Merchant ID on the settings pages.)";
761
- }
762
-
763
- $output .= "<div $alignment>";
764
- $output .= "<form target='$target' action='https://www.$path.com/cgi-bin/webscr' method='post'>";
765
- $output .= "<input type='hidden' name='cmd' value='_xclick' />";
766
- $output .= "<input type='hidden' name='business' value='$account' />";
767
- $output .= "<input type='hidden' name='item_name' value='". $atts['name'] ."' />";
768
- $output .= "<input type='hidden' name='currency_code' value='$currency' />";
769
- $output .= "<input type='hidden' name='amount' value='". $atts['price'] ."' />";
770
- $output .= "<input type='hidden' name='lc' value='$language'>";
771
- $output .= "<input type='hidden' name='no_note' value='$note'>";
772
- $output .= "<input type='hidden' name='paymentaction' value='$paymentaction'>";
773
- $output .= "<input type='hidden' name='return' value='". $value['return'] ."' />";
774
- $output .= "<input type='hidden' name='bn' value='WPPlugin_SP'>";
775
- $output .= "<input type='hidden' name='cancel_return' value='". $value['cancel'] ."' />";
776
- $output .= "<input style='border: none;' class='paypalbuttonimage' type='image' src='$img' border='0' name='submit' alt='Make your payments with PayPal. It is free, secure, effective.'>";
777
- $output .= "<img alt='' border='0' style='border:none;display:none;' src='https://www.paypal.com/$language/i/scr/pixel.gif' width='1' height='1'>";
778
- $output .= "</form></div>";
779
-
780
- return $output;
781
-
782
- }
783
-
784
-
785
-
786
  ?>
8
  Author: Scott Paterson
9
  Author URI: https://wpplugin.org
10
  License: GPL2
11
+ Version: 1.7.2
12
  */
13
 
14
+ /* Copyright 2014-2017 Scott Paterson
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
36
  // add media button for editor page
37
  if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) && $typenow != 'download' ) {
38
 
39
+ add_action('media_buttons', 'wpecpp_add_my_media_button', 20);
40
+ function wpecpp_add_my_media_button() {
41
+ echo '<a href="#TB_inline?width=600&height=400&inlineId=wpecpp_popup_container" title="PayPal Button" id="insert-my-media" class="button thickbox">PayPal Button</a>';
42
+ }
43
+
44
+ add_action( 'admin_footer', 'wpecpp_add_inline_popup_content' );
45
+ function wpecpp_add_inline_popup_content() {
46
+ ?>
47
+
48
+
49
+
50
+ <script type="text/javascript">
51
+ function wpecpp_InsertShortcode(){
52
+
53
+ var wpecpp_scname = document.getElementById("wpecpp_scname").value;
54
+ var wpecpp_scprice = document.getElementById("wpecpp_scprice").value;
55
+ var wpecpp_alignmentc = document.getElementById("wpecpp_alignment");
56
+ var wpecpp_alignmentb = wpecpp_alignmentc.options[wpecpp_alignmentc.selectedIndex].value;
57
+
58
+ if(!wpecpp_scname.match(/\S/)) { alert("Item Name is required."); return false; }
59
+ if(!wpecpp_scprice.match(/\S/)) { alert("Item Price is required."); return false; }
60
+ if(wpecpp_alignmentb == "none") { var wpecpp_alignment = ""; } else { var wpecpp_alignment = ' align="' + wpecpp_alignmentb + '"'; };
61
+
62
+ document.getElementById("wpecpp_scname").value = "";
63
+ document.getElementById("wpecpp_scprice").value = "";
64
+ wpecpp_alignmentc.selectedIndex = null;
65
+
66
+ window.send_to_editor('[wpecpp name="' + wpecpp_scname + '" price="' + wpecpp_scprice + '"' + wpecpp_alignment + ']');
67
+ }
68
+ </script>
69
+
70
+
71
+ <div id="wpecpp_popup_container" style="display:none;">
72
+
73
+ <h2>Insert a Buy Now Button</h2>
74
+
75
+ <table><tr><td>
76
+
77
+ Item Name: </td><td><input type="text" name="wpecpp_scname" id="wpecpp_scname" value="">The name of the item</td><td></td></tr><tr><td>
78
+ Item Price: </td><td><input type="text" name="wpecpp_scprice" id="wpecpp_scprice" value=""> Example format: 6.99</td><td></td></tr><tr><td>
79
+ Alignment: </td><td><select name="wpecpp_alignment" id="wpecpp_alignment"><option value="none"></option><option value="left">Left</option><option value="center">Center</option><option value="right">Right</option></select>
80
+ Optional</td><td></td></tr><tr><td>
81
+
82
+ </td></tr><tr><td>
83
+
84
+ <br />
85
+ </td></tr><tr><td>
86
+
87
+ <input type="button" id="wpecpp-insert" class="button-primary" onclick="wpecpp_InsertShortcode();" value="Insert">
88
+ <br /><br />
89
+
90
+ </td></tr></table>
91
+
92
+ </div>
93
+ <?php
94
+ }
 
 
95
  }
96
 
97
 
108
 
109
  function wpecpp_activate() {
110
 
111
+ $wpecpp_settingsoptions = array(
112
+ 'currency' => '25',
113
+ 'language' => '3',
114
+ 'liveaccount' => '',
115
+ 'sandboxaccount' => '',
116
+ 'mode' => '2',
117
+ 'size' => '2',
118
+ 'opens' => '2',
119
+ 'cancel' => '',
120
+ 'return' => '',
121
+ 'note' => '1',
122
+ 'tax_rate' => '',
123
+ 'tax' => '',
124
+ 'weight_unit' => '1',
125
+ 'cbt' => '',
126
+ 'upload_image' => '',
127
+ 'showprice' => '2',
128
+ 'showname' => '2',
129
+ 'paymentaction' => '1'
130
+ );
131
+
132
+ add_option("wpecpp_settingsoptions", $wpecpp_settingsoptions);
133
 
134
  }
135
 
136
 
137
  function wpecpp_deactivate() {
138
+ delete_option("wpecpp_my_plugin_notice_shown");
139
  }
140
 
141
  function wpecpp_uninstall() {
148
  add_action('admin_notices', 'wpecpp_my_plugin_admin_notices');
149
 
150
  function wpecpp_my_plugin_admin_notices() {
151
+ if (!get_option('wpecpp_my_plugin_notice_shown')) {
152
+ echo "<div class='updated'><p><a href='admin.php?page=wp-ecommerce-settings'>Click here to view the plugin settings</a>.</p></div>";
153
+ update_option("wpecpp_my_plugin_notice_shown", "true");
154
+ }
155
  }
156
 
157
 
163
  add_action( "admin_menu", "wpecpp_plugin_menu" );
164
 
165
  function wpecpp_plugin_menu() {
166
+ add_options_page( "PayPal Button", "PayPal Button", "manage_options", "wp-ecommerce-settings", "wpecpp_plugin_options" );
167
  }
168
  add_filter('plugin_action_links', 'wpecpp_myplugin_plugin_action_links', 10, 2);
169
 
170
  function wpecpp_myplugin_plugin_action_links($links, $file) {
171
+ static $this_plugin;
172
+
173
+ if (!$this_plugin) {
174
+ $this_plugin = plugin_basename(__FILE__);
175
+ }
176
+
177
+ if ($file == $this_plugin) {
178
+ $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=wp-ecommerce-settings">Settings</a>';
179
+ array_unshift($links, $settings_link);
180
+ }
181
+
182
+ return $links;
183
  }
184
 
185
+ function wpecpp_plugin_settings_link($links) {
186
+ unset($links['edit']);
 
187
 
188
+ $forum_link = '<a target="_blank" href="https://wordpress.org/support/plugin/wp-ecommerce-paypal">' . __('Support', 'PTP_LOC') . '</a>';
189
+ $premium_link = '<a target="_blank" href="https://wpplugin.org/downloads/easy-paypal-buy-now-button/">' . __('Purchase Premium', 'PTP_LOC') . '</a>';
190
+ array_push($links, $forum_link);
191
+ array_push($links, $premium_link);
192
+ return $links;
193
  }
194
 
195
  $plugin = plugin_basename(__FILE__);
198
 
199
 
200
  function wpecpp_plugin_options() {
201
+
202
+ if ( !current_user_can( "manage_options" ) ) {
203
+ wp_die( __( "You do not have sufficient permissions to access this page." ) );
204
+ }
205
 
206
+ // settings page
207
 
208
 
209
 
210
 
211
+ echo "<table width='100%'><tr><td width='70%'><br />";
212
+ echo "<label style='color: #000;font-size:18pt;'><center>PayPal Buy Now Button Settings</center></label>";
213
+ echo "<form method='post' action='".$_SERVER["REQUEST_URI"]."'>";
214
 
 
215
 
216
+ // save and update options
217
+ if (isset($_POST['update'])) {
218
 
219
+ $options['currency'] = $_POST['currency'];
220
+ $options['language'] = $_POST['language'];
221
+ $options['liveaccount'] = $_POST['liveaccount'];
222
+ $options['sandboxaccount'] = $_POST['sandboxaccount'];
223
+ $options['mode'] = $_POST['mode'];
224
+ $options['size'] = $_POST['size'];
225
+ $options['opens'] = $_POST['opens'];
226
+ $options['cancel'] = $_POST['cancel'];
227
+ $options['return'] = $_POST['return'];
228
+ $options['paymentaction'] = $_POST['paymentaction'];
229
+
230
+ update_option("wpecpp_settingsoptions", $options);
231
 
232
+ echo "<br /><div class='updated'><p><strong>"; _e("Settings Updated."); echo "</strong></p></div>";
233
+
234
+ }
235
 
 
 
 
236
 
237
+ // get options
238
+ $options = get_option('wpecpp_settingsoptions');
239
+ foreach ($options as $k => $v ) { $value[$k] = $v; }
240
 
 
 
241
 
242
+ echo "</td><td></td></tr><tr><td>";
 
 
 
 
 
 
 
 
 
243
 
244
 
 
245
 
 
246
 
 
247
 
248
+ // form
249
+ echo "<br />";
250
+ ?>
251
 
252
+ <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
253
+ &nbsp; Usage
254
+ </div><div style="background-color:#fff;border: 1px solid #E5E5E5;padding:5px;"><br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
 
256
+ In a page or post editor you will see a new button called "PayPal Button" located above the text area beside the "Add Media" button. By using this you can
257
+ create shortcodes which will show up as Buy Now button on your site.
258
+ <br /><br />
259
 
260
+ You can put the Buy Now buttons as many times in a page or post as you want, there is no limit. If you want to remove a Buy Now button, just remove the shortcode text in your page or post.
261
 
 
 
 
262
 
263
+ <br /><br />
264
+ </div><br /><br />
265
 
266
+ <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
267
+ &nbsp; Language & Currency
268
+ </div><div style="background-color:#fff;border: 1px solid #E5E5E5;padding:5px;"><br />
269
 
270
+ <b>Language:</b>
271
+ <select name="language">
272
+ <option <?php if ($value['language'] == "1") { echo "SELECTED"; } ?> value="1">Danish</option>
273
+ <option <?php if ($value['language'] == "2") { echo "SELECTED"; } ?> value="2">Dutch</option>
274
+ <option <?php if ($value['language'] == "3") { echo "SELECTED"; } ?> value="3">English</option>
275
+ <option <?php if ($value['language'] == "20") { echo "SELECTED"; } ?> value="20">English - UK</option>
276
+ <option <?php if ($value['language'] == "4") { echo "SELECTED"; } ?> value="4">French</option>
277
+ <option <?php if ($value['language'] == "5") { echo "SELECTED"; } ?> value="5">German</option>
278
+ <option <?php if ($value['language'] == "6") { echo "SELECTED"; } ?> value="6">Hebrew</option>
279
+ <option <?php if ($value['language'] == "7") { echo "SELECTED"; } ?> value="7">Italian</option>
280
+ <option <?php if ($value['language'] == "8") { echo "SELECTED"; } ?> value="8">Japanese</option>
281
+ <option <?php if ($value['language'] == "9") { echo "SELECTED"; } ?> value="9">Norwgian</option>
282
+ <option <?php if ($value['language'] == "10") { echo "SELECTED"; } ?> value="10">Polish</option>
283
+ <option <?php if ($value['language'] == "11") { echo "SELECTED"; } ?> value="11">Portuguese</option>
284
+ <option <?php if ($value['language'] == "12") { echo "SELECTED"; } ?> value="12">Russian</option>
285
+ <option <?php if ($value['language'] == "13") { echo "SELECTED"; } ?> value="13">Spanish</option>
286
+ <option <?php if ($value['language'] == "14") { echo "SELECTED"; } ?> value="14">Swedish</option>
287
+ <option <?php if ($value['language'] == "15") { echo "SELECTED"; } ?> value="15">Simplified Chinese -China only</option>
288
+ <option <?php if ($value['language'] == "16") { echo "SELECTED"; } ?> value="16">Traditional Chinese - Hong Kong only</option>
289
+ <option <?php if ($value['language'] == "17") { echo "SELECTED"; } ?> value="17">Traditional Chinese - Taiwan only</option>
290
+ <option <?php if ($value['language'] == "18") { echo "SELECTED"; } ?> value="18">Turkish</option>
291
+ <option <?php if ($value['language'] == "19") { echo "SELECTED"; } ?> value="19">Thai</option>
292
+ </select>
293
 
294
+ PayPal currently supports 18 languages.
295
+ <br /><br />
296
 
297
+ <b>Currency:</b>
298
+ <select name="currency">
299
+ <option <?php if ($value['currency'] == "1") { echo "SELECTED"; } ?> value="1">Australian Dollar - AUD</option>
300
+ <option <?php if ($value['currency'] == "2") { echo "SELECTED"; } ?> value="2">Brazilian Real - BRL</option>
301
+ <option <?php if ($value['currency'] == "3") { echo "SELECTED"; } ?> value="3">Canadian Dollar - CAD</option>
302
+ <option <?php if ($value['currency'] == "4") { echo "SELECTED"; } ?> value="4">Czech Koruna - CZK</option>
303
+ <option <?php if ($value['currency'] == "5") { echo "SELECTED"; } ?> value="5">Danish Krone - DKK</option>
304
+ <option <?php if ($value['currency'] == "6") { echo "SELECTED"; } ?> value="6">Euro - EUR</option>
305
+ <option <?php if ($value['currency'] == "7") { echo "SELECTED"; } ?> value="7">Hong Kong Dollar - HKD</option>
306
+ <option <?php if ($value['currency'] == "8") { echo "SELECTED"; } ?> value="8">Hungarian Forint - HUF</option>
307
+ <option <?php if ($value['currency'] == "9") { echo "SELECTED"; } ?> value="9">Israeli New Sheqel - ILS</option>
308
+ <option <?php if ($value['currency'] == "10") { echo "SELECTED"; } ?> value="10">Japanese Yen - JPY</option>
309
+ <option <?php if ($value['currency'] == "11") { echo "SELECTED"; } ?> value="11">Malaysian Ringgit - MYR</option>
310
+ <option <?php if ($value['currency'] == "12") { echo "SELECTED"; } ?> value="12">Mexican Peso - MXN</option>
311
+ <option <?php if ($value['currency'] == "13") { echo "SELECTED"; } ?> value="13">Norwegian Krone - NOK</option>
312
+ <option <?php if ($value['currency'] == "14") { echo "SELECTED"; } ?> value="14">New Zealand Dollar - NZD</option>
313
+ <option <?php if ($value['currency'] == "15") { echo "SELECTED"; } ?> value="15">Philippine Peso - PHP</option>
314
+ <option <?php if ($value['currency'] == "16") { echo "SELECTED"; } ?> value="16">Polish Zloty - PLN</option>
315
+ <option <?php if ($value['currency'] == "17") { echo "SELECTED"; } ?> value="17">Pound Sterling - GBP</option>
316
+ <option <?php if ($value['currency'] == "18") { echo "SELECTED"; } ?> value="18">Russian Ruble - RUB</option>
317
+ <option <?php if ($value['currency'] == "19") { echo "SELECTED"; } ?> value="19">Singapore Dollar - SGD</option>
318
+ <option <?php if ($value['currency'] == "20") { echo "SELECTED"; } ?> value="20">Swedish Krona - SEK</option>
319
+ <option <?php if ($value['currency'] == "21") { echo "SELECTED"; } ?> value="21">Swiss Franc - CHF</option>
320
+ <option <?php if ($value['currency'] == "22") { echo "SELECTED"; } ?> value="22">Taiwan New Dollar - TWD</option>
321
+ <option <?php if ($value['currency'] == "23") { echo "SELECTED"; } ?> value="23">Thai Baht - THB</option>
322
+ <option <?php if ($value['currency'] == "24") { echo "SELECTED"; } ?> value="24">Turkish Lira - TRY</option>
323
+ <option <?php if ($value['currency'] == "25") { echo "SELECTED"; } ?> value="25">U.S. Dollar - USD</option>
324
+ </select>
325
+ PayPal currently supports 25 currencies.
326
+ <br /><br /></div>
327
 
328
+ <?php
329
 
 
 
 
330
 
331
+ ?>
332
+ <br /><br /><div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
333
+ &nbsp; PayPal Account </div><div style="background-color:#fff;border: 1px solid #E5E5E5;padding:5px;"><br />
334
 
335
+ <?php
336
 
337
+ echo "<b>Live Account: </b><input type='text' name='liveaccount' value='".$value['liveaccount']."'> Required";
338
+ echo "<br />Enter a valid Merchant account ID (strongly recommend) or PayPal account email address. All payments will go to this account.";
339
+ echo "<br /><br />You can find your Merchant account ID in your PayPal account under Profile -> My business info -> Merchant account ID";
340
 
341
+ echo "<br /><br />If you don't have a PayPal account, you can sign up for free at <a target='_blank' href='https://paypal.com'>PayPal</a>. <br /><br />";
342
 
 
343
 
344
+ echo "<b>Sandbox Account: </b><input type='text' name='sandboxaccount' value='".$value['sandboxaccount']."'> Optional";
345
+ echo "<br />Enter a valid sandbox PayPal account email address. A Sandbox account is a PayPal accont with fake money used for testing. This is useful to make sure your PayPal account and settings are working properly being going live.";
346
+ echo "<br /><br />To create a Sandbox account, you first need a Developer Account. You can sign up for free at the <a target='_blank' href='https://www.paypal.com/webapps/merchantboarding/webflow/unifiedflow?execution=e1s2'>PayPal Developer</a> site. <br /><br />";
 
347
 
348
+ echo "Once you have made an account, create a Sandbox Business and Personal Account <a target='_blank' href='https://developer.paypal.com/webapps/developer/applications/accounts'>here</a>. Enter the Business acount email on this page and use the Personal account username and password to buy something on your site as a customer. <br /><br /><br />";
 
349
 
350
+ echo "<b>Sandbox Mode:</b>";
351
+ echo "&nbsp; &nbsp; <input "; if ($value['mode'] == "1") { echo "checked='checked'"; } echo " type='radio' name='mode' value='1'>On (Sandbox mode)";
352
+ echo "&nbsp; &nbsp; <input "; if ($value['mode'] == "2") { echo "checked='checked'"; } echo " type='radio' name='mode' value='2'>Off (Live mode)";
353
 
354
+ echo "<br /><br /><b>Payment Action:</b>";
355
+ echo "&nbsp; &nbsp; <input "; if ($value['paymentaction'] == "1") { echo "checked='checked'"; } echo " type='radio' name='paymentaction' value='1'>Sale (Default)";
356
+ echo "&nbsp; &nbsp; <input "; if ($value['paymentaction'] == "2") { echo "checked='checked'"; } echo " type='radio' name='paymentaction' value='2'>Authorize (Learn more <a target='_blank' href='https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/authcapture/'>here</a>)";
357
 
358
+ echo "<br /><br /></div>";
359
 
 
 
 
 
 
360
 
361
 
362
+ ?>
363
 
364
+ <br /><br />
365
+ <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
366
+ &nbsp; Other Settings
367
+ </div><div style="background-color:#fff;border: 1px solid #E5E5E5;padding:5px;"><br />
368
 
369
+ <?php
370
+ echo "<table><tr><td valign='top'>";
 
371
 
372
 
373
 
 
374
 
375
+ echo "<b>Button Size and type:</b></td><td valign='top' style='text-align: center;'>";
376
+ echo "<input "; if ($value['size'] == "1") { echo "checked='checked'"; } echo " type='radio' name='size' value='1'>Small <br /><img src='https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif'></td><td valign='top' style='text-align: center;'>";
377
+ echo "<input "; if ($value['size'] == "2") { echo "checked='checked'"; } echo " type='radio' name='size' value='2'>Big <br /><img src='https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif'></td><td valign='top' style='text-align: center;'>";
378
+ echo "<input "; if ($value['size'] == "3") { echo "checked='checked'"; } echo " type='radio' name='size' value='3'>Big with credit cards <br /><img src='https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif'></td><td valign='top' style='text-align: center;'>";
379
+ echo "<input "; if ($value['size'] == "5") { echo "checked='checked'"; } echo " type='radio' name='size' value='5'>Gold (English Only) <br /><img src='https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png'></td><td valign='top' style='text-align: center;'>";
380
 
381
 
 
382
 
 
 
 
383
 
384
+ echo "</td></tr><tr><td><b>PayPal opens in:</b></td>";
385
+ echo "<td><input "; if ($value['opens'] == "1") { echo "checked='checked'"; } echo " type='radio' name='opens' value='1'>Same window</td>";
386
+ echo "<td><input "; if ($value['opens'] == "2") { echo "checked='checked'"; } echo " type='radio' name='opens' value='2'>New window</td></tr>";
387
 
 
388
 
389
 
390
+ echo "</table><br /><br />";
 
391
 
 
 
392
 
393
 
394
+ $siteurl = get_site_url();
395
 
396
+ echo "<b>Cancel URL: </b>";
397
+ echo "<input type='text' name='cancel' value='".$value['cancel']."'> Optional <br />";
398
+ echo "If the customer goes to PayPal and clicks the cancel button, where do they go. Example: $siteurl/cancel. Max length: 1,024. <br /><br />";
399
 
400
+ echo "<b>Return URL: </b>";
401
+ echo "<input type='text' name='return' value='".$value['return']."'> Optional <br />";
402
+ echo "If the customer goes to PayPal and successfully pays, where are they redirected to after. Example: $siteurl/thankyou. Max length: 1,024. <br /><br />";
403
 
404
+ echo "Note: The Cancel and Return pages are not automatically created; /cancel and /thankyou are just possible example page names.";
405
 
406
 
407
+ ?>
408
+ <br /><br /></div>
409
 
410
+ <input type='hidden' name='update'><br />
411
+ <input type='submit' name='btn2' class='button-primary' style='font-size: 17px;line-height: 28px;height: 32px;' value='Save Settings'>
412
 
413
+ <br /><br /><br />
414
 
415
 
416
+ WPPlugin is an offical PayPal Partner. Various trademarks held by their respective owners.
417
 
418
 
419
+ </form>
420
 
421
 
422
+ </td><td width='5%'>
423
+ </td><td width='24%' valign='top'>
424
 
425
+ <br />
426
 
427
+ <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
428
+ &nbsp; PayPal Buy Now Button Pro
429
+ </div>
430
 
431
+ <div style="background-color:#fff;border: 1px solid #E5E5E5;padding:8px;">
432
 
433
 
434
+ <center><label style="font-size:14pt;">With the Pro version you'll <br /> be able to: </label></center>
435
+
436
+ <br />
437
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Manage Buttons In One Place<br />
438
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> View Sales In Your Dashboard<br />
439
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Send out Email Notifications<br />
440
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Have Inventory Management<br />
441
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Have Separate PayPal Accounts<br />
442
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Add Dropdown Menus<br />
443
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Add Text Boxes<br />
444
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Charge Tax & Shipping <br />
445
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Add Item ID and SKU<br />
446
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Add Discounts <br />
447
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Change Quantity <br />
448
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Have A Custom Button Image<br />
449
+ <div class="dashicons dashicons-yes" style="margin-bottom: 6px;"></div> Further Plugin Development <br />
450
 
451
+ <br />
452
+ <center><a target='_blank' href="https://wpplugin.org/downloads/easy-paypal-buy-now-button/" class='button-primary' style='font-size: 17px;line-height: 28px;height: 32px;'>Learn More</a></center>
453
+ <br />
454
+ </div>
455
 
456
+ <br /><br />
457
 
 
 
458
 
459
+ <div style="background-color:#333333;padding:8px;color:#eee;font-size:12pt;font-weight:bold;">
460
+ &nbsp; Quick Links
461
+ </div>
462
 
463
+ <div style="background-color:#fff;border: 1px solid #E5E5E5;padding:8px;"><br />
 
 
464
 
465
+ <div class="dashicons dashicons-arrow-right" style="margin-bottom: 6px;"></div> <a target="_blank" href="https://wordpress.org/support/plugin/wp-ecommerce-paypal">Support Forum</a> <br />
466
 
467
+ <div class="dashicons dashicons-arrow-right" style="margin-bottom: 6px;"></div> <a target="_blank" href="https://wpplugin.org/documentation/">FAQ</a> <br />
468
 
469
+ <div class="dashicons dashicons-arrow-right" style="margin-bottom: 6px;"></div> <a target="_blank" href="https://wpplugin.org/downloads/easy-paypal-buy-now-button/">PayPal Button Pro</a> <br />
 
 
 
 
 
 
 
 
 
 
 
470
 
471
+ </div>
 
 
 
472
 
473
+ </td><td width='1%'>
474
 
475
+ </td></tr></table>
476
 
 
 
 
477
 
478
+ <?php
479
 
480
+ // end settings page and required permissions
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  }
482
 
483
 
490
 
491
  add_shortcode('wpecpp', 'wpecpp_options');
492
 
 
493
  function wpecpp_options($atts) {
494
 
495
+ // get shortcode user fields
496
+ $atts = shortcode_atts(array('name' => 'Example Name','price' => '0.00','size' => '','align' => ''), $atts);
497
+
498
+ // get settings page values
499
+ $options = get_option('wpecpp_settingsoptions');
500
+ foreach ($options as $k => $v ) { $value[$k] = $v; }
501
+
502
+
503
+ // live of test mode
504
+ if ($value['mode'] == "1") {
505
+ $account = $value['sandboxaccount'];
506
+ $path = "sandbox.paypal";
507
+ } elseif ($value['mode'] == "2") {
508
+ $account = $value['liveaccount'];
509
+ $path = "paypal";
510
+ }
511
+
512
+ // payment action
513
+ if ($value['paymentaction'] == "1") {
514
+ $paymentaction = "sale";
515
+ } elseif ($value['paymentaction'] == "2") {
516
+ $paymentaction = "authorization";
517
+ } else {
518
+ $paymentaction = "sale";
519
+ }
520
+
521
+ // currency
522
+ if ($value['currency'] == "1") { $currency = "AUD"; }
523
+ if ($value['currency'] == "2") { $currency = "BRL"; }
524
+ if ($value['currency'] == "3") { $currency = "CAD"; }
525
+ if ($value['currency'] == "4") { $currency = "CZK"; }
526
+ if ($value['currency'] == "5") { $currency = "DKK"; }
527
+ if ($value['currency'] == "6") { $currency = "EUR"; }
528
+ if ($value['currency'] == "7") { $currency = "HKD"; }
529
+ if ($value['currency'] == "8") { $currency = "HUF"; }
530
+ if ($value['currency'] == "9") { $currency = "ILS"; }
531
+ if ($value['currency'] == "10") { $currency = "JPY"; }
532
+ if ($value['currency'] == "11") { $currency = "MYR"; }
533
+ if ($value['currency'] == "12") { $currency = "MXN"; }
534
+ if ($value['currency'] == "13") { $currency = "NOK"; }
535
+ if ($value['currency'] == "14") { $currency = "NZD"; }
536
+ if ($value['currency'] == "15") { $currency = "PHP"; }
537
+ if ($value['currency'] == "16") { $currency = "PLN"; }
538
+ if ($value['currency'] == "17") { $currency = "GBP"; }
539
+ if ($value['currency'] == "18") { $currency = "RUB"; }
540
+ if ($value['currency'] == "19") { $currency = "SGD"; }
541
+ if ($value['currency'] == "20") { $currency = "SEK"; }
542
+ if ($value['currency'] == "21") { $currency = "CHF"; }
543
+ if ($value['currency'] == "22") { $currency = "TWD"; }
544
+ if ($value['currency'] == "23") { $currency = "THB"; }
545
+ if ($value['currency'] == "24") { $currency = "TRY"; }
546
+ if ($value['currency'] == "25") { $currency = "USD"; }
547
+
548
+ // language
549
+ if ($value['language'] == "1") {
550
+ $language = "da_DK";
551
+ $image = "https://www.paypalobjects.com/da_DK/i/btn/btn_buynow_SM.gif";
552
+ $imageb = "https://www.paypalobjects.com/da_DK/i/btn/btn_buynow_LG.gif";
553
+ $imagecc = "https://www.paypalobjects.com/da_DK/DK/i/btn/btn_buynowCC_LG.gif";
554
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
555
+ } //Danish
556
+
557
+ if ($value['language'] == "2") {
558
+ $language = "nl_BE";
559
+ $image = "https://www.paypalobjects.com/nl_NL/NL/i/btn/btn_buynow_SM.gif";
560
+ $imageb = "https://www.paypalobjects.com/nl_NL/NL/i/btn/btn_buynow_LG.gif";
561
+ $imagecc = "https://www.paypalobjects.com/nl_NL/NL/i/btn/btn_buynowCC_LG.gif";
562
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
563
+ } //Dutch
564
+
565
+ if ($value['language'] == "3") {
566
+ $language = "EN_US";
567
+ $image = "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif";
568
+ $imageb = "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif";
569
+ $imagecc = "https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif";
570
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
571
+ } //English
572
+
573
+ if ($value['language'] == "20") {
574
+ $language = "en_GB";
575
+ $image = "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif";
576
+ $imageb = "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif";
577
+ $imagecc = "https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif";
578
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
579
+ } //English - UK
580
+
581
+ if ($value['language'] == "4") {
582
+ $language = "fr_CA";
583
+ $image = "https://www.paypalobjects.com/fr_CA/i/btn/btn_buynow_SM.gif";
584
+ $imageb = "https://www.paypalobjects.com/fr_CA/i/btn/btn_buynow_LG.gif";
585
+ $imagecc = "https://www.paypalobjects.com/fr_CA/i/btn/btn_buynowCC_LG.gif";
586
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
587
+ } //French
588
+
589
+ if ($value['language'] == "5") {
590
+ $language = "de_DE";
591
+ $image = "https://www.paypalobjects.com/de_DE/DE/i/btn/btn_buynow_SM.gif";
592
+ $imageb = "https://www.paypalobjects.com/de_DE/DE/i/btn/btn_buynow_LG.gif";
593
+ $imagecc = "https://www.paypalobjects.com/de_DE/DE/i/btn/btn_buynowCC_LG.gif";
594
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
595
+ } //German
596
+
597
+ if ($value['language'] == "6") {
598
+ $language = "he_IL";
599
+ $image = "https://www.paypalobjects.com/he_IL/i/btn/btn_buynow_SM.gif";
600
+ $imageb = "https://www.paypalobjects.com/he_IL/i/btn/btn_buynow_LG.gif";
601
+ $imagecc = "https://www.paypalobjects.com/he_IL/IL/i/btn/btn_buynowCC_LG.gif";
602
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
603
+ } //Hebrew
604
+
605
+ if ($value['language'] == "7") {
606
+ $language = "it_IT";
607
+ $image = "https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynow_SM.gif";
608
+ $imageb = "https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynow_LG.gif";
609
+ $imagecc = "https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynowCC_LG.gif";
610
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
611
+ } //Italian
612
+
613
+ if ($value['language'] == "8") {
614
+ $language = "ja_JP";
615
+ $image = "https://www.paypalobjects.com/ja_JP/JP/i/btn/btn_buynow_SM.gif";
616
+ $imageb = "https://www.paypalobjects.com/ja_JP/JP/i/btn/btn_buynow_LG.gif";
617
+ $imagecc = "https://www.paypalobjects.com/ja_JP/JP/i/btn/btn_buynowCC_LG.gif";
618
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
619
+ } //Japanese
620
+
621
+ if ($value['language'] == "9") {
622
+ $language = "no_NO";
623
+ $image = "https://www.paypalobjects.com/no_NO/i/btn/btn_buynow_SM.gif";
624
+ $imageb = "https://www.paypalobjects.com/no_NO/i/btn/btn_buynow_LG.gif";
625
+ $imagecc = "https://www.paypalobjects.com/no_NO/NO/i/btn/btn_buynowCC_LG.gif";
626
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
627
+ } //Norwgian
628
+
629
+ if ($value['language'] == "10") {
630
+ $language = "pl_PL";
631
+ $image = "https://www.paypalobjects.com/pl_PL/PL/i/btn/btn_buynow_SM.gif";
632
+ $imageb = "https://www.paypalobjects.com/pl_PL/PL/i/btn/btn_buynow_LG.gif";
633
+ $imagecc = "https://www.paypalobjects.com/pl_PL/PL/i/btn/btn_buynowCC_LG.gif";
634
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
635
+ } //Polish
636
+
637
+ if ($value['language'] == "11") {
638
+ $language = "pt_BR";
639
+ $image = "https://www.paypalobjects.com/pt_PT/PT/i/btn/btn_buynow_SM.gif";
640
+ $imageb = "https://www.paypalobjects.com/pt_PT/PT/i/btn/btn_buynow_LG.gif";
641
+ $imagecc = "https://www.paypalobjects.com/pt_PT/PT/i/btn/btn_buynowCC_LG.gif";
642
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
643
+ } //Portuguese
644
+
645
+ if ($value['language'] == "12") {
646
+ $language = "ru_RU";
647
+ $image = "https://www.paypalobjects.com/ru_RU/i/btn/btn_buynow_SM.gif";
648
+ $imageb = "https://www.paypalobjects.com/ru_RU/i/btn/btn_buynow_LG.gif";
649
+ $imagecc = "https://www.paypalobjects.com/ru_RU/RU/i/btn/btn_buynowCC_LG.gif";
650
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
651
+ } //Russian
652
+
653
+ if ($value['language'] == "13") {
654
+ $language = "es_ES";
655
+ $image = "https://www.paypalobjects.com/es_ES/ES/i/btn/btn_buynow_SM.gif";
656
+ $imageb = "https://www.paypalobjects.com/es_ES/ES/i/btn/btn_buynow_LG.gif";
657
+ $imagecc = "https://www.paypalobjects.com/es_ES/ES/i/btn/btn_buynowCC_LG.gif";
658
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
659
+ } //Spanish
660
+
661
+ if ($value['language'] == "14") {
662
+ $language = "sv_SE";
663
+ $image = "https://www.paypalobjects.com/sv_SE/i/btn/btn_buynow_SM.gif";
664
+ $imageb = "https://www.paypalobjects.com/sv_SE/i/btn/btn_buynow_LG.gif";
665
+ $imagecc = "https://www.paypalobjects.com/sv_SE/SE/i/btn/btn_buynowCC_LG.gif";
666
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
667
+ } //Swedish
668
+
669
+ if ($value['language'] == "15") {
670
+ $language = "zh_CN";
671
+ $image = "https://www.paypalobjects.com/zh_XC/i/btn/btn_buynow_SM.gif";
672
+ $imageb = "https://www.paypalobjects.com/zh_XC/i/btn/btn_buynow_LG.gif";
673
+ $imagecc = "https://www.paypalobjects.com/zh_XC/C2/i/btn/btn_buynowCC_LG.gif";
674
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
675
+ } //Simplified Chinese - China
676
+
677
+ if ($value['language'] == "16") {
678
+ $language = "zh_HK";
679
+ $image = "https://www.paypalobjects.com/zh_HK/i/btn/btn_buynow_SM.gif";
680
+ $imageb = "https://www.paypalobjects.com/zh_HK/i/btn/btn_buynow_LG.gif";
681
+ $imagecc = "https://www.paypalobjects.com/zh_HK/HK/i/btn/btn_buynowCC_LG.gif";
682
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
683
+ } //Traditional Chinese - Hong Kong
684
+
685
+ if ($value['language'] == "17") {
686
+ $language = "zh_TW";
687
+ $image = "https://www.paypalobjects.com/zh_TW/TW/i/btn/btn_buynow_SM.gif";
688
+ $imageb = "https://www.paypalobjects.com/zh_TW/TW/i/btn/btn_buynow_LG.gif";
689
+ $imagecc = "https://www.paypalobjects.com/zh_TW/TW/i/btn/btn_buynowCC_LG.gif";
690
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
691
+ } //Traditional Chinese - Taiwan
692
+
693
+ if ($value['language'] == "18") {
694
+ $language = "tr_TR";
695
+ $image = "https://www.paypalobjects.com/tr_TR/i/btn/btn_buynow_SM.gif";
696
+ $imageb = "https://www.paypalobjects.com/tr_TR/i/btn/btn_buynow_LG.gif";
697
+ $imagecc = "https://www.paypalobjects.com/tr_TR/TR/i/btn/btn_buynowCC_LG.gif";
698
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
699
+ } //Turkish
700
+
701
+ if ($value['language'] == "19") {
702
+ $language = "th_TH";
703
+ $image = "https://www.paypalobjects.com/th_TH/i/btn/btn_buynow_SM.gif";
704
+ $imageb = "https://www.paypalobjects.com/th_TH/i/btn/btn_buynow_LG.gif";
705
+ $imagecc = "https://www.paypalobjects.com/th_TH/TH/i/btn/btn_buynowCC_LG.gif";
706
+ $imagenew = "https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-medium.png";
707
+ } //Thai
708
+
709
+ if (!empty($atts['size'])) {
710
+ if ($atts['size'] == "1") { $img = $image; }
711
+ if ($atts['size'] == "2") { $img = $imageb; }
712
+ if ($atts['size'] == "3") { $img = $imagecc; }
713
+ if ($atts['size'] == "5") { $img = $imagenew; }
714
+ } else {
715
+ if ($value['size'] == "1") { $img = $image; }
716
+ if ($value['size'] == "2") { $img = $imageb; }
717
+ if ($value['size'] == "3") { $img = $imagecc; }
718
+ if ($value['size'] == "4") { $img = $value['upload_image']; }
719
+ if ($value['size'] == "5") { $img = $imagenew; }
720
+ }
721
+
722
+ // window action
723
+ if ($value['opens'] == "1") { $target = ""; }
724
+ if ($value['opens'] == "2") { $target = "_blank"; }
725
+
726
+ // alignment
727
+ if ($atts['align'] == "left") { $alignment = "style='float: left;'"; }
728
+ if ($atts['align'] == "right") { $alignment = "style='float: right;'"; }
729
+ if ($atts['align'] == "center") { $alignment = "style='margin-left: auto;margin-right: auto;width:170px'"; }
730
+
731
+ if (!isset($alignment)) { $alignment = ""; }
732
+
733
+ if (!isset($note)) { $note = ""; }
734
+
735
+
736
+
737
+ $output = "";
738
+
739
+ if (empty($account)) {
740
+ $output .= "(Please enter your PayPal Account or Merchant ID on the settings pages.)";
741
+ }
742
+
743
+ $output .= "<div $alignment>";
744
+ $output .= "<form target='$target' action='https://www.$path.com/cgi-bin/webscr' method='post'>";
745
+ $output .= "<input type='hidden' name='cmd' value='_xclick' />";
746
+ $output .= "<input type='hidden' name='business' value='$account' />";
747
+ $output .= "<input type='hidden' name='item_name' value='". $atts['name'] ."' />";
748
+ $output .= "<input type='hidden' name='currency_code' value='$currency' />";
749
+ $output .= "<input type='hidden' name='amount' value='". $atts['price'] ."' />";
750
+ $output .= "<input type='hidden' name='lc' value='$language'>";
751
+ $output .= "<input type='hidden' name='no_note' value='$note'>";
752
+ $output .= "<input type='hidden' name='paymentaction' value='$paymentaction'>";
753
+ $output .= "<input type='hidden' name='return' value='". $value['return'] ."' />";
754
+ $output .= "<input type='hidden' name='bn' value='WPPlugin_SP'>";
755
+ $output .= "<input type='hidden' name='cancel_return' value='". $value['cancel'] ."' />";
756
+ $output .= "<input style='border: none;' class='paypalbuttonimage' type='image' src='$img' border='0' name='submit' alt='Make your payments with PayPal. It is free, secure, effective.'>";
757
+ $output .= "<img alt='' border='0' style='border:none;display:none;' src='https://www.paypal.com/$language/i/scr/pixel.gif' width='1' height='1'>";
758
+ $output .= "</form></div>";
759
+
760
+ return $output;
761
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
  }
763
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
764
  ?>