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

Author Topic: SOLVED:Record Event/Contribution payment to other database?  (Read 1092 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:18:40 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:10:50 am by vhilly »

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Record Event/Contribution payment to other database aside from default drupal d?
October 12, 2011, 05:08:45 pm
Hi vhilly,

There are probably a couple of different ways to do that, but the best answer will depend on what your ultimate goal is -- that is: Why do you want to do this?

- Allen
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

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 aside from default drupal d?
October 16, 2011, 10:38:21 pm
Quote from: TwoMice on October 12, 2011, 05:08:45 pm
Hi vhilly,

There are probably a couple of different ways to do that, but the best answer will depend on what your ultimate goal is -- that is: Why do you want to do this?

- Allen

I want to record every success payment to my client's accounting programs database.. They want to have a copy of every success payment of event registration in their account receivable table..

i tried to user hook_postProcess but the array values the i can use is protected..

dont know how to get value of this ['_params:protected']=>array(....)
i can see values of array value _params using var_dump but icant get its values maybe because its protected.

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 aside from default drupal d?
October 17, 2011, 07:36:56 am

use

Code: [Select]
  $varValue = $form->getVar( VARNAME );

to get the values of protected variables

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 aside from default drupal d?
October 18, 2011, 01:13:22 am
Quote from: Donald Lobo on October 17, 2011, 07:36:56 am

use

Code: [Select]
  $varValue = $form->getVar( VARNAME );

to get the values of protected variables

lobo
It works great! Thanks Lobo

Heres my code hope this is correct
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
     }
}

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

This forum was archived on 2017-11-26.