Item Title sent to PayPal by OCS

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
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.
ozcelik
Posts: 26
Joined: Sun Sep 23, 2007 9:25 pm

Item Title sent to PayPal by OCS

Postby ozcelik » Mon Jan 07, 2008 5:47 pm

Hi Alec,

Our conference has two different types of registration (professor and student). By default, OCS sends the Item Title "Conference Registration" no matter which one is chosen. How do we make such a change so that OCS can send the name of the Registration type to PayPal, rather than just "Conference Registration".

Since this topic may be useful to other users of this forum, I would appreciate if you can provide step-by-step instructions for us.

Regards,

Jason

ozcelik
Posts: 26
Joined: Sun Sep 23, 2007 9:25 pm

Re: Item Title sent to PayPal by OCS

Postby ozcelik » Tue Jan 08, 2008 3:52 pm

Any help on this modification?

Sorry to bother, but we need to solve this problem before making our conference website available for use. Many thanks in advance.

Jason

ozcelik
Posts: 26
Joined: Sun Sep 23, 2007 9:25 pm

Re: Item Title sent to PayPal by OCS

Postby ozcelik » Tue Jan 08, 2008 9:20 pm

Hi Guys,

I am still trying to find a solution to my question. Upon searching through the forum, I have found the following advice given by Alec:

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.

Could anyone explain the above steps more specifically? Any help will be appreciated.

Jason

jmacgreg
Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am
Contact:

Re: Item Title sent to PayPal by OCS

Postby jmacgreg » Tue Jan 08, 2008 10:20 pm

Hi Jason,

We're working on a patch for this specifically; we'll let you know when it's available, which will hopefully be fairly shortly.

Cheers,
James

ozcelik
Posts: 26
Joined: Sun Sep 23, 2007 9:25 pm

Re: Item Title sent to PayPal by OCS

Postby ozcelik » Wed Jan 09, 2008 8:38 am

Thanks, James. I look forward to it. I guess this feature should be included by default in the next version of the OCS.

Jason

ozcelik
Posts: 26
Joined: Sun Sep 23, 2007 9:25 pm

Re: Item Title sent to PayPal by OCS

Postby ozcelik » Sun Jan 13, 2008 9:40 pm

Hi,

I hate to bother again, but, have you guys had a chance to create a patch for this problem? I really appreciate your time and help on this matter.

Regards,

Jason

jmacgreg
Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am
Contact:

Re: Item Title sent to PayPal by OCS

Postby jmacgreg » Sun Jan 13, 2008 10:17 pm

Hi Jason,

Sorry for the lack of feedback on this front -- this is my first priority for the upcoming week, and I should have some results for you in a day or two.

Cheers,
James

ozcelik
Posts: 26
Joined: Sun Sep 23, 2007 9:25 pm

Re: Item Title sent to PayPal by OCS

Postby ozcelik » Mon Jan 14, 2008 6:54 pm

Hi James,

Thank you. We look forward to it, well, desperately :-)

Jason

jmacgreg
Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am
Contact:

Re: Item Title sent to PayPal by OCS

Postby jmacgreg » Tue Jan 15, 2008 6:32 pm

Hi Jason,

Here's the fix. You can apply the following diff to classes/payment/ocs/OCSQueuedPayment.inc.php:

Code: Select all

--- OCSQueuedPayment.inc.php.orig       2008-01-15 14:44:49.000000000 -0800
+++ OCSQueuedPayment.inc.php    2008-01-15 17:23:16.000000000 -0800
@@ -59,7 +59,22 @@
        function getDescription() {
                switch ($this->type) {
                        case QUEUED_PAYMENT_TYPE_REGISTRATION:
-                               return Locale::translate('payment.type.registration');
+                       // Get the registration object using the assoc ID of the queued payment
+                       $registrationDao =& DAORegistry::getDAO('RegistrationDAO');
+                       $registration =&
+                       $registrationDao->getRegistration($this->getAssocId());
+                       if (!$registration) return ''; // Bonehead check; should never happen
+
+                       // Get the registration type object from the registration object
+                       $registrationTypeDao =&
+                       DAORegistry::getDAO('RegistrationTypeDAO');
+                       $registrationType =&
+                       $registrationTypeDao->getRegistrationType($registration->getTypeId());
+                       if (!$registration) return ''; // Bonehead check; should never happen
+
+                       // Return the description of the queued payment, including registration type info
+                       return Locale::translate('payment.type.registration', array('typeName' => $registrationType->getTypeName()
+                       ));
                }
        }
 }


You'll then want to modify the locale key "payment.type.registration" to modify the typeName output. Something like this will work fine:

Code: Select all

<message key="payment.type.registration">Conference Registration
({$typeName})</message>


Remember that you'll have to do that for every locale you support. The English locale file can be found at locale/en_US/locale.xml. Just look for the above line.

We'll be adding this to future OCS versions; I'll be submitting this to Bugzilla, but I thought you'd want it first. Please let me know how the fix goes for you.

Cheers,
James

ozcelik
Posts: 26
Joined: Sun Sep 23, 2007 9:25 pm

Re: Item Title sent to PayPal by OCS

Postby ozcelik » Tue Jan 15, 2008 7:45 pm

Hi James,

The fix works like a charm! You can safely add it to the future versions of OCS.

You have just saved a month for us. Thank you very much!

Regards,

Jason


Return to “OCS Technical Support”

Who is online

Users browsing this forum: No registered users and 1 guest