Class: ActiveMerchant::Billing::SkipJackGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/skip_jack.rb

Constant Summary collapse

API_VERSION =
'?.?'
BASIC_PATH =
'/scripts/evolvcc.dll'
ADVANCED_PATH =
'/evolvcc/evolvcc.aspx'
ACTIONS =
{
  :authorization => 'AuthorizeAPI',
  :change_status => 'SJAPI_TransactionChangeStatusRequest',
  :get_status => 'SJAPI_TransactionStatusRequest'
}
SUCCESS_MESSAGE =
'The transaction was successful.'
MONETARY_CHANGE_STATUSES =
['SETTLE', 'AUTHORIZE', 'AUTHORIZE ADDITIONAL', 'CREDIT', 'SPLITSETTLE']
CARD_CODE_ERRORS =
%w( N S "" )
CARD_CODE_MESSAGES =
{
  'M' => 'Card verification number matched',
  'N' => "Card verification number didn't match",
  'P' => 'Card verification number was not processed',
  'S' => 'Card verification number should be on card but was not indicated',
  'U' => 'Issuer was not certified for card verification',
  '' => 'Transaction failed because incorrect card verification number was entered or no number was entered'
}
AVS_ERRORS =
%w( A B C E I N O P R W Z )
AVS_MESSAGES =
{
  'A' => 'Street address matches billing information, zip/postal code does not',
  'B' => 'Street address match for international transaction. Postal code not verified due to incompatible formats',
  'C' => 'Street address and postal code not verified for internation transaction due to incompatible formats',
  'D' => 'Street address and postal code match for international transaction',
  'E' => 'Address verification service error',
  'I' => 'Address information not verified by international issuer',
  'M' => 'Street address and postal code match for international transaction',
  'N' => 'Neither street address nor zip/postal match billing information',
  'O' => 'Non-US issuer does not participate',
  'P' => 'Postal codes match for international transaction but street address not verified due to incompatible formats',
  'R' => 'Payment gateway was unavailable or timed out',
  'S' => 'Address verification service not supported by issuer',
  'U' => 'Address information is unavailable',
  'W' => '9-digit zip/postal code matches billing information, street address does not',
  'X' => 'Street address and 9-digit zip/postal code matches billing information',
  'Y' => 'Street address and 5-digit zip/postal code matches billing information',
  'Z' => '5-digit zip/postal code matches billing information, street address does not',
}
CHANGE_STATUS_ERROR_MESSAGES =
{
  '0'  => 'Success',
  '-1' => 'Invalid Command',
  '-2' => 'Parameter Missing',
  '-3' => 'Failed retrieving response',
  '-4' => 'Invalid Status',
  '-5' => 'Failed reading security flags',
  '-6' => 'Developer serial number not found',
  '-7' => 'Invalid Serial Number'
}
TRANSACTION_CURRENT_STATUS =
{
  '0' => 'Idle',
  '1' => 'Authorized',
  '2' => 'Denied',
  '3' => 'Settled',
  '4' => 'Credited',
  '5' => 'Deleted',
  '6' => 'Archived',
  '7' => 'Pre-Authorized',
  '8' => 'Split Settled'
}
TRANSACTION_PENDING_STATUS =
{
  '0' => 'Idle',
  '1' => 'Pending Credit',
  '2' => 'Pending Settlement',
  '3' => 'Pending Authorization',
  '4' => 'Pending Manual Settlement',
  '5' => 'Pending Recurring'
}
RETURN_CODE_MESSAGES =
{
  '-1' => 'Data was not by received intact by Skipjack Transaction Network.',
  '0' => 'Communication Failure. Error in Request and Response at IP level.',
  '1' => 'Valid Data. Authorization request was valid.',
  '-35' => 'Invalid credit card number. Retry with correct credit card number.',
  '-37' => 'Merchant Processor Unavailable. Skipjack is unable to communicate with payment Processor. Retry',
  '-39' => 'Length or value of HTML Serial. Number Invalid serial number. Check HTML Serial Number length and that it is a correct/valid number. Confirm you are sending to the correct environment (Development or Production)',
  '-51' => 'The value or length for billing zip code is incorrect.',
  '-52' => 'The value or length for shipping zip code is incorrect.',
  '-53' => 'The value or length for credit card expiration month is incorrect.',
  '-54' => 'The value or length of the month or year of the credit card account number was incorrect.',
  '-55' => 'The value or length or billing street address is incorrect.',
  '-56' => 'The value or length of the shipping address is incorrect.',
  '-57' => 'The length of the transaction amount must be at least 3 digits long (excluding the decimal place).',
  '-58' => 'Length or value in Merchant Name Merchant Name associated with Skipjack account is misconfigured or invalid',
  '-59' => 'Length or value in Merchant Address Merchant Address associated with Skipjack account is misconfigured or invalid',
  '-60' => 'Length or value in Merchant State Merchant State associated with Skipjack account is misconfigured or invalid',
  '-61' => 'The value or length for shipping state/province is empty.',
  '-62' => 'The value for length orderstring is empty.',
  '-64' => 'The value for the phone number is incorrect.',
  '-65' => 'The value or length for billing name is empty.',
  '-66' => 'The value or length for billing e-mail is empty.',
  '-67' => 'The value or length for billing street address is empty.',
  '-68' => 'The value or length for billing city is empty.',
  '-69' => 'The value or length for billing state is empty.',
  '-70' => 'Empty zipcode Zip Code field is empty.',
  '-71' => 'Empty ordernumber Ordernumber field is empty.',
  '-72' => 'Empty accountnumber Accountnumber field is empty',
  '-73' => 'Empty month Month field is empty.',
  '-74' => 'Empty year Year field is empty.',
  '-75' => 'Empty serialnumber Serialnumber field is empty.',
  '-76' => 'Empty transactionamount Transaction amount field is empty.',
  '-77' => 'Empty orderstring Orderstring field is empty.',
  '-78' => 'Empty shiptophone Shiptophone field is empty.',
  '-79' => 'The value or length for billing name is empty.',
  '-80' => 'Length shipto name Error in the length or value of shiptophone.',
  '-81' => 'Length or value of Customer location',
  '-82' => 'The value or length for billing state is empty.',
  '-83' => 'The value or length for shipping phone is empty.',
  '-84' => 'There is already an existing pending transaction in the register sharing the posted Order Number.',
  '-85' => 'Airline leg info invalid Airline leg field value is invalid or empty.',
  '-86' => 'Airline ticket info invalid Airline ticket info field is invalid or empty',
  '-87' => 'Point of Sale check routing number must be 9 numeric digits Point of Sale check routing number is invalid or empty.',
  '-88' => 'Point of Sale check account number missing or invalid Point of Sale check account number is invalid or empty.',
  '-89' => 'Point of Sale check MICR missing or invalid Point of Sale check MICR invalid or empty.',
  '-90' => 'Point of Sale check number missing or invalid Point of Sale check number invalid or empty.',
  '-91' => 'CVV2 Invalid or empty "Make CVV a required field feature" enabled (New feature 01 April 2006) in the Merchant Account Setup interface but no CVV code was sent in the transaction data.',
  '-92' => 'Approval Code Invalid Approval Code Invalid. Approval Code is a 6 digit code.',
  '-93' => 'Blind Credits Request Refused "Allow Blind Credits" option must be enabled on the Skipjack Merchant Account.',
  '-94' => 'Blind Credits Failed',
  '-95' => 'Voice Authorization Request Refused Voice Authorization option must be enabled on the Skipjack Merchant Account.',
  '-96' => 'Voice Authorizations Failed',
  '-97' => 'Fraud Rejection Violates Velocity Settling.',
  '-98' => 'Invalid Discount Amount',
  '-99' => 'POS PIN Debit Pin Block Debit-specific',
  '-100' => 'POS PIN Debit Invalid Key Serial Number Debit-specific',
  '-101' => 'Invalid Authentication Data Data for Verified by Visa/MC Secure Code is invalid.',
  '-102' => 'Authentication Data Not Allowed',
  '-103' => 'POS Check Invalid Birth Date POS check dateofbirth variable contains a birth date in an incorrect format. Use MM/DD/YYYY format for this variable.',
  '-104' => 'POS Check Invalid Identification Type POS check identificationtype variable contains a identification type value which is invalid. Use the single digit value where Social Security Number=1, Drivers License=2 for this variable.',
  '-105' => 'Invalid trackdata Track Data is in invalid format.',
  '-106' => 'POS Check Invalid Account Type',
  '-107' => 'POS PIN Debit Invalid Sequence Number',
  '-108' => 'Invalid Transaction ID',
  '-109' => 'Invalid From Account Type',
  '-110' => 'Pos Error Invalid To Account Type',
  '-112' => 'Pos Error Invalid Auth Option',
  '-113' => 'Pos Error Transaction Failed',
  '-114' => 'Pos Error Invalid Incoming Eci',
  '-115' => 'POS Check Invalid Check Type',
  '-116' => 'POS Check Invalid Lane Number POS Check lane or cash register number is invalid. Use a valid lane or cash register number that has been configured in the Skipjack Merchant Account.',
  '-117' => 'POS Check Invalid Cashier Number'
}

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, #generate_unique_id, inherited, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

