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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • SOLVED!Record Event/Contribution payment to other database?
Pages: [1]

Author Topic: SOLVED!Record Event/Contribution payment to other database?  (Read 1878 times)

vhilly

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: php 5
SOLVED!Record Event/Contribution payment to other database?
October 10, 2011, 01:03:42 am
I want to record every successful payments from my online contribution and online event registration to a another database(eg. weberpdb).. how do i do that? any hook for that? I am using paypal Pro as my payment processor.. please help me im lost  :-[

I want to record contact id,transaction code, event/contribution name, amounts paid
« Last Edit: October 18, 2011, 01:08:55 am by vhilly »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Record Event/Contribution payment to other database?
October 10, 2011, 06:17:23 am

use the postProcess page on the ThankYou page of the contribution. Check:

http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmpostProcess
http://en.flossmanuals.net/civicrm-developer-guide/

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Record Event/Contribution payment to other database?
October 10, 2011, 11:35:38 am
We should introduce another hook in the IPN probably - ie. for recurring ones.
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

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Record Event/Contribution payment to other database?
October 10, 2011, 03:33:51 pm

ipn's currently do not bootstrap the CMS and hence no hooks are called

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Record Event/Contribution payment to other database?
October 10, 2011, 03:41:59 pm
Ah
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

vhilly

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: php 5
Re: Record Event/Contribution payment to other database?
October 10, 2011, 08:23:00 pm
Ok thank you so much ill try ..  :)

vhilly

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: php 5
Re: Record Event/Contribution payment to other database?
October 10, 2011, 08:23:46 pm
Quote from: Donald Lobo on October 10, 2011, 06:17:23 am

use the postProcess page on the ThankYou page of the contribution. Check:

http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmpostProcess
http://en.flossmanuals.net/civicrm-developer-guide/

lobo

Ok il try it .. Thank so much!

vhilly

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: php 5
Re: Record Event/Contribution payment to other database?
October 11, 2011, 01:12:40 am
Quote from: Donald Lobo on October 10, 2011, 06:17:23 am

use the postProcess page on the ThankYou page of the contribution. Check:

http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmpostProcess
http://en.flossmanuals.net/civicrm-developer-guide/

lobo

Quote from: Donald Lobo on October 10, 2011, 06:17:23 am

use the postProcess page on the ThankYou page of the contribution. Check:

http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmpostProcess
http://en.flossmanuals.net/civicrm-developer-guide/

lobo

I tried this hook ..  $form and $formName returns so many value in which i dont know what i should i use as condition to trigger my db query..

I use var_dump() to display what $form and $formName would return .. after that i dont know where to start coz i dont know which of array value i should use to define if payment success or not.. please help me.. sorry for my being newbie

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Record Event/Contribution payment to other database?
October 11, 2011, 06:37:36 am

if it comes to the thank you page,it is a success. You'll need to take a look at the page and see what variables are applicable to you. Might want to take a look at the ThankYou.php page and see what variables are defined there

sorry cant help a lot more in detail w/o spending more time on it

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

vhilly

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: php 5
Re: Record Event/Contribution payment to other database?
October 18, 2011, 01:07:14 am
Quote from: Donald Lobo on October 11, 2011, 06:37:36 am

if it comes to the thank you page,it is a success. You'll need to take a look at the page and see what variables are applicable to you. Might want to take a look at the ThankYou.php page and see what variables are defined there

sorry cant help a lot more in detail w/o spending more time on it

lobo

Ok thanks , i got it now.. hopefully its correct ..
Heres my code

function modulename_civicrm_postProcess( $formName, &$form ){
if ( ! is_a($form, 'CRM_Event_Form_Registration_Confirm') ) {
        return;
}
      $params =& $form->getVar( '_params' ); // _params is protected
     if($params["payment_status"] == "Completed"){
       //record payment data to accounting db
     }
}

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
Re: SOLVED!Record Event/Contribution payment to other database?
June 15, 2012, 06:17:52 am
<<sorry old thread resurrection, but is relevant (i think)>>

If you are hooking into the 'CRM_Event_Form_Registration_Confirm' event, what happens if after a successful purchase the user is not automatically redirected back to the website from Paypal (or clicks to go to seller website)?

In my tests of paypal purchasing, you can purchase the event ticket / make a donation that is successful, then afterwards, you are able to close the window of paypal without being redirected back to the website for this event to fire.

Thus if you have some critical processing todo on a success purchase it does not happen!

But civi is getting another callback from paypal somewhere, as a db entity is created that can be searched from the contribution page.

Anyone know if this success event can be hooked into?

You did not answer the verification questions correctly - sigh

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • SOLVED!Record Event/Contribution payment to other database?

This forum was archived on 2017-11-26.