OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



modification of payment procedure

OCS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, michael

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page. While these are OJS-specific, the OCS codebase is similar enough to OJS they should be of help. There is also an [url=http://pkp.sfu.ca/ocs_documentation[/url]OCS Documentation[/url] page with some more general documentation that might also be of interest.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a technical support question, try the OCS Technical Support subforum.

modification of payment procedure

Postby iluber » Thu Aug 21, 2008 9:07 am

I would like to modify the payment process in OCS and since I think it coul be something that could be given back to OCS has a contibution I would like some suggestion on how to do that.

Actually it's possible for the user to use only one payment method: the one configured in the backend.
First I was planning to enhance OCS to be configured to display to the user more than one payment method, but I have changed my mind because it would be to expensive in time for me, since it would involve a change in the database schema and changes both at the user and backend sides of the interface.

Then I have thought to change the behavior of OCS so to show always the manual payment as an option to the user, even if an online payment method has been configured.

For what I see this could be done only changing the behavior of OCS in the registering user interface.

Is this something that could be added to OCS next release if properly realized ?

If yes, then I could write it and send a patch, otherwise I should implement a plugin but it could be more time expensive.
If I should implement the plugin, since, for what I see there are not hooks neither in php files nor in the templates involved in the registration process, I could use the hook in the OCS root index.php page to change the $sourceFile variable so to pass to the following require the proper argument to redirect the request to my new registration form.

Can some of the developers tell me what you guys think about all I have written above just to know if I'm on the right path?
iluber
 
Posts: 30
Joined: Wed May 14, 2008 8:11 am
Location: Pisa, Italy

Re: modification of payment procedure

Postby iluber » Thu Sep 04, 2008 12:34 am

any hope to receive an answer ?
iluber
 
Posts: 30
Joined: Wed May 14, 2008 8:11 am
Location: Pisa, Italy

Re: modification of payment procedure

Postby jalperin » Thu Sep 04, 2008 9:03 am

iluber,

My apologies for the long delay in replying. I am the primary developer of the payment module, but I have not had a chance to reply to forum posts in the last few weeks. I hope that I can help answer your questions and concerns in a more timely fashion from here on in.

Your idea is one that I would like to have implemented in both the OCS and OJS core code as a configurable option sometime in a future release, so any work you may do to get us going down this path would be most welcome as a patch for consideration. I agree that it will be a bit more time intensive to allow for any number of payment methods, but I think it is the way we'd like go go.

I would suggest something along the lines of the following:
- convert the paymethod journal setting into an array, allowing for any number of options to be selected.
- you will have to change the UI for paymethod settings so that more than one option can be enabled at a time (probably with checkboxes)
- change the registration screen so that the user is presented with all the available options. For this you will have to go to the paymentHandler and intercept the method that displays the payment form. Instead, multiple options should be selected, each leading to the appropriate payment form.

Does this make sense? Its my initial thoughts on the subject and they are open to discussion as you try to tackle the problem and face challenges. I'll be happy to review intermediate work or a finished product once you have something ready.

Thank you for your interests
jalperin
 
Posts: 154
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: modification of payment procedure

Postby iluber » Fri Sep 05, 2008 11:33 am

jalperin, I hope I didn't seem rude, it was only a way to send an alert, since I know administrators of the forum receive notifications usually of the new messages.
I perfectly agree about your suggestions: it was exactly the path I meant to follow.
I probably will ask for some clarification once I start to implement the modification.
Thank for your answer.
iluber
 
Posts: 30
Joined: Wed May 14, 2008 8:11 am
Location: Pisa, Italy

Re: modification of payment procedure

Postby iluber » Mon Feb 22, 2010 10:29 am

I have been solicited by user of the forum, then I post how I have solved the problem

Unfortunately I couldn't follow the path illustrated in the post because of lack of time.
So my solution is not clean as it should be and I have never had the chance to write a patch due to the fact that my repository got broken a few times and I had to restore my working copy which included a lot of changes in many points of OCS code.

What I had done is basically the following.
I didn't add a new configuration option, the user either select the manual or the paypal option.
In the template I have modified the layout so that when paypal payment mode is configured, it shows a radiogroup.
Then the user must choose either one of them.
In the execute method of the UserRegistratioForm I have inserted a call to a new method defined in class PaymentManager

function displayPaymentFormUserChosen($queuedPaymentId, &$queuedPayment, $paymentMethodPluginName) {
$paymentPlugin =& $this->getPaymentPluginByName($paymentMethodPluginName);
if ($paymentPlugin !== null && $paymentPlugin->isConfigured()) return $paymentPlugin->displayPaymentForm($queuedPaymentId, $queuedPayment);
return false;
}


Where the value of the $paymentMethodPluginName parameter is the value passed at form submission by selecting one of the two radios.
In this way the payment method used depends both from the configuration and the user choice.
iluber
 
Posts: 30
Joined: Wed May 14, 2008 8:11 am
Location: Pisa, Italy


Return to OCS Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron