Class: ActiveMerchant::Billing::PaymentechOrbital::Gateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::PaymentechOrbital::Gateway
- Defined in:
- lib/active_merchant/billing/paymentech_orbital/gateway.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #authorize(money, credit_card = nil, options = {}) ⇒ Object
- #end_of_day(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Gateway
constructor
A new instance of Gateway.
- #profile(action, credit_card = nil, options = {}) ⇒ Object
- #purchase(money, credit_card = nil, options = {}) ⇒ Object
- #refund(money, credit_card = nil, options = {}) ⇒ Object
- #to_a ⇒ Object
- #void(tx_ref_num, tx_ref_idx, money = nil, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Gateway
Returns a new instance of Gateway.
48 49 50 51 52 53 54 55 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 48 def initialize( = {}) requires!(, :login, :password, :merchant_id, :bin, :terminal_id) @options = .merge({ :currency_code => self.class.currency_code, :currency_exponent => self.class.currency_exponent }) super end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
46 47 48 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 46 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
46 47 48 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 46 def response @response end |
Instance Method Details
#authorize(money, credit_card = nil, options = {}) ⇒ Object
57 58 59 60 61 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 57 def (money, credit_card=nil, = {}) @request = Request::NewOrder.new("A", money, credit_card, .merge(@options)) commit('authonly', @request) end |
#end_of_day(options = {}) ⇒ Object
87 88 89 90 91 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 87 def end_of_day(={}) @request = Request::EndOfDay.new(.merge(@options)) commit('end of day', @request) end |
#profile(action, credit_card = nil, options = {}) ⇒ Object
75 76 77 78 79 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 75 def profile(action, credit_card=nil, ={}) @request = Request::ProfileManagement.new(action, credit_card, .merge(@options)) commit("profile-#{action}", @request) end |
#purchase(money, credit_card = nil, options = {}) ⇒ Object
63 64 65 66 67 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 63 def purchase(money, credit_card=nil, = {}) @request = Request::NewOrder.new("AC", money, credit_card, .merge(@options)) commit('sale', @request) end |
#refund(money, credit_card = nil, options = {}) ⇒ Object
69 70 71 72 73 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 69 def refund(money, credit_card=nil, ={}) @request = Request::NewOrder.new("R", money, credit_card, .merge(@options)) commit('refund', @request) end |
#to_a ⇒ Object
93 94 95 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 93 def to_a request.to_a + response.to_a end |
#void(tx_ref_num, tx_ref_idx, money = nil, options = {}) ⇒ Object
81 82 83 84 85 |
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 81 def void(tx_ref_num, tx_ref_idx, money=nil, ={}) @request = Request::Void.new(tx_ref_num, tx_ref_idx, money, .merge(@options)) commit('void', @request) end |