Class: ActiveMerchant::Billing::PlugnpayGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::PlugnpayGateway
show all
- Defined in:
- lib/active_merchant/billing/gateways/plugnpay.rb
Defined Under Namespace
Classes: PlugnpayPostData
Constant Summary
collapse
- 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 =
%w[pending success]
- FAILURE_CODES =
%w[badcard fraud]
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
-
#authorize(money, creditcard, options = {}) ⇒ Object
-
#capture(money, authorization, options = {}) ⇒ Object
-
#credit(money, identification_or_creditcard, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ PlugnpayGateway
constructor
A new instance of PlugnpayGateway.
-
#purchase(money, creditcard, options = {}) ⇒ Object
-
#refund(money, reference, options = {}) ⇒ Object
-
#void(authorization, options = {}) ⇒ Object
Methods inherited from Gateway
#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #scrub, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
#format, #strftime_yyyymm
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
Returns a new instance of PlugnpayGateway.
100
101
102
103
|
# File 'lib/active_merchant/billing/gateways/plugnpay.rb', line 100
def initialize(options = {})
requires!(options, :login, :password)
super
end
|
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
118
119
120
121
122
123
124
125
126
127
128
129
|
# File 'lib/active_merchant/billing/gateways/plugnpay.rb', line 118
def authorize(money, creditcard, options = {})
post = PlugnpayPostData.new
add_amount(post, money, options)
add_creditcard(post, creditcard)
add_addresses(post, options)
add_invoice_data(post, options)
add_customer_data(post, options)
post[:authtype] = 'authonly'
commit(:authorization, post)
end
|
#capture(money, authorization, options = {}) ⇒ Object
131
132
133
134
135
136
137
138
139
140
|
# File 'lib/active_merchant/billing/gateways/plugnpay.rb', line 131
def capture(money, authorization, options = {})
post = PlugnpayPostData.new
post[:orderID] = authorization
add_amount(post, money, options)
add_customer_data(post, options)
commit(:capture, post)
end
|
#credit(money, identification_or_creditcard, options = {}) ⇒ Object
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
# File 'lib/active_merchant/billing/gateways/plugnpay.rb', line 151
def credit(money, identification_or_creditcard, options = {})
post = PlugnpayPostData.new
add_amount(post, money, options)
if identification_or_creditcard.is_a?(String)
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
refund(money, identification_or_creditcard, options)
else
add_creditcard(post, identification_or_creditcard)
add_addresses(post, options)
add_customer_data(post, options)
commit(:credit, post)
end
end
|
#purchase(money, creditcard, options = {}) ⇒ Object
105
106
107
108
109
110
111
112
113
114
115
116
|
# File 'lib/active_merchant/billing/gateways/plugnpay.rb', line 105
def purchase(money, creditcard, options = {})
post = PlugnpayPostData.new
add_amount(post, money, options)
add_creditcard(post, creditcard)
add_addresses(post, options)
add_invoice_data(post, options)
add_customer_data(post, options)
post[:authtype] = 'authpostauth'
commit(:authorization, post)
end
|
#refund(money, reference, options = {}) ⇒ Object
167
168
169
170
171
172
|
# File 'lib/active_merchant/billing/gateways/plugnpay.rb', line 167
def refund(money, reference, options = {})
post = PlugnpayPostData.new
add_amount(post, money, options)
post[:orderID] = reference
commit(:refund, post)
end
|
#void(authorization, options = {}) ⇒ Object
142
143
144
145
146
147
148
149
|
# File 'lib/active_merchant/billing/gateways/plugnpay.rb', line 142
def void(authorization, options = {})
post = PlugnpayPostData.new
post[:orderID] = authorization
post[:txn_type] = 'auth'
commit(:void, post)
end
|