Class: ActiveMerchant::Billing::ProPayGateway

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

Constant Summary collapse

STATUS_RESPONSE_CODES =
{
  "00" => "Success",
  "20" => "Invalid username",
  "21" => "Invalid transType",
  "22" => "Invalid Currency Code",
  "23" => "Invalid accountType",
  "24" => "Invalid sourceEmail",
  "25" => "Invalid firstName",
  "26" => "Invalid mInitial",
  "27" => "Invalid lastName",
  "28" => "Invalid billAddr",
  "29" => "Invalid aptNum",
  "30" => "Invalid city",
  "31" => "Invalid state",
  "32" => "Invalid billZip",
  "33" => "Invalid mailAddr",
  "34" => "Invalid mailApt",
  "35" => "Invalid mailCity",
  "36" => "Invalid mailState",
  "37" => "Invalid mailZip",
  "38" => "Invalid dayPhone",
  "39" => "Invalid evenPhone",
  "40" => "Invalid ssn",
  "41" => "Invalid dob",
  "42" => "Invalid recEmail",
  "43" => "Invalid knownAccount",
  "44" => "Invalid amount",
  "45" => "Invalid invNum",
  "46" => "Invalid rtNum",
  "47" => "Invalid accntNum",
  "48" => "Invalid ccNum",
  "49" => "Invalid expDate",
  "50" => "Invalid cvv2",
  "51" => "Invalid transNum and/or Unable to act perform actions on transNum due to funding",
  "52" => "Invalid splitNum",
  "53" => "A ProPay account with this email address already exists AND/OR User has no account number",
  "54" => "A ProPay account with this social security number already exists",
  "55" => "The email address provided does not correspond to a ProPay account.",
  "56" => "Recipient’s email address shouldn’t have a ProPay account and does",
  "57" => "Cannot settle transaction because it already expired",
  "58" => "Credit card declined",
  "59" => "Invalid Credential or IP address not allowed",
  "60" => "Credit card authorization timed out; retry at a later time",
  "61" => "Amount exceeds single transaction limit",
  "62" => "Amount exceeds monthly volume limit",
  "63" => "Insufficient funds in account",
  "64" => "Over credit card use limit",
  "65" => "Miscellaneous error",
  "66" => "Denied a ProPay account",
  "67" => "Unauthorized service requested",
  "68" => "Account not affiliated",
  "69" => "Duplicate invoice number (The same card was charged for the same amount with the same invoice number (including blank invoices) in a 1 minute period. Details about the original transaction are included whenever a 69 response is returned. These details include a repeat of the auth code, the original AVS response, and the original CVV response.)",
  "70" => "Duplicate external ID",
  "71" => "Account previously set up, but problem affiliating it with partner",
  "72" => "The ProPay Account has already been upgraded to a Premium Account",
  "73" => "Invalid Destination Account",
  "74" => "Account or Trans Error",
  "75" => "Money already pulled",
  "76" => "Not Premium (used only for push/pull transactions)",
  "77" => "Empty results",
  "78" => "Invalid Authentication",
  "79" => "Generic account status error",
  "80" => "Invalid Password",
  "81" => "Account Expired",
  "82" => "InvalidUserID",
  "83" => "BatchTransCountError",
  "84" => "InvalidBeginDate",
  "85" => "InvalidEndDate",
  "86" => "InvalidExternalID",
  "87" => "DuplicateUserID",
  "88" => "Invalid track 1",
  "89" => "Invalid track 2",
  "90" => "Transaction already refunded",
  "91" => "Duplicate Batch ID"
}
TRANSACTION_RESPONSE_CODES =
{
  "00" => "Success",
  "1" => "Transaction blocked by issuer",
  "4" => "Pick up card and deny transaction",
  "5" => "Problem with the account",
  "6" => "Customer requested stop to recurring payment",
  "7" => "Customer requested stop to all recurring payments",
  "8" => "Honor with ID only",
  "9" => "Unpaid items on customer account",
  "12" => "Invalid transaction",
  "13" => "Amount Error",
  "14" => "Invalid card number",
  "15" => "No such issuer. Could not route transaction",
  "16" => "Refund error",
  "17" => "Over limit",
  "19" => "Reenter transaction or the merchant account may be boarded incorrectly",
  "25" => "Invalid terminal 41 Lost card",
  "43" => "Stolen card",
  "51" => "Insufficient funds",
  "52" => "No such account",
  "54" => "Expired card",
  "55" => "Incorrect PIN",
  "57" => "Bank does not allow this type of purchase",
  "58" => "Credit card network does not allow this type of purchase for your merchant account.",
  "61" => "Exceeds issuer withdrawal limit",
  "62" => "Issuer does not allow this card to be charged for your business.",
  "63" => "Security Violation",
  "65" => "Activity limit exceeded",
  "75" => "PIN tries exceeded",
  "76" => "Unable to locate account",
  "78" => "Account not recognized",
  "80" => "Invalid Date",
  "82" => "Invalid CVV2",
  "83" => "Cannot verify the PIN",
  "85" => "Service not supported for this card",
  "93" => "Cannot complete transaction. Customer should call 800 number.",
  "95" => "Misc Error Transaction failure",
  "96" => "Issuer system malfunction or timeout.",
  "97" => "Approved for a lesser amount. ProPay will not settle and consider this a decline.",
  "98" => "Failure HV",
  "99" => "Generic decline or unable to parse issuer response code"
}

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, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #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 = {}) ⇒ ProPayGateway

