Class ActiveMerchant::Billing::PlugnpayGateway
In: lib/active_merchant/billing/gateways/plugnpay.rb
Parent: Gateway

Methods

authorize   capture   credit   new   purchase   void  

Classes and Modules

Class ActiveMerchant::Billing::PlugnpayGateway::PlugnpayPostData

Constants

URL = 'https://pay1.plugnpay.com/payment/pnpremote.cgi'
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"
CARD_CODE_ERRORS = %w( N S )
AVS_MESSAGES = { "A" => "Street address matches billing information, zip/postal code does not", "B" => "Address information not provided for address verification check", "E" => "Address verification service error", "G" => "Non-U.S. card-issuing bank", "N" => "Neither street address nor zip/postal match billing information", "P" => "Address verification not applicable for this transaction", "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", }
AVS_ERRORS = %w( A E N R W Z )
PAYMENT_GATEWAY_RESPONSES = { "P01" => "AVS Mismatch Failure", "P02" => "CVV2 Mismatch Failure", "P21" => "Transaction may not be marked", "P30" => "Test Tran. Bad Card", "P35" => "Test Tran. Problem", "P40" => "Username already exists", "P41" => "Username is blank", "P50" => "Fraud Screen Failure", "P51" => "Missing PIN Code", "P52" => "Invalid Bank Acct. No.", "P53" => "Invalid Bank Routing No.", "P54" => "Invalid/Missing Check No.", "P55" => "Invalid Credit Card No.", "P56" => "Invalid CVV2/CVC2 No.", "P57" => "Expired. CC Exp. Date", "P58" => "Missing Data", "P59" => "Missing Email Address", "P60" => "Zip Code does not match Billing State.", "P61" => "Invalid Billing Zip Code", "P62" => "Zip Code does not match Shipping State.", "P63" => "Invalid Shipping Zip Code", "P64" => "Invalid Credit Card CVV2/CVC2 Format.", "P65" => "Maximum number of attempts has been exceeded.", "P66" => "Credit Card number has been flagged and can not be used to access this service.", "P67" => "IP Address is on Blocked List.", "P68" => "Billing country does not match ipaddress country.", "P69" => "US based ipaddresses are currently blocked.", "P70" => "Credit Cards issued from this bank are currently not being accepted.", "P71" => "Credit Cards issued from this bank are currently not being accepted.", "P72" => "Daily volume exceeded.", "P73" => "Too many transactions within allotted time.", "P91" => "Missing/incorrect password", "P92" => "Account not configured for mobil administration", "P93" => "IP Not registered to username.", "P94" => "Mode not permitted for this account.", "P95" => "Currently Blank", "P96" => "Currently Blank", "P97" => "Processor not responding", "P98" => "Missing merchant/publisher name", "P99" => "Currently Blank"
TRANSACTIONS = { :authorization => 'auth', :purchase => 'auth', :capture => 'mark', :void => 'void', :refund => 'return', :credit => 'newreturn'
SUCCESS_CODES = [ 'pending', 'success' ]
FAILURE_CODES = [ 'badcard', 'fraud' ]

Public Class methods

[Source]

     # File lib/active_merchant/billing/gateways/plugnpay.rb, line 102
102:       def initialize(options = {})
103:         requires!(options, :login, :password)
104:         @options = options
105:         super
106:       end

Public Instance methods

[Source]

     # File lib/active_merchant/billing/gateways/plugnpay.rb, line 121
121:       def authorize(money, creditcard, options = {})
122:         post = PlugnpayPostData.new
123:         
124:         add_amount(post, money, options)
125:         add_creditcard(post, creditcard)        
126:         add_addresses(post, options)
127:         add_invoice_data(post, options)        
128:         add_customer_data(post, options)
129:         
130:         post[:authtype] = 'authonly'
131:         commit(:authorization, post)
132:       end

[Source]

     # File lib/active_merchant/billing/gateways/plugnpay.rb, line 134
134:       def capture(money, authorization, options = {})
135:         post = PlugnpayPostData.new
136:         
137:         post[:orderID] = authorization
138:         
139:         add_amount(post, money, options)
140:         add_customer_data(post, options)
141:          
142:         commit(:capture, post)
143:       end

[Source]

     # File lib/active_merchant/billing/gateways/plugnpay.rb, line 154
154:       def credit(money, identification_or_creditcard, options = {})
155:         post = PlugnpayPostData.new
156:         add_amount(post, money, options)
157:        
158:         if identification_or_creditcard.is_a?(String)
159:           post[:orderID] = identification_or_creditcard
160:           
161:           commit(:refund, post)
162:         else
163:           add_creditcard(post, identification_or_creditcard)        
164:           add_addresses(post, options)   
165:           add_customer_data(post, options) 
166:           
167:           commit(:credit, post)
168:         end
169:       end

[Source]

     # File lib/active_merchant/billing/gateways/plugnpay.rb, line 108
108:       def purchase(money, creditcard, options = {})
109:         post = PlugnpayPostData.new
110:         
111:         add_amount(post, money, options)
112:         add_creditcard(post, creditcard)
113:         add_addresses(post, options)
114:         add_invoice_data(post, options)
115:         add_customer_data(post, options)
116:          
117:         post[:authtype] = 'authpostauth'
118:         commit(:authorization, post)
119:       end

[Source]

     # File lib/active_merchant/billing/gateways/plugnpay.rb, line 145
145:       def void(authorization, options = {})
146:         post = PlugnpayPostData.new
147:         
148:         post[:orderID] = authorization
149:         post[:txn_type] = 'auth'
150:         
151:         commit(:void, post)
152:       end

[Validate]