PRI
Interchange's support for the
Payment Resources International
Payment Services Provider.
Synopsis
or
|
[charge route="PRI" param1="value1" param2="value2"]
|
Prerequisites
or
|
LWP::UserAgent and Crypt::SSLeay
|
Only one of the above options needs be present and working.
Description
The Vend::Payment::PRI module implements the
PRI() subroutine for use with Interchange.
It is compatible on a call level with the other Interchange payment modules.
In theory (and even usually in practise) you could switch from another payment
module to PRI with a few configuration file changes.
To enable this module, place this directive in your "interchange.cfg" file:
|
Require module Vend::Payment::PRI
|
This must be in interchange.cfg or a file included from it.
Make sure CreditCardAuto is off, which is the default in
the Standard ecommerce demo.
The "mode" can be named anything, but the "gateway" parameter
must be set to "PRI".
To make it the default payment gateway for all credit card transactions in a
specific website, you can set the following in catalog.cfg:
|
Variable MV_PAYMENT_MODE PRI
|
It uses several of the standard settings from Interchange payment.
Any time we speak of a setting, it is obtained either first from the tag/call
options, then from an Interchange order Route named after
the mode, then finally a default global payment Variable.
For example, the id parameter would be specified by:
|
[charge route=PRI id=YourPRIID]
|
or
or
|
Variable MV_PAYMENT_ID YourPRIID
|
A fully valid catalog.cfg entry to work with the
Standard demo would look like the following:
Variable MV_PAYMENT_MODE "__MV_PAYMENT_MODE__"
Route PRI id "__PRI_ID__"
Route PRI regkey "__PRI_REGKEY__"
Route PRI test_id "__PRI_TEST_ID__"
Route PRI test_regkey "__PRI_TEST_REGKEY__"
Route PRI test_mode "__PRI_TEST_MODE__"
Route PRI refid_mode "__PRI_REFID_MODE__"
|
A fully valid variable.txt file entry
(see VariableDatabase)
to work with the PRI module would look like the following:
MV_PAYMENT_MODE PRI Payment
PRI_ID your_pri_id Payment
PRI_REGKEY your_pri_regkey Payment
PRI_TEST_ID your_pri_test_id Payment
PRI_TEST_REGKEY your_pri_test_regkey Payment
PRI_TEST_MODE 1 Payment
PRI_REFID_MODE 1 Payment
|
Settings
| Name
|
Description
|
| id
|
PRI will supply you with both a test id and production id.
Enter both of these numbers into the the variables, above.
You do not need your production id to test. |
| regkey
|
PRI will supply you with both a test regkey and production regkey.
Enter both of these numbers into the the variables, above.
You do not need your production regkey to test. |
| refid
|
The PRI interface requires a field called REFID.
This field is stored along with the transaction on the PRI server,
and allows you to do quick searches for transactions if this number
has a meaning to you.
The possible values for the PRI_REFID_MODE variable are
1, 2, any other character or NULL.
- A "1" in the PRI_REFID_MODE instructs interchange to read the current order number in the MV_ORDER_COUNTER_FILE Variable (or "etc/order.number" by default), increment it by one and use that.
Do not use this mode if you have a busy website.
PRI might reject orders as duplicates if two people try to checkout at the same time.
- A "2" in the PRI_REFID_MODE instructs interchange to use the user's session ID as the value.
This is the recommended mode.
- Anything other than a "1" or "2" instructs interchange to generate a unique number from the UNIX date(1) command and use that value.
The number format is day of year, hours, minutes and seconds.
For example, "1st January at 1:00:30" would be "001130030".
|
| transaction
|
At this time the PRI payment module only processes transactions
of type SALE. |
| test
|
Testing with PRI is straight forward.
At this time (15 May 2004), PRI uses the same server for both development
and production.
The only difference is the account used.
Some accounts are flagged as test accounts and others are live.
When you first sign up with PRI they will supply you a test account
and test registration key to use.
Enter those numbers in the PRI_ID and PRI_REGKEY
(production), and also PRI_TEST_ID and PRI_TEST_REGKEY
(test) variables.
Set the PRI_TEST_MODE to a value of "1", "2" or "3" and then do your testing.
Once everything is working correctly,
simply set PRI_TEST_MODE to "0" and restart interchange.
You are now live.
Testing has 3 modes (1, 2 and 3).
Live mode is 0.
You set the mode with the PRI_TEST_MODE variable in
variable.txt (see VariableDatabase)
or directly in your catalog.cfg file.
The modes are as follows.
- Use PRI_TEST_ID and PRI_TEST_REGKEY values.
Send information to PRI and receive result from PRI.
To generate errors in this mode, simply enter invalid data and PRI should reject it with an error.
- Generate a declined order internally.
Does not send data to PRI.
This mode is convenient if you want to do some testing and do not want to send any data to PRI.
It's also a good way to track down errors.
- Generate a successful sale internally.
Does not send data to PRI.
This mode is convenient if you want to see if everything works before sending test data to PRI.
A good way to test this module is to set PRI_TEST_MODE to 3, then 2, then 1, and finally to 0, and make sure your website handles all situations correctly.
To generate errors in test mode (while using your test ID and regkey)
simply enter transactions with bad data and see what happens.
PRI will supply you with a list of test credit card numbers and amounts
that they are good for.
|
| submit_url
|
PRI uses different URIs, depending on the type of transaction you are
requesting (Sale, Recurring Void etc.).
The default URI for single
sale transactions is:
|
https://webservices.primerchants.com/billing/TransactionCentral/processCC.asp
|
At this time, this is the only URI supported by this PRI module.
|
Troubleshooting
If nothing works:
Make sure you Required the module in
interchange.cfg:
|
Require module Vend::Payment::PRI
|
Make sure either Net::SSLeay, or Crypt::SSLeay and
LWP::UserAgent are installed and working.
You can test to see whether your Perl thinks they are:
|
perl -MNet::SSLeay -le 'print "Available"'
|
or
|
perl -MLWP::UserAgent -MCrypt::SSLeay -le 'print "Available"'
|
If either of the above prints "Available", and returns to the shell prompt,
then you should be OK (presuming they are in working order otherwise).
- Check the local and global error log files.
- Make sure you set your payment parameters properly.
Try an order, then put this code in a page:
<pre>
[calcn]
my $string = $Tag->uneval({ ref => $Session->{payment_result} });
$string =~ s/{/{\n/;
$string =~ s/,/,\n/g;
return $string;
[/calcn]
</pre>
|
That should show what happened.
- If all else fails, consultants are available to help with integration for a fee.
Notes
There is actually nothing in Vend::Payment::PRI;
This module changes its package name to Vend::Payment and
places things there.
Authors
- Originally developed by New York Connect Net (nyct.net) Michael Bacarella

- Modified for GetCareer.com by Troy Davis
at Slipstream.com.
- LWP/Crypt::SSLeay interface code by Matthew Schick

- Interchange implementation by Mike Heins

- PRI modification by Marty Tennison