Class: ActiveMerchant::Billing::NetaxeptGateway
- Defined in:
- lib/active_merchant/billing/gateways/netaxept.rb
Constant Summary
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, creditcard, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ NetaxeptGateway
constructor
A new instance of NetaxeptGateway.
- #purchase(money, creditcard, options = {}) ⇒ Object
- #refund(money, authorization, 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, #scrub, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #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 = {}) ⇒ NetaxeptGateway
Returns a new instance of NetaxeptGateway.
25 26 27 28 |
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 25 def initialize( = {}) requires!(, :login, :password) super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 39 def (money, creditcard, = {}) requires!(, :order_id) MultiResponse.run do |r| r.process { setup_transaction(money, ) } r.process { add_and_auth_credit_card(r., creditcard, ) } r.process { query_transaction(r., ) } end end |
#capture(money, authorization, options = {}) ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 49 def capture(money, , = {}) post = {} add_credentials(post, ) (post, , money) post[:operation] = 'Capture' commit('Netaxept/process.aspx', post) end |
#purchase(money, creditcard, options = {}) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 30 def purchase(money, creditcard, = {}) requires!(, :order_id) MultiResponse.run do |r| r.process { (money, creditcard, ) } r.process { capture(money, r., ) } end end |
#refund(money, authorization, options = {}) ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 57 def refund(money, , = {}) post = {} add_credentials(post, ) (post, , money) post[:operation] = 'Credit' commit('Netaxept/process.aspx', post) end |
#void(authorization, options = {}) ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/active_merchant/billing/gateways/netaxept.rb', line 65 def void(, = {}) post = {} add_credentials(post, ) (post, ) post[:operation] = 'Annul' commit('Netaxept/process.aspx', post) end |