
We now went further and offer a PayJunction module for Drupal: install, setup, you are ready to go. See the MO PayJunction product for more information about the Drupal extension2.
This PHP PayJunction class abstracts the QuickLink API. It defines three set of very easy to use PHP functions as follow:
process() function called to actually send the transaction to the Trinity System; andThe process() function parses the answer returned by the Trinity System. This is why the PHP Pay Junction class can be used with great ease to check out the results.
For instance, when a transaction fails, you should call the is_bad_card() function. This function tells you whether your customer card number was somehow banned by the banking system (usually because the card was reportedly stolen or lost.) That gives you the possibility to ban that card number and avoid querying the Trinity System again with that number. In order to do that, you can simply compute the md5() or sha1()3 of the card number and save that value in your database. Since these encodings are not reversible (not easily at least) the card number is safe and it can be checked again later.
And to help the developer greatly, PHP Pay Junction checks all the parameters in great details to avoid sending an invalid request to the Trinity system. If you think about it, by avoiding sending transactions that are known to be invalid you avoid taking the chance of being charged your regular flat fee for nothing. This means a great saving if you process a large number of credit cards every day. Also, it is very easy to misuse the QuickLink API, when it is very difficult to send an invalid transaction using the PHP Pay Junction class. If you attempt to set two contradictory variables in the transaction, the PHP Pay Junction class will generate an exception and thus prevent you from sending your transaction.
Many times, a transaction starts with an invalid credit card number. After all, such numbers are usually 16 digits and typing 16 digits is not always that easy. In your web page, before sending your form, you should check the information the user entered. If you find an error, then you can prompt the user right then, wasting no time. Plus, it will save you a useless transaction fee since you could yourself detect that there is an error.
As part of the PayJunction package, you will get a Javascript function you can use directly in your website to verify that the credit card number is between 13 and 16 digits and is a valid number by testing it with the Luhn check.