Class: ActiveMerchant::Billing::OppGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::OppGateway
show all
- Defined in:
- lib/active_merchant/billing/gateways/opp.rb
Constant Summary
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
-
#authorize(money, payment, options = {}) ⇒ Object
-
#capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ OppGateway
constructor
A new instance of OppGateway.
-
#purchase(money, payment, options = {}) ⇒ Object
-
#refund(money, authorization, options = {}) ⇒ Object
-
#scrub(transcript) ⇒ Object
-
#supports_scrubbing? ⇒ Boolean
-
#verify(credit_card, options = {}) ⇒ Object
-
#void(authorization, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #test?
#expdate, #format
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ OppGateway
Returns a new instance of OppGateway.
121
122
123
124
|
# File 'lib/active_merchant/billing/gateways/opp.rb', line 121
def initialize(options={})
requires!(options, :user_id, :password, :entity_id)
super
end
|
Instance Method Details
#authorize(money, payment, options = {}) ⇒ Object
132
133
134
135
|
# File 'lib/active_merchant/billing/gateways/opp.rb', line 132
def authorize(money, payment, options={})
execute_dbpa('PA', money, payment, options)
end
|
#capture(money, authorization, options = {}) ⇒ Object
137
138
139
140
|
# File 'lib/active_merchant/billing/gateways/opp.rb', line 137
def capture(money, authorization, options={})
execute_referencing('CP', money, authorization, options)
end
|
#purchase(money, payment, options = {}) ⇒ Object
126
127
128
129
130
|
# File 'lib/active_merchant/billing/gateways/opp.rb', line 126
def purchase(money, payment, options={})
execute_dbpa(options[:risk_workflow] ? 'PA.CP': 'DB',
money, payment, options)
end
|
#refund(money, authorization, options = {}) ⇒ Object
142
143
144
145
|
# File 'lib/active_merchant/billing/gateways/opp.rb', line 142
def refund(money, authorization, options={})
execute_referencing('RF', money, authorization, options)
end
|
#scrub(transcript) ⇒ Object
163
164
165
166
167
168
|
# File 'lib/active_merchant/billing/gateways/opp.rb', line 163
def scrub(transcript)
transcript.
gsub(%r((authentication\.password=)\w+), '\1[FILTERED]').
gsub(%r((card\.number=)\d+), '\1[FILTERED]').
gsub(%r((card\.cvv=)\d+), '\1[FILTERED]')
end
|
#supports_scrubbing? ⇒ Boolean
159
160
161
|
# File 'lib/active_merchant/billing/gateways/opp.rb', line 159
def supports_scrubbing?
true
end
|
#verify(credit_card, options = {}) ⇒ Object
152
153
154
155
156
157
|
# File 'lib/active_merchant/billing/gateways/opp.rb', line 152
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
147
148
149
150
|
# File 'lib/active_merchant/billing/gateways/opp.rb', line 147
def void(authorization, options={})
execute_referencing('RV', nil, authorization, options)
end
|