Returns a new instance of ProPayGateway.



136
137
138
139
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 136

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

Instance Method Details

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



154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 154

def authorize(money, payment, options={})
  request = build_xml_request do |xml|
    add_invoice(xml, money, options)
    add_payment(xml, payment, options)
    add_address(xml, options)
    (xml, options)
    add_recurring(xml, options)
    xml.transType "05"
  end

  commit(request)
end

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



167
168
169
170
171
172
173
174
175
176
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 167

def capture(money, authorization, options={})
  request = build_xml_request do |xml|
    add_invoice(xml, money, options)
    (xml, options)
    xml.transNum authorization
    xml.transType "06"
  end

  commit(request)
end

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



193
194
195
196
197
198
199
200
201
202
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 193

def credit(money, payment, options={})
  request = build_xml_request do |xml|
    add_invoice(xml, money, options)
    add_payment(xml, payment, options)
    (xml, options)
    xml.transType "35"
  end

  commit(request)
end

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



141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 141

def purchase(money, payment, options={})
  request = build_xml_request do |xml|
    add_invoice(xml, money, options)
    add_payment(xml, payment, options)
    add_address(xml, options)
    (xml, options)
    add_recurring(xml, options)
    xml.transType "04"
  end

  commit(request)
end

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



178
179
180
181
182
183
184
185
186
187
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 178

def refund(money, authorization, options={})
  request = build_xml_request do |xml|
    add_invoice(xml, money, options)
    (xml, options)
    xml.transNum authorization
    xml.transType "07"
  end

  commit(request)
end

#scrub(transcript) ⇒ Object



215
216
217
218
219
220
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 215

def scrub(transcript)
  transcript.
    gsub(%r((<certStr>).+(</certStr>)), '\1[FILTERED]\2').
    gsub(%r((<ccNum>).+(</ccNum>)), '\1[FILTERED]\2').
    gsub(%r((<CVV2>).+(</CVV2>)), '\1[FILTERED]\2')
end

#supports_scrubbing?Boolean

Returns:

  • (Boolean)


211
212
213
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 211

def supports_scrubbing?
  true
end

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



204
205
206
207
208
209
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 204

def verify(credit_card, options={})
  MultiResponse.run(:use_first_response) do |r|
    r.process { authorize(100, credit_card, options) }
    r.process(:ignore_result) { void(r.authorization, options) }
  end
end

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



189
190
191
# File 'lib/active_merchant/billing/gateways/pro_pay.rb', line 189

def void(authorization, options={})
  refund(nil, authorization, options)
end