CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Wording sent to Paypal
Pages: [1]

Author Topic: Wording sent to Paypal  (Read 599 times)

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Wording sent to Paypal
October 29, 2014, 01:10:15 pm
When someone signs up for an event on our site and then goes to Paypal to pay, it says the item is an "Online Event Registration: <name of event>". This confuses some people, as they then think the training is online instead of in-person. I'd like to remove the word "Online" from the description that goes to Paypal, but cannot find where to do this.

Thanks!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Wording sent to Paypal
October 29, 2014, 01:28:54 pm
There is a hook (undocumented I believe) called alterPaymentParams - here is a bit of sample code (dealing with Authorize.net - field will be different for paypal

Code: [Select]
/**
 * Adjust credit card detail on description field
 * @param object $paymentObj
 * @param array $rawParams
 * @param array $cookedParams
 */
function surveyactions_civicrm_alterPaymentProcessorParams($paymentObj, &$rawParams, &$cookedParams) {
  if(empty($rawParams['contributionPageID']) && !empty($rawParams['custom_47_-1'])){
    $cookedParams['x_description'] = $rawParams['custom_166_-1'] . "-" . $rawParams['custom_47_-1'];
    $cookedParams['description'] = $rawParams['custom_166_-1'] . "-" . $rawParams['custom_47_-1'];
  }
  elseif (!empty($rawParams['contributionPageID']) || stristr($rawParams['description'], 'Online Event Registration')){
    $domain = civicrm_api('domain', 'getvalue', array('version' => 3, 'current_domain' => 1, 'return' => 'name'));
    $cookedParams['description'] = $cookedParams['x_description'] = $domain . '-WEB';
  }
  else {
    $domain = civicrm_api('domain', 'getvalue', array('version' => 3, 'current_domain' => 1, 'return' => 'name'));
    $cookedParams['description'] = $cookedParams['x_description'] = $domain;
  }
}
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Wording sent to Paypal
October 30, 2014, 07:47:16 pm
Is this something I would find in one of the CiviCRM files?

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Wording sent to Paypal
November 05, 2014, 12:44:13 pm
Not sure what to do with the information about the hook. Is it something I need to change in a file somewhere? If so, what file?

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Wording sent to Paypal
November 06, 2014, 03:40:42 am
You would need to create a Drupal module https://www.drupal.org/node/1074360 or CiviCRM extension http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension that contains (or to put it another way 'implements') that hook.

Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Wording sent to Paypal
December 02, 2014, 08:39:07 pm
But obviously the wording is coming from somewhere? It's not like it's just being made up on its own. Something in CiviCRM is sending that wording to Paypal.

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Wording sent to Paypal
December 09, 2014, 03:12:10 am
Quote
But obviously the wording is coming from somewhere? It's not like it's just being made up on its own. Something in CiviCRM is sending that wording to Paypal.

Yes but the way that you modify it is by using the hook alterPaymentParams (and you don't need to worry about where it is coming from) since you should be able to see what it is when you implement that hook. If you want to find out where it is coming , then looking for the invocation of alterPaymentParams will probably point you in the right direction
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Wording sent to Paypal
December 09, 2014, 07:28:37 pm
Problem is that the project doesn't have the funds to hire someone to do that work to use the hook, but it has to be done. So it falls to me to get it done and I don't know how to do that work. In the meantime I keep getting hounded about why something "so simple" isn't done yet.

Which means I need to find it in the files and change that one word there and then document the change so that we'll be able to make it in future versions. It shouldn't be this difficult to change one word so that it doesn't appear that the event is online. It's a big confusion to people who sign up for an in-person training and then the Paypal receipt looks like it's online.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Wording sent to Paypal
December 09, 2014, 07:43:09 pm
If you install civix

https://github.com/totten/civix

You can create the shell of an extension using the command

civix generate:module changewords

& then in changewords.php

/**
 * Adjust credit card detail on description field
 * @param object $paymentObj
 * @param array $rawParams
 * @param array $cookedParams
 */
function changewords_civicrm_alterPaymentProcessorParams($paymentObj, &$rawParams, &$cookedParams) {
    $cookedParams['x_description'] = 'newwords';
  }
}

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Wording sent to Paypal
December 09, 2014, 09:24:47 pm
Thanks, this makes it much easier. Just have to get the web host to install everything I need so that I can install civix.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Wording sent to Paypal
December 10, 2014, 07:54:37 pm
install it locally - it only generates the extension shell - you don't need it on the server
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Wording sent to Paypal
December 17, 2014, 12:17:05 am
According to the instructions, there was a bunch of stuff I needed to install on my Windows machine in order to be able to run it. I got stuck partway through, as one of the required elements wouldn't install. So I just had my host help me get everything installed on my server.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Wording sent to Paypal

This forum was archived on 2017-11-26.