Constructor Details

#initialize(options = {}) ⇒ SkipJackGateway

Creates a new SkipJackGateway

The gateway requires that a valid login and password be passed in the options hash.

Options

  • :login – The SkipJack Merchant Serial Number.

  • :password – The SkipJack Developer Serial Number.

  • :test => true or false – Use the test or live SkipJack url.

  • :advanced => true or false – Set to true if you’re using an advanced processor

See the SkipJack Integration Guide for details. (default: false)



181
182
183
184
# File 'lib/active_merchant/billing/gateways/skip_jack.rb', line 181

def initialize(options = {})
  requires!(options, :login, :password)
  super
end

Instance Method Details

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



186
187
188
189
190
191
192
193
194
# File 'lib/active_merchant/billing/gateways/skip_jack.rb', line 186

def authorize(money, creditcard, options = {})
  requires!(options, :order_id, :email)
  post = {}
  add_invoice(post, options)
  add_creditcard(post, creditcard)
  add_address(post, options)
  add_customer_data(post, options)
  commit(:authorization, money, post)
end

#capture(money, authorization, options = {}) ⇒ Object

Captures the funds from an authorized transaction.

Parameters

  • money – The amount to be capture as an Integer in cents.

  • authorization – The authorization returned from the previous authorize request.

  • options – A hash of optional parameters.

