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) »
  • New payment processor in notify mode
Pages: [1]

Author Topic: New payment processor in notify mode  (Read 2774 times)

Smith

  • Guest
New payment processor in notify mode
January 20, 2010, 10:41:23 pm
Hello everybody,

I'm writing a new payment processor, for Ogone (http://www.ogone.com), an european online payment company.

I'm using CiviCRM 3.0.3 with Drupal 6.15

I'm using 'notify' mode because Ogone ask the data to be send via POST method on their website.

The schema for the payment is the following :

Contribution/Event Page -> OgoneWebsite (POST data)->Choose Payment Method->Pay on the Ogone web site -> Civicrm Confirmation

After reading some doTransferCheckout (PaymentExpress, PayPalImpl) I'm able to post data from CiviCRM to ogone, but I run some problems and I need a little help.

- The amount must be multiplied by 100 so I did the following cheat in the code :

... after CRM_Utils_Hook...

if ( $key == 'amount' ) {
                $value = $value * 100;
}

- Also, I'm using the invoiceID as orderID but orderID has to be 30 characters MAX. So little trick too :

if ( $key == 'orderID' ) {
                $value = substr($value,2);
}

But I have now different infos on CiviCRM and Ogone, is there a way to generate in CiviCRM an invoiceID of 30 characters MAX ?

Last point,

At the end of the payment processing, when pushing to "Return to merchant site", I run into some difficulties to go to the thank you/confirmation page  >:(

I think it's $url = $config->userFrameworkResourceURL
and
$cancelURL = CRM_Utils_System::url( 'civicrm/contribute/transact',
                                                "_qf_Confirm_display=true&qfKey={$params['qfKey']}",
                                                false, null, false );

But I get only a relative URL, not absolutre

Can someone provide me a little help to finish this payment processor ?

Many thanks.

Regards

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: New payment processor in notify mode
January 20, 2010, 11:39:22 pm
The invoiceID field isn't really important in CiviCRM - it generates a hex code or you can put something else into that field before it gets submitted. It is there more for you to find a use for than because it is used within CiviCRM

I've started using contribution IDs or concatenations of contribution IDs & participation and contact IDs instead because they are guaranteed unique and meaningful & you can pop them into the right parts of a URL and find a page.

RE the URLS that cancel URL isn't quite right: (note cancel-1)

Code: [Select]
           if ( $component == "event" ) {
                $finalURL = CRM_Utils_System::url( 'civicrm/event/register',
                                                   "_qf_Register_display=1&cancel=1&qfKey={$params['qfKey']}",
                                                   false, null, false );
            } elseif ( $component == "contribute" ) {
                $finalURL = CRM_Utils_System::url( 'civicrm/contribute/transact',
                                                   "_qf_Main_display=1&cancel=1&qfKey={$params['qfKey']}",
                                                   false, null, false );
            }
            
but it should be a full URL  - can you echo what you get?


This looks wrong:

I think it's $url = $config->userFrameworkResourceURL

I'd expect something more like the above - e.g.


Code: [Select]
if ( $component == "event" ) {

                $finalURL = CRM_Utils_System::url( 'civicrm/event/register',
                                                   "_qf_ThankYou_display=1&qfKey={$params['qfKey']}",
                                                   false, null, false );
} elseif ( $component == "contribute" ) {
                $finalURL = CRM_Utils_System::url( 'civicrm/contribute/transact',
                                                   "_qf_ThankYou_display=1&qfKey={$params['qfKey']}",
                                                   false, null, false );
}

            CRM_Utils_System::redirect( $finalURL );



Please consider updating the documentation to make it more useful. There is also a test spec up there to help you test it properly.
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

Smith

  • Guest
Re: New payment processor in notify mode
January 21, 2010, 12:23:18 am
Thanks for your reply Eileen  ;)

My code is heavily based on PaymentExpress, GoogleCheckout and PayPalImpl, but I shall update the documentation when code is ready for production.

I'll try these settings for URLs these evening, I'don't have access to my server at work place  >:(

Also for the amount, they ask to multiply it by 100 to avoid any . or , in it. Is there another place in the payment processor to do this trick or I'm right ?

Can you also post an example of concatenation of contribution IDs & participation and contact IDs to use it as orderID on the site ?

Thanks


Smith

  • Guest
Re: New payment processor in notify mode
January 21, 2010, 11:56:41 pm
Hi Eillen,

I tested your settings for URL and it works great, many thanks ! Also the payment are signed.
After the payment processing at the external site, I get redirected to the thank you page of civi contribute.

But my payment aren't yet tagged as "completed" in civicontribute, they are still pending.

I suppose it's the IPN thing that can trigger the civicrm database to complete the payment processing as it does with paypal (the make donation button on thank you page)

I had a quick look on the IPN from google, paypal and payment express, but it seems that I have to create a special URL (and of course code) to handle the IPN ?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: New payment processor in notify mode
January 22, 2010, 12:00:12 am
Yep - a wee file in the extern folder that loads civicrm & calls your function. That's where the payment processor points to
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

Seb35

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.0.5
  • CMS version: Drupal 7.7
  • MySQL version: 5.0.51
  • PHP version: 5.3
Re: New payment processor in notify mode
July 16, 2011, 05:48:17 am
Hi,

I began to write a payment processor for Ogone when I found this thread. Is your code available somewhere ? or could you send me it ? (after removing passwords and usernames if any)

Thanks a lot,
Sébastien

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: New payment processor in notify mode
August 08, 2011, 04:09:26 am
Now Ogone payment processor is available as an extension, check http://forum.civicrm.org/index.php/topic,21008.0.html

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • New payment processor in notify mode

This forum was archived on 2017-11-26.