Class: ActiveMerchant::Billing::JetpayV2Gateway

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

Constant Summary collapse

API_VERSION =
'2.2'
ACTION_CODE_MESSAGES =
{
  '000' =>  'Approved.',
  '001' =>  'Refer to card issuer.',
  '002' =>  'Refer to card issuer, special condition.',
  '003' =>  'Invalid merchant or service provider.',
  '004' =>  'Pick up card.',
  '005' =>  'Do not honor.',
  '006' =>  'Error.',
  '007' =>  'Pick up card, special condition.',
  '008' =>  'Honor with ID (Show ID).',
  '010' =>  'Partial approval.',
  '011' =>  'VIP approval.',
  '012' =>  'Invalid transaction.',
  '013' =>  'Invalid amount or exceeds maximum for card program.',
  '014' =>  'Invalid account number (no such number).',
  '015' =>  'No such issuer.',
  '019' =>  'Re-enter Transaction.',
  '021' =>  'No action taken (unable to back out prior transaction).',
  '025' =>  'Transaction Not Found.',
  '027' =>  'File update field edit error.',
  '028' =>  'File is temporarily unavailable.',
  '030' =>  'Format error.',
  '039' =>  'No credit account.',
  '041' =>  'Pick up card (lost card).',
  '043' =>  'Pick up card (stolen card).',
  '051' =>  'Insufficient funds.',
  '052' =>  'No checking account.',
  '053' =>  'No savings account.',
  '054' =>  'Expired Card.',
  '055' =>  'Incorrect PIN.',
  '057' =>  'Transaction not permitted to cardholder.',
  '058' =>  'Transaction not allowed at terminal.',
  '061' =>  'Exceeds withdrawal limit.',
  '062' =>  'Restricted card (eg, Country Exclusion).',
  '063' =>  'Security violation.',
  '065' =>  'Activity count limit exceeded.',
  '068' =>  'Response late.',
  '070' =>  'Contact card issuer.',
  '071' =>  'PIN not changed.',
  '075' =>  'Allowable number of PIN-entry tries exceeded.',
  '076' =>  'Unable to locate previous message (no matching retrieval reference number).',
  '077' =>  'Repeat or reversal data are inconsistent with original message.',
  '078' =>  'Blocked (first use), or non-existent account.',
  '079' =>  'Key exchange validation failed.',
  '080' =>  'Credit issuer unavailable or invalid date.',
  '081' =>  'PIN cryptographic error found.',
  '082' =>  'Negative online CVV results.',
  '084' =>  'Invalid auth life cycle.',
  '085' =>  'No reason to decline - CVV or AVS approved.',
  '086' =>  'Cannot verify PIN.',
  '087' =>  'Cashback not allowed.',
  '089' =>  'Issuer Down.',
  '091' =>  'Issuer Down.',
  '092' =>  'Unable to route transaction.',
  '093' =>  'Transaction cannot be completed - violation of law.',
  '094' =>  'Duplicate transmission.',
  '096' =>  'System error.',
  '100' =>  'Deny.',
  '101' =>  'Expired Card.',
  '103' =>  'Deny - Invalid manual Entry 4DBC.',
  '104' =>  'Deny - New card issued.',
  '105' =>  'Deny - Account Cancelled.',
  '106' =>  'Exceeded PIN Attempts.',
  '107' =>  'Please Call Issuer.',
  '109' =>  'Invalid merchant.',
  '110' =>  'Invalid amount.',
  '111' =>  'Invalid account.',
  '115' =>  'Service not permitted.',
  '117' =>  'Invalid PIN.',
  '119' =>  'Card member not enrolled.',
  '122' =>  'Invalid card (CID) security code.',
  '125' =>  'Invalid effective date.',
  '181' =>  'Format error.',
  '182' =>  'Please wait.',
  '183' =>  'Invalid currency code.',
  '187' =>  'Deny - new card issued.',
  '188' =>  'Deny - Expiration date required.',
  '189' =>  'Deny - Cancelled or Closed Merchant/SE.',
  '200' =>  'Deny - Pick up card.',
  '400' =>  'Reversal accepted.',
  '601' =>  'Reject - EMV Chip Declined Transaction.',
  '602' =>  'Reject - Suspected Fraud.',
  '603' =>  'Reject - Communications Error.',
  '604' =>  'Reject - Insufficient Approval.',
  '750' =>  'Velocity Check Fail.',
  '899' =>  'Misc Decline.',
  '900' =>  'Invalid Message Type.',
  '901' =>  'Invalid Merchant ID.',
  '903' =>  'Debit not supported.',
  '904' =>  'Private label not supported.',
  '905' =>  'Invalid card type.',
  '906' =>  'Unit not active.',
  '908' =>  'Manual card entry invalid.',
  '909' =>  'Invalid track information.',
  '911' =>  'Master merchant not found.',
  '912' =>  'Invalid card format.',
  '913' =>  'Invalid card type.',
  '914' =>  'Invalid card length.',
  '917' =>  'Expired card.',
  '919' =>  'Invalid entry type.',
  '920' =>  'Invalid amount.',
  '921' =>  'Invalid messge format.',
  '923' =>  'Invalid ABA.',
  '924' =>  'Invalid DDA.',
  '925' =>  'Invalid TID.',
  '926' =>  'Invalid Password.',
  '930' =>  'Invalid zipcode.',
  '931' =>  'Invalid Address.',
  '932' =>  'Invalid ZIP and Address.',
  '933' =>  'Invalid CVV2.',
  '934' =>  'Program Not Allowed.',
  '935' =>  'Invalid Device/App.',
  '940' =>  'Record Not Found.',
  '941' =>  'Merchant ID error.',
  '942' =>  'Refund Not Allowed.',
  '943' =>  'Refund denied.',
  '955' =>  'Invalid PIN block.',
  '956' =>  'Invalid KSN.',
  '958' =>  'Bad Status.',
  '959' =>  'Seek Record limit exceeded.',
  '960' =>  'Internal Key Database Error.',
  '961' =>  'TRANS not Supported. Cash Disbursement required a specific MCC.',
  '962' =>  'Invalid PIN key (Unknown KSN).',
  '981' =>  'Invalid AVS.',
  '987' =>  'Issuer Unavailable.',
  '988' =>  'System error SD.',
  '989' =>  'Database Error.',
  '992' =>  'Transaction Timeout.',
  '996' =>  'Bad Terminal ID.',
  '997' =>  'Message rejected by association.',
  '999' =>  'Communication failure',
  nil   =>  'No response returned (missing credentials?).'
}

