Class: ActiveMerchant::Billing::CashnetGateway
- Includes:
- Empty
- Defined in:
- lib/active_merchant/billing/gateways/cashnet.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
-
#initialize(options = {}) ⇒ CashnetGateway
constructor
Creates a new CashnetGateway.
- #purchase(money, payment_object, options = {}) ⇒ Object
- #refund(money, identification, options = {}) ⇒ Object
- #scrub(transcript) ⇒ Object
- #supports_scrubbing? ⇒ Boolean
Methods inherited from Gateway
#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #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)
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/active_merchant/billing/gateways/cashnet.rb', line 29 def initialize( = {}) requires!( , :merchant, :operator, :password, :merchant_gateway_name ) [:default_item_code] ||= 'FEE' super end |
Instance Method Details
#purchase(money, payment_object, options = {}) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/active_merchant/billing/gateways/cashnet.rb', line 41 def purchase(money, payment_object, = {}) post = {} add_creditcard(post, payment_object) add_invoice(post, money, ) add_address(post, ) add_customer_data(post, ) commit('SALE', money, post) end |
#refund(money, identification, options = {}) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/active_merchant/billing/gateways/cashnet.rb', line 50 def refund(money, identification, = {}) post = {} post[:origtx] = identification add_invoice(post, money, ) add_customer_data(post, ) commit('REFUND', money, post) end |
#scrub(transcript) ⇒ Object
62 63 64 65 66 67 |
# File 'lib/active_merchant/billing/gateways/cashnet.rb', line 62 def scrub(transcript) transcript. gsub(%r{(password=)[^&]+}, '\1[FILTERED]'). gsub(%r{(cardno=)[^&]+}, '\1[FILTERED]'). gsub(%r{(cid=)[^&]+}, '\1[FILTERED]') end |
#supports_scrubbing? ⇒ Boolean
58 59 60 |
# File 'lib/active_merchant/billing/gateways/cashnet.rb', line 58 def supports_scrubbing? true end |