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) »
  • Creating my own payment processor script (monetra)
Pages: [1]

Author Topic: Creating my own payment processor script (monetra)  (Read 1668 times)

chriswood_ut

  • Guest
Creating my own payment processor script (monetra)
October 01, 2008, 02:47:31 pm
We use Monetra from Main Street Softworks for our payment processing software.  I have had a look at the other processor php files and started to craft my own for Monetra following some info found on the wiki and what I can gleam from the other processor files.  Monetra's documentation has a nice example of how to use their php API to do payments and I have taken that code to craft my file.

A couple of questions:

1. It is a bit unclear how to me how CiviCRM knows that the transaction was a success or failure.  Does it simply rely on the $params['trxn_id'] being returned?  Does it want any other data returned to it?  I noticed the authorize.net script returning a gross amount value as well, but Monetra doesn't return any amounts with its results.

2. Looking at the authorize.net script, it uses a 9000 series of numbers for error codes.  Is there any specific meaning associated with these numbers?  Do I just need to start at 9001 and increment for each of my tests?

Any tips appreciated!

Chris

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: Creating my own payment processor script (monetra)
October 01, 2008, 02:59:40 pm
Quote from: chriswood_ut on October 01, 2008, 02:47:31 pm
1. It is a bit unclear how to me how CiviCRM knows that the transaction was a success or failure.  Does it simply rely on the $params['trxn_id'] being returned?  Does it want any other data returned to it?  I noticed the authorize.net script returning a gross amount value as well, but Monetra doesn't return any amounts with its results.

Check CRM/Core/Payment/PayPalImpl.php (line 454 - 460 and line 217-220). You can return a CRM_Core_Error object and the code will basically redirect to the first page of the transaction (contribution or event page) along with the error message. In most cases (we hope), the user can modify the entered information to fix the error (like bad credit card number, expired card etc)

Quote from: chriswood_ut on October 01, 2008, 02:47:31 pm
2. Looking at the authorize.net script, it uses a 9000 series of numbers for error codes.  Is there any specific meaning associated with these numbers?  Do I just need to start at 9001 and increment for each of my tests?

no, in paypal's case we basically send paypal's error number (so the site admin can check paypal docs for an explanation if its a "wierd" error)

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Creating my own payment processor script (monetra)

This forum was archived on 2017-11-26.