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) »
  • qfkey and profile on after successful paypal
Pages: [1]

Author Topic: qfkey and profile on after successful paypal  (Read 699 times)

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
qfkey and profile on after successful paypal
June 18, 2012, 01:32:16 pm
So I am still struggling to detect a valid paypal payment.

I need to detect a successful payment and this seems to be only possible by looking for the return url / thank you page IF the user clicks to come back to the site. This is just going to have to be accepted as the other option of assuming of payments complete if click the "continue to paypal" is not acceptable.

So, on verifying we are on a thank page, by checking the url for '_qf_ThankYou_display', we then have to try and figure what user we are dealing with.

There is another url param
qfKey=

Now, from logging everything that is written to the database after I click the "continue to paypal to pay" button, I can see the following writes to the db.


Code: [Select]
info from:
function civicrm_post( $op, $objectName, $objectId, &$objectRef )

op: create
object name: Profile
object: Array
(
    [qfKey] => b3xxxxxxx70a655a6d6395e8afb1c_8533
    [scriptFee] =>
    [scriptArray] =>
    [email-5] => name@gmail.com
    [amount] => 0.01
    [MAX_FILE_SIZE] => 268435456
    [is_primary] => 1
    [contact_id] =>
    [campaign_id] =>
    [defaultRole] => 1
    [participant_role_id] => 1
    [currencyID] => USD
    [amount_level] => Normal Ticket
    [ip_address] => xxx.xxx.xx.xxx
    [payment_action] => Sale
    [invoiceID] => a628xxxxxxxxxxxxx809dd9
    [address_name-5] =>   
    [addressee_id] => 1
    [email_greeting_id] => 1
    [postal_greeting_id] => 1
)

Now this qfKey matches the qfKey in the URL when I return back to my site after a success payment has been made and we are now seeing the thank you page (Well the thank you page wasn't displaying, but that is another post still to come)

So I assume I want to pull the database entry that contains this qfKey, then I can pull the contact record with the email address provided by the profile object.

But I have a problem, I cannot find the table that has the above profile information. There is no civicrm_profile table, so I do not know where this information is stored to request it.
You did not answer the verification questions correctly - sigh

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: qfkey and profile on after successful paypal
June 18, 2012, 02:11:54 pm

Might be better to trap the IPN that paypal sends on a successful transaction rather than the below hack

I'm pretty sure hooks are triggered during the ipn process

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

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
Re: qfkey and profile on after successful paypal
June 18, 2012, 05:07:42 pm
Thanks, that was all needed "ipn".

Was able to find other threads which pointed me to where I needed to be.

So much time wasted for the want of three little letters :)
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) »
  • qfkey and profile on after successful paypal

This forum was archived on 2017-11-26.