Class: ActiveMerchant::Billing::VantivExpressGateway
- Defined in:
- lib/active_merchant/billing/gateways/vantiv_express.rb
Constant Summary collapse
- SERVICE_TEST_URL =
'https://certservices.elementexpress.com'
- SERVICE_LIVE_URL =
'https://services.elementexpress.com'
- NETWORK_TOKEN_TYPE =
{ apple_pay: 2, google_pay: 1 }
- CARD_PRESENT_CODE =
{ 'Unknown' => 1, 'Present' => 2, 'NotPresent' => 3 }
- MARKET_CODE =
{ 'AutoRental' => 1, 'DirectMarketing' => 2, 'ECommerce' => 3, 'FoodRestaurant' => 4, 'HotelLodging' => 5, 'Petroleum' => 6, 'Retail' => 7, 'QSR' => 8, 'Grocery' => 9 }
- PAYMENT_TYPE =
{ 'NotUsed' => 0, 'Recurring' => 1, 'Installment' => 2, 'CardHolderInitiated' => 3, 'CredentialOnFile' => 4 }
- REVERSAL_TYPE =
{ 'System' => 0, 'Full' => 1, 'Partial' => 2 }
- SUBMISSION_TYPE =
{ 'NotUsed' => 0, 'Initial' => 1, 'Subsequent' => 2, 'Resubmission' => 3, 'ReAuthorization' => 4, 'DelayedCharges' => 5, 'NoShow' => 6 }
- LODGING_PPC =
{ 'NonParticipant' => 0, 'DollarLimit500' => 1, 'DollarLimit1000' => 2, 'DollarLimit1500' => 3 }
- LODGING_SPC =
{ 'Default' => 0, 'Sale' => 1, 'NoShow' => 2, 'AdvanceDeposit' => 3 }
- LODGING_CHARGE_TYPE =
{ 'Default' => 0, 'Restaurant' => 1, 'GiftShop' => 2 }
- TERMINAL_TYPE =
{ 'Unknown' => 0, 'PointOfSale' => 1, 'ECommerce' => 2, 'MOTO' => 3, 'FuelPump' => 4, 'ATM' => 5, 'Voice' => 6, 'Mobile' => 7, 'WebSiteGiftCard' => 8 }
- CARD_HOLDER_PRESENT_CODE =
{ 'Default' => 0, 'Unknown' => 1, 'Present' => 2, 'NotPresent' => 3, 'MailOrder' => 4, 'PhoneOrder' => 5, 'StandingAuth' => 6, 'ECommerce' => 7 }
- CARD_INPUT_CODE =
{ 'Default' => 0, 'Unknown' => 1, 'MagstripeRead' => 2, 'ContactlessMagstripeRead' => 3, 'ManualKeyed' => 4, 'ManualKeyedMagstripeFailure' => 5, 'ChipRead' => 6, 'ContactlessChipRead' => 7, 'ManualKeyedChipReadFailure' => 8, 'MagstripeReadChipReadFailure' => 9, 'MagstripeReadNonTechnicalFallback' => 10 }
- CVV_PRESENCE_CODE =
{ 'UseDefault' => 0, 'NotProvided' => 1, 'Provided' => 2, 'Illegible' => 3, 'CustomerIllegible' => 4 }
- TERMINAL_CAPABILITY_CODE =
{ 'Default' => 0, 'Unknown' => 1, 'NoTerminal' => 2, 'MagstripeReader' => 3, 'ContactlessMagstripeReader' => 4, 'KeyEntered' => 5, 'ChipReader' => 6, 'ContactlessChipReader' => 7 }
- TERMINAL_ENVIRONMENT_CODE =
{ 'Default' => 0, 'NoTerminal' => 1, 'LocalAttended' => 2, 'LocalUnattended' => 3, 'RemoteAttended' => 4, 'RemoteUnattended' => 5, 'ECommerce' => 6 }
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, payment, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
- #credit(money, payment, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ VantivExpressGateway
constructor
A new instance of VantivExpressGateway.
- #purchase(money, payment, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #scrub(transcript) ⇒ Object
- #store(payment, options = {}) ⇒ Object
- #supports_scrubbing? ⇒ Boolean
- #verify(payment, 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, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #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 = {}) ⇒ VantivExpressGateway
Returns a new instance of VantivExpressGateway.
153 154 155 156 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 153 def initialize( = {}) requires!(, :account_id, :account_token, :application_id, :acceptor_id, :application_name, :application_version) super end |
Instance Method Details
#authorize(money, payment, options = {}) ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 176 def (money, payment, = {}) eci = parse_eci(payment) request = build_xml_request do |xml| xml.CreditCardAuthorization(xmlns: live_url) do add_credentials(xml) add_payment_method(xml, payment) add_transaction(xml, money, , eci) add_terminal(xml, , eci) add_address(xml, ) add_lodging(xml, ) end end commit(request, money, payment) end |
#capture(money, authorization, options = {}) ⇒ Object
193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 193 def capture(money, , = {}) trans_id, _, eci = .split('|') [:trans_id] = trans_id request = build_xml_request do |xml| xml.CreditCardAuthorizationCompletion(xmlns: live_url) do add_credentials(xml) add_transaction(xml, money, , eci) add_terminal(xml, , eci) end end commit(request, money) end |
#credit(money, payment, options = {}) ⇒ Object
223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 223 def credit(money, payment, = {}) eci = parse_eci(payment) request = build_xml_request do |xml| xml.CreditCardCredit(xmlns: live_url) do add_credentials(xml) add_payment_method(xml, payment) add_transaction(xml, money, , eci) add_terminal(xml, , eci) end end commit(request, money, payment) end |
#purchase(money, payment, options = {}) ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 158 def purchase(money, payment, = {}) action = payment.is_a?(Check) ? 'CheckSale' : 'CreditCardSale' eci = parse_eci(payment) request = build_xml_request do |xml| xml.send(action, xmlns: live_url) do add_credentials(xml) add_payment_method(xml, payment) add_transaction(xml, money, , eci) add_terminal(xml, , eci) add_address(xml, ) add_lodging(xml, ) end end commit(request, money, payment) end |
#refund(money, authorization, options = {}) ⇒ Object
208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 208 def refund(money, , = {}) trans_id, _, eci = .split('|') [:trans_id] = trans_id request = build_xml_request do |xml| xml.CreditCardReturn(xmlns: live_url) do add_credentials(xml) add_transaction(xml, money, , eci) add_terminal(xml, , eci) end end commit(request, money) end |
#scrub(transcript) ⇒ Object
286 287 288 289 290 291 292 293 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 286 def scrub(transcript) transcript. gsub(%r((<AccountToken>).+?(</AccountToken>))i, '\1[FILTERED]\2'). gsub(%r((<CardNumber>).+?(</CardNumber>))i, '\1[FILTERED]\2'). gsub(%r((<CVV>).+?(</CVV>))i, '\1[FILTERED]\2'). gsub(%r((<AccountNumber>).+?(</AccountNumber>))i, '\1[FILTERED]\2'). gsub(%r((<RoutingNumber>).+?(</RoutingNumber>))i, '\1[FILTERED]\2') end |
#store(payment, options = {}) ⇒ Object
253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 253 def store(payment, = {}) request = build_xml_request do |xml| xml.PaymentAccountCreate(xmlns: SERVICE_LIVE_URL) do add_credentials(xml) add_payment_method(xml, payment) add_payment_account(xml, payment, [:payment_account_reference_number] || SecureRandom.hex(20)) add_address(xml, ) end end commit(request, payment, nil, :store) end |
#supports_scrubbing? ⇒ Boolean
282 283 284 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 282 def supports_scrubbing? true end |
#verify(payment, options = {}) ⇒ Object
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 266 def verify(payment, = {}) eci = parse_eci(payment) request = build_xml_request do |xml| xml.CreditCardAVSOnly(xmlns: live_url) do add_credentials(xml) add_payment_method(xml, payment) add_transaction(xml, 0, , eci) add_terminal(xml, , eci) add_address(xml, ) end end commit(request) end |
#void(authorization, options = {}) ⇒ Object
238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/active_merchant/billing/gateways/vantiv_express.rb', line 238 def void(, = {}) trans_id, trans_amount, eci = .split('|') .merge!({ trans_id: trans_id, trans_amount: trans_amount, reversal_type: 1 }) request = build_xml_request do |xml| xml.CreditCardReversal(xmlns: live_url) do add_credentials(xml) add_transaction(xml, trans_amount, , eci) add_terminal(xml, , eci) end end commit(request, trans_amount) end |