OJS development discussion, enhancement requests, third-party patches and plug-ins.
Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca
This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
I would like to write a plugin for creating and sending an invoice / receipt (preferably in PDF format as an email attachment) right after a paypal payment has been processed. This is a requirement of our book keeping department, which says that the receipts paypal is sending out do not suffice - there's no VAT information included in them, for example.
However, I didn't even find a starting point, because I couldn't locate any hooks in the payment processing code (I've checked the files in /classes/payment, /lib/pkp/classes/payment and /plugins/paymethod), and the slightly outdated "technical reference" of OJS didn't say anything about it either. I didn't even understand how the paypal plugin is actually integrated and called.
Could somebody give me a hint about how I could integrate a plugin with the described functionality into OJS?
(In the forum when searching for "invoice" I mainly got hits for OCS. Does OCS already have an invoicing module?)
- Posts: 111
- Joined: Wed Jul 25, 2012 2:56 pm
- Location: Munich, Germany
The PayPal plugin is integrated by extending its superclass, PaymentPlugin, which uses hooks and API calls to interact with OJS. (See lib/pkp/classes/payment/PaymentManager.inc.php and classes/payment/ojs/OJSPaymentManager.inc.php for details.)
One way to extend the behavior of the paypal plugin would be to extend its PaypalPlugin class, implement your new behavior where needed, and fall back on the parent implementation otherwise. Alternately, hooks would be another method, but OTOH I don't think we included many in the PaypalPlugin class.
Public Knowledge Project Team
- Posts: 10015
- Joined: Wed Aug 10, 2005 12:56 pm
Return to OJS Development
Who is online
Users browsing this forum: No registered users and 1 guest