Class: ActiveMerchant::Billing::NetbillingGateway
- Defined in:
- lib/active_merchant/billing/gateways/netbilling.rb
Constant Summary collapse
- URL =
'https://secure.netbilling.com:1402/gw/sas/direct3.1'
- TRANSACTIONS =
{ :authorization => 'A', :purchase => 'S', :referenced_credit => 'R', :unreferenced_credit => 'C', :capture => 'D' }
- SUCCESS_CODES =
[ '1', 'T' ]
- SUCCESS_MESSAGE =
'The transaction was approved'
- FAILURE_MESSAGE =
'The transaction failed'
- TEST_LOGIN =
'104901072025'
Constants inherited from Gateway
Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, credit_card, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ NetbillingGateway
constructor
A new instance of NetbillingGateway.
- #purchase(money, credit_card, options = {}) ⇒ Object
- #test? ⇒ Boolean
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?
Methods included from Utils
Methods included from CreditCardFormatting
Methods included from RequiresParameters
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ NetbillingGateway
Returns a new instance of NetbillingGateway.
24 25 26 27 28 |
# File 'lib/active_merchant/billing/gateways/netbilling.rb', line 24 def initialize( = {}) requires!(, :login) @options = super end |
Instance Method Details
#authorize(money, credit_card, options = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/active_merchant/billing/gateways/netbilling.rb', line 30 def (money, credit_card, = {}) post = {} add_amount(post, money) add_invoice(post, ) add_credit_card(post, credit_card) add_address(post, credit_card, ) add_customer_data(post, ) commit(:authorization, money, post) end |
#capture(money, authorization, options = {}) ⇒ Object
52 53 54 55 56 |
# File 'lib/active_merchant/billing/gateways/netbilling.rb', line 52 def capture(money, , = {}) post = {} add_reference(post, ) commit(:capture, money, post) end |
#purchase(money, credit_card, options = {}) ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/active_merchant/billing/gateways/netbilling.rb', line 41 def purchase(money, credit_card, = {}) post = {} add_amount(post, money) add_invoice(post, ) add_credit_card(post, credit_card) add_address(post, credit_card, ) add_customer_data(post, ) commit(:purchase, money, post) end |
#test? ⇒ Boolean
58 59 60 |
# File 'lib/active_merchant/billing/gateways/netbilling.rb', line 58 def test? @options[:login] == TEST_LOGIN || super end |