Options

  • :force_settlement – Force the settlement to occur as soon as possible. This option is not supported by other gateways. See the SkipJack API reference for more details



216
217
218
219
220
221
222
# File 'lib/active_merchant/billing/gateways/skip_jack.rb', line 216

def capture(money, authorization, options = {})
  post = { }
  add_status_action(post, 'SETTLE')
  add_forced_settlement(post, options)
  add_transaction_id(post, authorization)
  commit(:change_status, money, post)
end

#credit(money, identification, options = {}) ⇒ Object



240
241
242
243
# File 'lib/active_merchant/billing/gateways/skip_jack.rb', line 240

def credit(money, identification, options = {})
  ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
  refund(money, identification, options)
end

#purchase(money, creditcard, options = {}) ⇒ Object



196
197
198
199
200
201
202
203
# File 'lib/active_merchant/billing/gateways/skip_jack.rb', line 196

def purchase(money, creditcard, options = {})
  authorization = authorize(money, creditcard, options)
  if authorization.success?
    capture(money, authorization.authorization)
  else
    authorization
  end
end

#refund(money, identification, options = {}) ⇒ Object



232
233
234
235
236
237
238
# File 'lib/active_merchant/billing/gateways/skip_jack.rb', line 232

def refund(money, identification, options = {})
  post = {}
  add_status_action(post, 'CREDIT')
  add_forced_settlement(post, options)
  add_transaction_id(post, identification)
  commit(:change_status, money, post)
end

#status(order_id) ⇒ Object



245
246
247
# File 'lib/active_merchant/billing/gateways/skip_jack.rb', line 245

def status(order_id)
  commit(:get_status, nil, :szOrderNumber => order_id)
end

#void(authorization, options = {}) ⇒ Object



224
225
226
227
228
229
230
# File 'lib/active_merchant/billing/gateways/skip_jack.rb', line 224

def void(authorization, options = {})
  post = {}
  add_status_action(post, 'DELETE')
  add_forced_settlement(post, options)
  add_transaction_id(post, authorization)
  commit(:change_status, nil, post)
end