Class: ActiveMerchant::Billing::CashnetGateway
- Defined in:
- lib/active_merchant/billing/gateways/cashnet.rb
Constant Summary
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CashnetGateway
constructor
Creates a new CashnetGateway.
- #purchase(money, payment_object, options = {}) ⇒ Object
- #refund(money, identification, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, non_fractional_currency?, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ CashnetGateway
Creates a new CashnetGateway
Options
-
:merchant
– Gateway Merchant (REQUIRED) -
:operator
– Operator (REQUIRED) -
:password
– Password (REQUIRED) -
:merchant_gateway_name
– Site name (REQUIRED) -
:station
– Station (defaults to “WEB”) -
:custcode
– Customer code (defaults to “ActiveMerchant/#VERSION”) -
:default_item_code
– Default item code (defaults to “FEE”, can be overridden on a per-transaction basis with options)
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/active_merchant/billing/gateways/cashnet.rb', line 25 def initialize( = {}) requires!( , :merchant, :operator, :password, :merchant_gateway_name ) [:default_item_code] ||= "FEE" super end |
Instance Method Details
#purchase(money, payment_object, options = {}) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/active_merchant/billing/gateways/cashnet.rb', line 37 def purchase(money, payment_object, = {}) post = {} add_creditcard(post, payment_object) add_invoice(post, ) add_address(post, ) add_customer_data(post, ) commit('SALE', money, post) end |
#refund(money, identification, options = {}) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/active_merchant/billing/gateways/cashnet.rb', line 46 def refund(money, identification, = {}) post = {} post[:origtx] = identification add_invoice(post, ) commit('REFUND', money, post) end |