› Forums › Post Pay Counter PRO › Support › Pay to Editors
We are based in Europe with a GMT+1/GMT+2 time zone - support replies may be delayed due to time zone differences with your country.
- This topic has 5 replies, 2 voices, and was last updated 10 years, 1 month ago by Stefano.
-
AuthorPosts
-
September 29, 2014 at 9:40 pm #9938MauroKeymaster
Hello,
We have a client that it has the Post Pay Counter Pro plugin. This client wants to enable payments to editors.
For example:
Author submits a post (Draft->Pending)
Editor fixes the post and publishes it (Pending->Publish)Author will be paid with $1 and Editor with $0.25.
Is this possible with the current functionality of the plugin?
Do you have a function that we can call for example like pay_to_user($user_id,$post_id)?Thanks in advance
September 29, 2014 at 10:11 pm #9943StefanoKeymasterHi Mauro,
you are looking for some king of publisher bonus, right? If that’s the case, I’m currently working on the feature, and I should be ready for release in around a week, so it’s just a matter of a bit of patience.Hope this helps!
Have a nice day,
StefanoSeptember 29, 2014 at 11:35 pm #9956MauroKeymasterStefano,
Thanks for your response.
These new functionality you are working on, will have a function like I gave you in the example?I mean for example, if I create a plugin and add this:
function new_function( $post ) { pay_to_user(get_current_user_id(),$post->ID, 0.25); } add_action( 'pending_to_draft', 'new_function', 10, 1 );
Where pay_to_user is a function of your plugin:
function pay_to_user( $user_id, $post,$amount ) { //it pays the amount to the user }
My question is to know if I will be able to assign an amount of cash to an user from every part of the site.
September 30, 2014 at 7:26 am #10017StefanoKeymasterThere are actions and filters in place that allow you to hook to the plugin countings and amounts and add your own, but it’s not that easy as you show in your example, at least not for now. If you need developer details, since there is no documentation of the kind right now, I’m available 🙂
The good news is that you won’t have to do it for the publisher bonus, as it will be shipped as a core feature soon, anyway
October 1, 2014 at 4:16 am #10173MauroKeymasterI don’t know where to find documentation about the plugin (if there is some)
The client ask me to do a post list for each user that contains:
Post Title – Writing amount – Paid/Not PaidI was seeing the code and I assumed that maybe all that data is in _ppcp_payment_history postmeta. But I have some doubts:
1- What is the difference between ppc_payment and ppc_count?
2- If verified is 1 it means that it has been paid?Thanks in advance, and if you have dome documentation that I could read, please tell where!
Regards
October 1, 2014 at 7:36 am #10196StefanoKeymasterI haven’t written any developer documentation yet, unfortunately, but pleease feel free to ask anything!
You got it right: all payment data is stored in the payment history records. Beware, though, that next release will come with a redesigned payment history system. It will still work with old records, but there will be 3 different kinds of payment historyes and, most importantly, there will be functions that will make far easier to deal with payment histories. For example, if what you’re trying to achieve is basically a list of all paid posts for each author, you’d only have to call get_author_payment_history( $author) to have it, and then just cycle through it and display it the way you need it.
The difference between ppc_count and ppc_payment is as follows. Say you have a post that in month A scored 500 visits, and was paid $5.00: ppc_count would hold the number of visits you paid (500) and ppc_payment the amount ($5.00, though without the currency). Now, why? Cause now the post gets 500 visits more in month B, but you raised the payment and you’re now paying $6.00. This allows two things:
a) when the payment history is displayed, numbers are correct. If we hadn’t stored that the first transaction was $5.00, current settings would value that same number of visits as $6.00, and the display would not be correct;
b) if we didn’t know the first trnsaction paid for 500 visits, but only that we paid $5.00, we could assume we owed $1.00 more, since the plugin now evaluates those visits as $6.00. For the due payment computation, it is not important how much he was paid, but for what and for what amounts he was paid for.If verified is 1, it means the transaction was made through PayPal and that PayPal IPN reported back it was successfully executed.
Hope this helps!
Have a nice day,
Stefano -
AuthorPosts
- The topic ‘Pay to Editors’ is closed to new replies.