Class: ActiveMerchant::Billing::PayJunctionGateway

Overview

PayJunction Gateway

This gateway accepts the following arguments:

:login=>yourPayJunctionusername:password=>yourPayJunctionpass

Example use:

gateway=ActiveMerchant::Billing::Base.gateway(:pay_junction).new(:login=>"my_account",:password=>"my_pass")# set up credit card obj as in main ActiveMerchant examplecreditcard=ActiveMerchant::Billing::CreditCard.new(:type=>'visa',:number=>'4242424242424242',:month=>8,:year=>2009,:first_name=>'Bob',:last_name=>'Bobsen')# optionally specify address if using AVSaddress={:address1=>'101 Test Ave',:city=>'Test',:state=>'TS',:zip=>'10101',:country=>'US'}# run requestresponse=gateway.purchase(1000,creditcard,:address=>address)# charge 10 dollars

1) Check whether the transaction was successful

response.success?

2) Retrieve the message returned by PayJunction

response.message

3) Retrieve the unique transaction ID returned by PayJunction

response.authorization

This gateway supports “instant” transactions. These transactions allow you to execute an operation on a previously run card without card information provided you have the transaction id from a previous transaction with the same card. All functions that take a credit card object for this gateway can take a transaction id string instead.

Test Transactions

See the source for initialize() for test account information. Note that PayJunction does not allow test transactions on your account, so if the gateway is running in :test mode your transaction will be run against PayJunction's global test account and will not show up in your account.

Transactions ran on this account go through a test processor, so there is no need to void or otherwise cancel transactions. However, for further safety, please use the special card numbers 4433221111223344 or 4444333322221111 and keep transaction amounts below $4.00 when testing.

Also note, transactions ran for an amount between $0.00 and $1.99 will likely result in denial. To demonstrate approvals, use amounts between $2.00 and $4.00.

Test transactions can be checked by logging into PayJunction Web Login with username 'pj-cm-01' and password 'pj-cm-01p'

Usage Details

Below is a map of values accepted by PayJunction and how you should submit each to ActiveMerchant

{"AE"=>'Address verification failed because address did not match.','ZE'=>'Address verification failed because zip did not match.','XE'=>'Address verification failed because zip and address did not match.','YE'=>'Address verification failed because zip and address did not match.','OE'=>'Address verification failed because address or zip did not match.','UE'=>'Address verification failed because cardholder address unavailable.','RE'=>'Address verification failed because address verification system is not working.','SE'=>'Address verification failed because address verification system is unavailable.','EE'=>'Address verification failed because transaction is not a mail or phone order.','GE'=>'Address verification failed because international support is unavailable.','CE'=>'Declined because CVV2/CVC2 code did not match.','04'=>'Declined. Pick up card.','07'=>'Declined. Pick up card (Special Condition).','41'=>'Declined. Pick up card (Lost).','43'=>'Declined. Pick up card (Stolen).','13'=>'Declined because of the amount is invalid.','14'=>'Declined because the card number is invalid.','80'=>'Declined because of an invalid date.','05'=>'Declined. Do not honor.','51'=>'Declined because of insufficient funds.','N4'=>'Declined because the amount exceeds issuer withdrawal limit.','61'=>'Declined because the amount exceeds withdrawal limit.','62'=>'Declined because of an invalid service code (restricted).','65'=>'Declined because the card activity limit exceeded.','93'=>'Declined because there a violation (the transaction could not be completed).','06'=>'Declined because address verification failed.','54'=>'Declined because the card has expired.','15'=>'Declined because there is no such issuer.','96'=>'Declined because of a system error.','N7'=>'Declined because of a CVV2/CVC2 mismatch.','M4'=>'Declined.',"FE"=>"There was a format error with your Trinity Gateway Service (API) request.","LE"=>"Could not log you in (problem with dc_logon and/or dc_password).",'NL'=>'Aborted because of a system error, please try again later. ','AB'=>'Aborted because of an upstream system error, please try again later.'}

Instance Method Details

#authorize(money, payment_source, options = {}) ⇒ Object

The first half of the preauth(authorize)/postauth(capture) model. Checks to make sure funds are available for a transaction, and returns a transaction_id that can be used later to postauthorize (capture) the funds.

The optional parameter :starting_at takes a date or time argument or a string in YYYYMMDD format and can be used to specify when the first charge will be made. If omitted the first charge will be immediate.