Class: ActiveMerchant::Billing::TransFirstGateway

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

Constant Summary collapse

URL =
'https://webservices.primerchants.com/creditcard.asmx/CCSale'
UNUSED_FIELDS =
%w(ECIValue UserId CAVVData TrackData POSInd EComInd MerchZIP MerchCustPNum MCC InstallmentNum InstallmentOf POSEntryMode POSConditionCode AuthCharInd CardCertData)
DECLINED =
'The transaction was declined'

Constants inherited from Gateway

Gateway::DEBIT_CARDS

Constants included from PostsData

PostsData::MAX_RETRIES, PostsData::OPEN_TIMEOUT, PostsData::READ_TIMEOUT

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, inherited, supports?, #test?

Methods included from Utils

generate_unique_id

Methods included from CreditCardFormatting

#format

Methods included from RequiresParameters

#requires!

Methods included from PostsData

included, #retry_exceptions, #ssl_post

Constructor Details

#initialize(options = {}) ⇒ TransFirstGateway

Returns a new instance of TransFirstGateway.



15
16
17
18
19
# File 'lib/active_merchant/billing/gateways/trans_first.rb', line 15

def initialize(options = {})
  requires!(options, :login, :password)
  @options = options
  super
end

Instance Method Details

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



21
22
23
24
25
26
27
28
29
30
# File 'lib/active_merchant/billing/gateways/trans_first.rb', line 21

def purchase(money, credit_card, options = {})
  post = {}
  
  add_amount(post, money)
  add_invoice(post, options)
  add_credit_card(post, credit_card)        
  add_address(post, options)   
       
  commit(post)
end