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) »
  • Custom Paypal-like Processor?
Pages: 1 [2]

Author Topic: Custom Paypal-like Processor?  (Read 5271 times)

lentilsoup

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 6
Re: Custom Paypal-like Processor?
January 18, 2009, 03:14:40 pm
Thanks.  I think I've got that sorted out.  It's now processing the transaction properly.

I'm running into a different problem now that seems to be more fundamental.  The IPN script only returns a simple text string, presumably assuming that the user is being redirected separately.  But because my payment processor presents the user with the HTML returned by the IPN script instead of redirecting the user to a separate thanks URL, the user is left stranded with a white screen and a single line of text.  I just tried using an HTTP redirect, but the processor only spits out "An Error Occurred: 302 Found".

What can I do in order to give the user the HTML returned by the thanks page?  Do I have to resort to cURL requests on my own site, or can I reroute the request once I'm done with the transaction processing?

Thanks again!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Custom Paypal-like Processor?
January 18, 2009, 03:35:31 pm
The payment express (pxIPN.php) is a good model for you. It copes with both the user returning to it and the separate IPN calls by the payment processor.

I would also suggest using the payment express code as a good guideline for the return processing as the processor specific functions are more separated out in it than in the earlier processors it was based on. (i.e. the 'main' function processes the return data and then passes it to generic functions for completion)
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

lentilsoup

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 6
Re: Custom Paypal-like Processor?
January 18, 2009, 03:53:33 pm
The trouble is that the Payment Express IPN uses an HTTP redirect to give the user the "thanks" page, which is apparently not an option with my processor.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Custom Paypal-like Processor?
January 18, 2009, 04:00:22 pm
I can't make sense of that - do you mean the user's browser is not returned to the ipn.php script?

You haven't missed this line out have you?


$config =& CRM_Core_Config::singleton();

The redirection occurs on line 402 of PaymentExpressIPN.php

         CRM_Utils_System::redirect( $finalURL );   
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

lentilsoup

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 6
Re: Custom Paypal-like Processor?
January 18, 2009, 04:04:22 pm
Quote from: Eileen on January 18, 2009, 04:00:22 pm
I can't make sense of that - do you mean the user's browser is not returned to the ipn.php script?

That's exactly what I mean.  The processor makes the request to ipn.php itself and then presents the user with whatever HTML ipn.php returns to it.

I agree that it's a horrible way to do things, but I neither wrote nor chose the processor.  I just need to integrate with it.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Custom Paypal-like Processor?
January 18, 2009, 04:21:06 pm
yuck! And there's definitely no other configurable options in the processor?
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

lentilsoup

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 6
Re: Custom Paypal-like Processor?
January 18, 2009, 04:26:22 pm
Nope.  Fun, eh?

So... Do you know if it's possible to redirect a second request back through CiviCRM when it's done processing the transaction, or do I need to resort to cURL?

----------

EDIT: Kicked its butt with a meta refresh tag.   ::)

Should be down to a matter of picky details now.  Thank you both for your help (and I may be back for more).
« Last Edit: January 18, 2009, 04:45:28 pm by lentilsoup »

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom Paypal-like Processor?

This forum was archived on 2017-11-26.