Changeset 908445
- Timestamp:
- 05/05/2014 07:57:44 PM (12 years ago)
- Location:
- ebyline-payments/trunk
- Files:
-
- 6 edited
-
ebyline.php (modified) (5 diffs)
-
payment.php (modified) (7 diffs)
-
post.php (modified) (3 diffs)
-
readme.txt (modified) (8 diffs)
-
text.php (modified) (4 diffs)
-
views/payment_metabox.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ebyline-payments/trunk/ebyline.php
r814636 r908445 4 4 Plugin URI: http://ebylinepayments.com/ 5 5 Description: Introducing Ebyline Payments, a plugin that helps you make payments to your WordPress authors within the WordPress Admin. 6 Version: 1. 0.16 Version: 1.1.0 7 7 Author: Ebyline 8 8 Author URI: http://www.ebyline.com … … 15 15 */ 16 16 17 define("EBYLINE_VERSION", "1. 0");17 define("EBYLINE_VERSION", "1.1"); 18 18 19 19 if(!class_exists('Ebyline_Plugin')) … … 44 44 $payment = new Ebyline_Payment(); 45 45 46 // Initialize importer module 47 $path = sprintf("%s/import.php", dirname(__FILE__)); 48 require_once($path); 46 49 47 50 // Print out revision so we know what exact build is currently running … … 62 65 } 63 66 // END activate 64 67 65 68 /** 66 69 * Deactivate the plugin 67 */ 70 */ 68 71 public static function deactivate() 69 72 { … … 72 75 // END deactivate 73 76 74 77 75 78 public function init_callbacks() 76 79 { -
ebyline-payments/trunk/payment.php
r795485 r908445 23 23 } 24 24 // END public function __construct 25 26 25 26 27 27 public function payment_admin_init() 28 28 { … … 33 33 // wp_register_style( 'ebyline_payment_stylesheet', plugins_url('css/payment.css', __FILE__) ); 34 34 35 // Register JS script we'll be using on the payment metabox 35 // Register JS script we'll be using on the payment metabox. 36 // This only registers the script with a name; it doesn't actually load the script. 37 // See wp_enqueue_script() later below. 36 38 wp_register_script('ebyline_payment_script', plugins_url('scripts/payment.js', __FILE__), array('jquery')); 37 39 … … 104 106 { 105 107 $fee = Ebyline_Post::get_fee($post_id); 108 $isImportedProject = Ebyline_Post::get_project_id($post_id) != ''; 106 109 $is_current_user = get_current_user_id() == get_post($post_id)->post_author; 107 110 … … 114 117 if ($fee == 0) 115 118 { 116 $fee = Ebyline_Text::ALLPOSTS_NO_FEE_YET; 119 if ($isImportedProject) { 120 $fee = Ebyline_Text::ALLPOSTS_NO_FEE; 121 } else { 122 $fee = Ebyline_Text::ALLPOSTS_NO_FEE_YET; 123 } 117 124 echo $fee; 118 125 } … … 132 139 if (Ebyline_Plugin::is_admin()) 133 140 { 134 if ($fee == 0) 141 // If there is no fee and this is NOT an imported project post, 142 // means it's a new blog entry with no payment info attached yet. 143 if (($fee == 0) && !$isImportedProject) 135 144 { 136 145 $edit_url = get_edit_post_link($post_id); … … 219 228 } 220 229 } 221 230 222 231 public function on_payment_page_load() 223 232 { … … 251 260 // wp_die(__('You do not have sufficient permissions to access this page.')); 252 261 // } 253 262 254 263 // Render the settings template 255 264 // include(sprintf("%s/views/payment.php", dirname(__FILE__))); -
ebyline-payments/trunk/post.php
r795485 r908445 15 15 const META_KEY_POST_APPROVER = 'ebyline_approver'; // Author id of who paid for post 16 16 const META_KEY_POST_TIMESTAMP = 'ebyline_timestamp'; // Time/date of when post was paid 17 const META_KEY_PROJECT_ID = 'ebyline_project_id'; // Project id (only applies to imported projects) 17 18 18 19 public static function get_fee($post_id) … … 101 102 // END get_payment_link 102 103 104 /** 105 * Get the project id of the post. Only applies to posts 106 * imported from Ebyline. 107 * 108 * @param [int] $post_id 109 * @return [String] Id; if meta doesn't exist, returns an empty string 110 */ 111 public static function get_project_id($post_id) 112 { 113 $id = get_post_meta($post_id, self::META_KEY_PROJECT_ID, true); 114 return $id; 115 } 116 103 117 104 118 … … 145 159 } 146 160 // END save_timestamp 161 162 public static function save_project_id($post_id, $id) 163 { 164 self::save_meta($post_id, self::META_KEY_PROJECT_ID, $id); 165 } 166 // END save_project_id 147 167 } 148 168 // END class Ebyline_Posts -
ebyline-payments/trunk/readme.txt
r846072 r908445 5 5 Tags: payments, freelance, editors, invoicing, contributors, paypal, authors, approvals 6 6 Requires at least: 3.0.1 7 Tested up to: 3. 5.17 Tested up to: 3.8.1 8 8 Stable tag: trunk 9 9 License: GPLv2 or later … … 22 22 * Easy install and setup 23 23 * Make payments via credit card to contributors directly in the Wordpress interface 24 * Import Ebyline projects directly into your WordPress site 24 25 * Contributors receive payments via PayPal 25 26 * Browse history of any payment for any post … … 65 66 Yes. Ebyline can handle your workflow as well as payment processing. Simply log-in to your Ebyline account at Ebyline.com/login to create assignments, manage workflow, and process payments. The Ebyline platform also has a contributor database and Pitch Board to enable you to find new contributors to work with. 66 67 68 * **Can I import my Ebyline projects into my WordPress site?** 69 70 Yes, existing Ebyline users can import the last 60 days of completed projects directly into their WordPress account. The projects will be imported in "Draft" mode, allowing you to quickly edit and update the posts for publication. Simply log into your Wordpress account, Install the Ebyline Plugin, and use the "Import" feature located under the "Tools" menu. 71 67 72 For full access to Ebyline’s contributor database and unlimited contributors, upgrade to an Ebyline Plus account. For more information about Ebyline Plus, click here: http://info.ebyline.com/plus 68 73 … … 77 82 * **How can I see information about previous purchases?** 78 83 79 Previous purchases can be viewed from the Ebyline website. The transaction screen displays all your purchased projects and you can also see if a project has been paid to the contributor.80 84 Previous purchases can be viewed from the Ebyline website. The transaction screen displays all your purchased projects and you can also see if a project has been paid to the contributor. 85 81 86 1. Log into your Ebyline editor account at www.ebyline.com/login 82 87 1. Click the “Transactions" folder at the lower left of the screen. … … 103 108 * **What payment methods are available?** 104 109 105 Payments are issued to contributors via PayPal only.110 Payments are issued to contributors via PayPal only. 106 111 107 You must have a PayPal account in order to receive payments from Ebyline Payments. PayPal is a separate web based service that collects money for you from online sales (such as when you sell something on eBay, or if you have an online store), and securely transmits those funds to the location you specify, such as your bank account.112 You must have a PayPal account in order to receive payments from Ebyline Payments. PayPal is a separate web based service that collects money for you from online sales (such as when you sell something on eBay, or if you have an online store), and securely transmits those funds to the location you specify, such as your bank account. 108 113 109 With Ebyline Payments, when an editor buys your work, the editor sends the payment to us; we handle the tax and reporting issues, then we send payment directly to your PayPal account. Therefore you must have a PayPal account to receive payment for your work. In PayPal, you can specify where you want the funds to be sent (i.e., bank account, a check, etc.)114 With Ebyline Payments, when an editor buys your work, the editor sends the payment to us; we handle the tax and reporting issues, then we send payment directly to your PayPal account. Therefore you must have a PayPal account to receive payment for your work. In PayPal, you can specify where you want the funds to be sent (i.e., bank account, a check, etc.) 110 115 111 116 Creating a PayPal account requires a few steps, but once completed, using the system is very simple. For more information on creating a PayPal account, click here: https://ebyline.zendesk.com/entries/21115412-How-to-Set-Up-Your-PayPal-account … … 113 118 * **What does this cost me?** 114 119 115 There is no cost to contributors to receive payments via Ebyline Payments. Ebyline covers all associated costs for you to receive payments through PayPal, and you receive the full amount you have contracted for your posts. 120 There is no cost to contributors to receive payments via Ebyline Payments. Ebyline covers all associated costs for you to receive payments through PayPal, and you receive the full amount you have contracted for your posts. 116 121 117 Editors pay a processing fee to Ebyline which covers the costs of processing payments and tax reporting.122 Editors pay a processing fee to Ebyline which covers the costs of processing payments and tax reporting. 118 123 119 124 * **How can I see information about previous payments?** … … 136 141 * **How does the tax reporting work?** 137 142 138 If you earn $600 or more during the tax year, a 1099-Misc form will be issued no later than January 31st of the following year, as required by law. The form will either be mailed to you or available electronically for download depending on your selection during registration.143 If you earn $600 or more during the tax year, a 1099-Misc form will be issued no later than January 31st of the following year, as required by law. The form will either be mailed to you or available electronically for download depending on your selection during registration. 139 144 140 For more information on tax forms, click here: https://ebyline.zendesk.com/entries/21572740-1099-Misc-tax-forms145 For more information on tax forms, click here: https://ebyline.zendesk.com/entries/21572740-1099-Misc-tax-forms 141 146 142 147 * **Who can I contact if I have additional questions?** … … 159 164 * Added a Help link in the Ebyline meta box. 160 165 166 = 1.1.0 = 167 * New feature: import completed projects from Ebyline. 168 161 169 == UPGRADE NOTICE == 162 170 -
ebyline-payments/trunk/text.php
r814636 r908445 14 14 const ALLPOSTS_STATUS = 'Status'; 15 15 const ALLPOSTS_NO_FEE_YET = 'None set yet'; 16 const ALLPOSTS_NO_FEE = 'None set'; 16 17 const ALLPOSTS_EDIT_FEE = 'Edit Fee'; 17 18 const ALLPOSTS_PAID = 'Paid'; … … 28 29 CONST METABOX_FREELANCER_BLURB = "Fee will be saved to the post and approved by editor when the story is published."; 29 30 31 // Import Projects text 32 const IMPORTER_DESCRIPTION = 'Import completed projects from Ebyline.'; 33 const IMPORTER_WELCOME = 'Greetings! This importer will import completed paid projects from Ebyline into your WordPress site.'; 34 const IMPORTER_INSTRUCTIONS = 'Each imported project will create a corresponding WordPress draft post.<br/>You can run this importer at any time - a new post will not be created if a project has been imported previously.'; 35 const IMPORTER_START = 'Click on the button below to log into Ebyline and start importing projects.'; 36 const IMPORTER_IMPORTBTN = 'Log into Ebyline and Import'; 37 const IMPORTER_DONE = 'Done with import! Projects have been imported as draft posts.'; 38 30 39 // Misc text 31 40 const PAYMENT_TOOLTIP = 'This will send you to Ebyline.com for payment'; … … 40 49 public static function get_endpoint_url() 41 50 { 51 if (defined('WP_EBYLINE_ENDPOINT')) { 52 return WP_EBYLINE_ENDPOINT; 53 } 42 54 return self::DEFAULT_ENDPOINT_URL; 43 55 } … … 45 57 public static function get_help_url() 46 58 { 47 return self::HELP_URL;59 return self::HELP_URL; 48 60 } 49 61 50 62 public static function get_version_query_param() 51 63 { 52 $param = '?plugin_version=' . urlencode(EBYLINE_VERSION);53 return $param;64 $param = '?plugin_version=' . urlencode(EBYLINE_VERSION); 65 return $param; 54 66 } 55 67 56 68 public static function get_payment_confirm_url() 57 69 { 58 $endpoint = self::get_endpoint_url();59 $url = "https://$endpoint/external/wordpress/payment-new";60 return $url . self::get_version_query_param();70 $endpoint = self::get_endpoint_url(); 71 $url = "https://$endpoint/external/wordpress/payment-new"; 72 return $url . self::get_version_query_param(); 61 73 } 62 74 63 75 public static function get_payment_complete_url() 64 76 { 65 $endpoint = self::get_endpoint_url(); 66 $url = "https://$endpoint/external/wordpress/payment-complete"; 67 return $url . self::get_version_query_param(); 77 $endpoint = self::get_endpoint_url(); 78 $url = "https://$endpoint/external/wordpress/payment-complete"; 79 return $url . self::get_version_query_param(); 80 } 81 82 public static function get_import_url() 83 { 84 $endpoint = self::get_endpoint_url(); 85 $url = "https://$endpoint/external/wordpress/import-projects"; 86 return $url; 68 87 } 69 88 } -
ebyline-payments/trunk/views/payment_metabox.php
r814636 r908445 72 72 $help_url = Ebyline_Text::get_help_url(); 73 73 echo "<span style='float: right'><a href='$help_url' target='_blank'>Need Help?</a></span>"; 74 echo "<div style='clear: right;'></div>"; 74 75 75 76 // Finally insert nonce stuff
Note: See TracChangeset
for help on using the changeset viewer.