Class: ActiveMerchant::Billing::GlobalTransportGateway

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

Constant Summary

Constants inherited from Gateway

ActiveMerchant::Billing::Gateway::CREDIT_DEPRECATION_MESSAGE, ActiveMerchant::Billing::Gateway::DEBIT_CARDS, ActiveMerchant::Billing::Gateway::RECURRING_DEPRECATION_MESSAGE, ActiveMerchant::Billing::Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, #generate_unique_id, inherited, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

Constructor Details

#initialize(options = {}) ⇒ GlobalTransportGateway

Public: Create a new Global Transport gateway.

options - A hash of options:

:global_user_name - Your Global user name
:global_password  - Your Global password
:term_type        - 3 character field assigned by Global Transport after
                  - your application is certified.


24
25
26
27
# File 'lib/active_merchant/billing/gateways/global_transport.rb', line 24

def initialize(options={})
  requires!(options, :global_user_name, :global_password, :term_type)
  super
end

Instance Method Details

#authorize(money, payment_method, options = {}) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/active_merchant/billing/gateways/global_transport.rb', line 38

def authorize(money, payment_method, options={})
  post = {}
  add_invoice(post, money, options)
  add_payment_method(post, payment_method)
  add_address(post, options)

  commit('Auth', post, options)
end

#capture(money, authorization, options = {}) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/active_merchant/billing/gateways/global_transport.rb', line 47

def capture(money, authorization, options={})
  post = {}
  add_invoice(post, money, options)
  add_auth(post, authorization)

  commit('Force', post, options)
end

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



29
30
31
32
33
34
35
36
# File 'lib/active_merchant/billing/gateways/global_transport.rb', line 29

def purchase(money, payment_method, options={})
  post = {}
  add_invoice(post, money, options)
  add_payment_method(post, payment_method)
  add_address(post, options)

  commit('Sale', post, options)
end

#refund(money, authorization, options = {}) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/active_merchant/billing/gateways/global_transport.rb', line 55

def refund(money, authorization, options={})
  post = {}
  add_invoice(post, money, options)
  add_auth(post, authorization)

  commit('Return', post, options)
end

#verify(payment_method, options = {}) ⇒ Object



70
71
72
73
74
75
76
# File 'lib/active_merchant/billing/gateways/global_transport.rb', line 70

def verify(payment_method, options={})
  post = {}
  add_payment_method(post, payment_method)
  add_address(post, options)

  commit('CardVerify', post, options)
end

#void(authorization, options = {}) ⇒ Object



63
64
65
66
67
68
# File 'lib/active_merchant/billing/gateways/global_transport.rb', line 63

def void(authorization, options={})
  post = {}
  add_auth(post, authorization)

  commit('Void', post, options)
end