OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



ocs and paypal

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

ocs and paypal

Postby ppound » Tue Jul 31, 2007 11:58 am

We would like to use OCS and have users pay for registration by paypal. We have different departments that would each have their own conferences but share one paypal account. To determine where the money should go we would like to customize what OCS sends to paypal. Currently it sends an Item Title of Conference Registration and an Item ID of 1 no matter what registration type is chosen or what conference we register for. We would like to prefix the Item Title with the conference name or something and maybe send an unique id for Item ID.

Anybody have any advice on where to start? I have looked in PayPalPaymentForm.inc.php and it looks like I could add the info here but not sure if that is the best way.

Thanks,
Paul
ppound
 
Posts: 13
Joined: Tue Jul 31, 2007 11:36 am

Re: ocs and paypal

Postby asmecher » Tue Jul 31, 2007 1:45 pm

Hi Paul,

The description of the item is set in classes/payment/ocs/OCSQueuedPayment.inc.php in the getDescription function; that's the best place to add the conference name. Instead of:
Code: Select all
case QUEUED_PAYMENT_TYPE_REGISTRATION:
    return Locale::translate('payment.type.registration');
...you could use...
Code: Select all
case QUEUED_PAYMENT_TYPE_REGISTRATION:
    $conferenceDao =& DAORegistry::getDAO('ConferenceDAO');
    $conference =& $conferenceDao->getConference($this->conferenceId);
    return Locale::translate('payment.type.registration', array('conferenceTitle' => $conference->getTitle()));
You'd need to change the payment.type.registration key in the locale file (locale/en_US/locale.xml) to include the {$conferenceTitle} variable wherever you wanted it displayed.

Otherwise, the PayPalPaymentForm.inc.php class is probably the best place to make your changes. If you think they'd be suitable for inclusion in the next release, please consider submitting them to us as a unified patch (diff -u).

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8597
Joined: Wed Aug 10, 2005 12:56 pm

Re: ocs and paypal

Postby ppound » Tue Sep 11, 2007 5:31 am

Thanks for the reply. Works great.
For the item id we are thinking of sending the scheduled conference acronym to paypal. In our case it would be just a number and for a few existing conferences we would have to change this.

My question is what are the ramification if any if we go into the database and change the acronym for existing conferences?

Also where is the acronym used? I don't think i have seen it anywhere.

Thanks,
Paul
ppound
 
Posts: 13
Joined: Tue Jul 31, 2007 11:36 am

Re: ocs and paypal

Postby asmecher » Tue Sep 11, 2007 6:18 am

Hi Paul,

You shouldn't cause any problems by changing this.

You're correct that the acronym isn't currently used at the moment, but it's good general information for OCS to have at its disposal -- it will likely be used in the future by plugins, for example.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8597
Joined: Wed Aug 10, 2005 12:56 pm

Re: ocs and paypal

Postby ppound » Tue Sep 11, 2007 9:29 am

I have one more question (hopefully only one more). I would like to append the typeid of the registration type to the acronym that we are sending to paypal as the item id. If we know the registration type accounting will know a bit more about the transaction.

So we would have a item id similar to 12345:1 (schedule conf acronym:registration typeid). I can't find anywhere to get the registration type from. Anyone have any ideas on the best place to look? I have looked at queuedPayment etc. but I don't think it has the info I need.

Thanks again for your help.
Paul
ppound
 
Posts: 13
Joined: Tue Jul 31, 2007 11:36 am

Re: ocs and paypal

Postby asmecher » Wed Sep 12, 2007 3:18 pm

Hi Paul,

I'd suggest adding a new member variable to the OCSQueuedPayment class, defined in classes/payment/ocs/OCSQueuedPayment.inc.php, to include registration type info. Also add a set... and get... function as per the others. Then modify classes/payment/ocs/OCSPaymentManager.inc.php to include the new information in the createQueuedPayment function, and likewise modify classes/registration/form/UserRegistrationForm.inc.php to provide the registration type ID to its call to createQueuedPayment.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8597
Joined: Wed Aug 10, 2005 12:56 pm


Return to OCS Technical Support

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 2 guests