Constants inherited from Gateway

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

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

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

Methods included from CreditCardFormatting

#expdate, #format, #strftime_yyyymm

Methods included from PostsData

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

Constructor Details

#initialize(options = {}) ⇒ JetpayV2Gateway

Returns a new instance of JetpayV2Gateway.



151
152
153
154
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 151

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

Instance Method Details

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



160
161
162
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 160

def authorize(money, payment, options = {})
  commit(money, build_authonly_request(money, payment, options))
end

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



164
165
166
167
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 164

def capture(money, reference, options = {})
  transaction_id, _, _, token = reference.split(';')
  commit(money, build_capture_request(money, transaction_id, options), token)
end

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



174
175
176
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 174

def credit(money, payment, options = {})
  commit(money, build_credit_request(money, nil, payment, options))
end

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



156
157
158
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 156

def purchase(money, payment, options = {})
  commit(money, build_sale_request(money, payment, options))
end

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



178
179
180
181
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 178

def refund(money, reference, options = {})
  transaction_id, _, _, token = reference.split(';')
  commit(money, build_credit_request(money, transaction_id, token, options), token)
end

#scrub(transcript) ⇒ Object



195
196
197
198
199
200
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 195

def scrub(transcript)
  transcript.
    gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
    gsub(%r((>)\d+(</CardNum>)), '\1[FILTERED]\2').
    gsub(%r((<CVV2>)\d+(</CVV2>)), '\1[FILTERED]\2')
end

#store(credit_card, options = {}) ⇒ Object



187
188
189
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 187

def store(credit_card, options = {})
  commit(nil, build_store_request(credit_card, options))
end

#supports_scrubbingObject



191
192
193
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 191

def supports_scrubbing
  true
end

#verify(credit_card, options = {}) ⇒ Object



183
184
185
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 183

def verify(credit_card, options = {})
  authorize(0, credit_card, options)
end

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



169
170
171
172
# File 'lib/active_merchant/billing/gateways/jetpay_v2.rb', line 169

def void(reference, options = {})
  transaction_id, _, amount, token = reference.split(';')
  commit(amount.to_i, build_void_request(amount.to_i, transaction_id, options), token)
end