Plugin Directory

Changeset 908445


Ignore:
Timestamp:
05/05/2014 07:57:44 PM (12 years ago)
Author:
ebylinewp
Message:

Version 1.1.0 changes: fixed some minor payment issues and added feature to import paid projects from Ebyline

Location:
ebyline-payments/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ebyline-payments/trunk/ebyline.php

    r814636 r908445  
    44  Plugin URI: http://ebylinepayments.com/
    55  Description: Introducing Ebyline Payments, a plugin that helps you make payments to your WordPress authors within the WordPress Admin.
    6   Version: 1.0.1
     6  Version: 1.1.0
    77  Author: Ebyline
    88  Author URI: http://www.ebyline.com
     
    1515 */
    1616
    17 define("EBYLINE_VERSION", "1.0");
     17define("EBYLINE_VERSION", "1.1");
    1818
    1919if(!class_exists('Ebyline_Plugin'))
     
    4444      $payment = new Ebyline_Payment();
    4545
     46      // Initialize importer module
     47      $path = sprintf("%s/import.php", dirname(__FILE__));
     48      require_once($path);
    4649
    4750      // Print out revision so we know what exact build is currently running
     
    6265    }
    6366    // END activate
    64  
     67
    6568    /**
    6669     * Deactivate the plugin
    67      */   
     70     */
    6871    public static function deactivate()
    6972    {
     
    7275    // END deactivate
    7376
    74    
     77
    7578    public function init_callbacks()
    7679    {
  • ebyline-payments/trunk/payment.php

    r795485 r908445  
    2323    }
    2424    // END public function __construct
    25    
    26    
     25
     26
    2727    public function payment_admin_init()
    2828    {
     
    3333      // wp_register_style( 'ebyline_payment_stylesheet', plugins_url('css/payment.css', __FILE__) );
    3434
    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.
    3638      wp_register_script('ebyline_payment_script', plugins_url('scripts/payment.js', __FILE__), array('jquery'));
    3739
     
    104106    {
    105107      $fee = Ebyline_Post::get_fee($post_id);
     108      $isImportedProject = Ebyline_Post::get_project_id($post_id) != '';
    106109      $is_current_user = get_current_user_id() == get_post($post_id)->post_author;
    107110
     
    114117          if ($fee == 0)
    115118          {
    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            }
    117124            echo $fee;
    118125          }
     
    132139        if (Ebyline_Plugin::is_admin())
    133140        {
    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)
    135144          {
    136145            $edit_url = get_edit_post_link($post_id);
     
    219228      }
    220229    }
    221    
     230
    222231    public function on_payment_page_load()
    223232    {
     
    251260      //   wp_die(__('You do not have sufficient permissions to access this page.'));
    252261      // }
    253  
     262
    254263      // Render the settings template
    255264      // include(sprintf("%s/views/payment.php", dirname(__FILE__)));
  • ebyline-payments/trunk/post.php

    r795485 r908445  
    1515    const META_KEY_POST_APPROVER      = 'ebyline_approver';   // Author id of who paid for post
    1616    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)
    1718
    1819    public static function get_fee($post_id)
     
    101102    // END get_payment_link
    102103
     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
    103117
    104118
     
    145159    }
    146160    // 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
    147167  }
    148168  // END class Ebyline_Posts
  • ebyline-payments/trunk/readme.txt

    r846072 r908445  
    55Tags: payments, freelance, editors, invoicing, contributors, paypal, authors, approvals
    66Requires at least: 3.0.1
    7 Tested up to: 3.5.1
     7Tested up to: 3.8.1
    88Stable tag: trunk
    99License: GPLv2 or later
     
    2222* Easy install and setup
    2323* Make payments via credit card to contributors directly in the Wordpress interface
     24* Import Ebyline projects directly into your WordPress site
    2425* Contributors receive payments via PayPal
    2526* Browse history of any payment for any post
     
    6566 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.
    6667
     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
    6772 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
    6873
     
    7782* **How can I see information about previous purchases?**
    7883
    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
    8186 1.  Log into your Ebyline editor account at www.ebyline.com/login
    8287 1.  Click the “Transactions" folder at the lower left of the screen.
     
    103108* **What payment methods are available?**
    104109
    105 Payments are issued to contributors via PayPal only.
     110 Payments are issued to contributors via PayPal only.
    106111
    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.
    108113
    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.)
    110115
    111116 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
     
    113118* **What does this cost me?**
    114119
    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.
    116121
    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.
    118123
    119124* **How can I see information about previous payments?**
     
    136141* **How does the tax reporting work?**
    137142
    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.
    139144
    140 For more information on tax forms, click here: https://ebyline.zendesk.com/entries/21572740-1099-Misc-tax-forms
     145 For more information on tax forms, click here: https://ebyline.zendesk.com/entries/21572740-1099-Misc-tax-forms
    141146
    142147* **Who can I contact if I have additional questions?**
     
    159164* Added a Help link in the Ebyline meta box.
    160165
     166= 1.1.0 =
     167* New feature: import completed projects from Ebyline.
     168
    161169== UPGRADE NOTICE ==
    162170
  • ebyline-payments/trunk/text.php

    r814636 r908445  
    1414    const ALLPOSTS_STATUS = 'Status';
    1515    const ALLPOSTS_NO_FEE_YET = 'None set yet';
     16    const ALLPOSTS_NO_FEE = 'None set';
    1617    const ALLPOSTS_EDIT_FEE = 'Edit Fee';
    1718    const ALLPOSTS_PAID = 'Paid';
     
    2829    CONST METABOX_FREELANCER_BLURB = "Fee will be saved to the post and approved by editor when the story is published.";
    2930
     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
    3039    // Misc text
    3140    const PAYMENT_TOOLTIP = 'This will send you to Ebyline.com for payment';
     
    4049    public static function get_endpoint_url()
    4150    {
     51        if (defined('WP_EBYLINE_ENDPOINT')) {
     52            return WP_EBYLINE_ENDPOINT;
     53        }
    4254        return self::DEFAULT_ENDPOINT_URL;
    4355    }
     
    4557    public static function get_help_url()
    4658    {
    47       return self::HELP_URL;
     59        return self::HELP_URL;
    4860    }
    4961
    5062    public static function get_version_query_param()
    5163    {
    52       $param = '?plugin_version=' . urlencode(EBYLINE_VERSION);
    53       return $param;
     64        $param = '?plugin_version=' . urlencode(EBYLINE_VERSION);
     65        return $param;
    5466    }
    5567
    5668    public static function get_payment_confirm_url()
    5769    {
    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();
    6173    }
    6274
    6375    public static function get_payment_complete_url()
    6476    {
    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;
    6887    }
    6988  }
  • ebyline-payments/trunk/views/payment_metabox.php

    r814636 r908445  
    7272  $help_url = Ebyline_Text::get_help_url();
    7373  echo "<span style='float: right'><a href='$help_url' target='_blank'>Need Help?</a></span>";
     74  echo "<div style='clear: right;'></div>";
    7475
    7576  // Finally insert nonce stuff
Note: See TracChangeset for help on using the changeset viewer.