Class: ActiveMerchant::Billing::FluidpayGateway

Inherits:
Gateway
  • Object
show all
Includes:
Empty
Defined in:
lib/active_merchant/billing/gateways/fluidpay.rb

Constant Summary collapse

SUCCESS_CODE =
100
SOFT_DECLINE_CODES =
[201, 203, 204, 205, 221, 223, 225, 226, 240].freeze

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

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_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

Constructor Details

#initialize(options = {}) ⇒ FluidpayGateway

Returns a new instance of FluidpayGateway.



18
19
20
21
22
# File 'lib/active_merchant/billing/gateways/fluidpay.rb', line 18

def initialize(options = {})
  requires!(options, :api_key)
  super
  @response_http_code = nil
end

Instance Method Details

#capture(amount, authorization, options = {}) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/active_merchant/billing/gateways/fluidpay.rb', line 36

def capture(amount, authorization, options = {})
  post = {}
  add_invoice(post, amount, options)
  add_level3_fields(post, options)
  add_reference(post, authorization)

  commit('capture', post)
end

#purchase(amount, payment_method, options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/active_merchant/billing/gateways/fluidpay.rb', line 24

def purchase(amount, payment_method, options = {})
  post = {}
  add_invoice(post, amount, options)
  add_payment_method(post, payment_method, options)
  add_customer_data(post, options)
  add_vendor_data(post, options)
  add_level3_fields(post, options)
  add_three_d_secure(post, options)

  commit('transaction', post)
end

#refund(amount, authorization, options = {}) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/active_merchant/billing/gateways/fluidpay.rb', line 52

def refund(amount, authorization, options = {})
  post = {}
  post[:amount] = amount
  add_reference(post, authorization)

  commit('refund', post)
end

#store(payment_method, options = {}) ⇒ Object



69
70
71
72
73
# File 'lib/active_merchant/billing/gateways/fluidpay.rb', line 69

def store(payment_method, options = {})
  post = {}
  (post, payment_method, options)
  commit('customer', post)
end

#supports_network_tokenization?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/active_merchant/billing/gateways/fluidpay.rb', line 65

def supports_network_tokenization?
  true
end

#verify_credentialsObject



60
61
62
63
# File 'lib/active_merchant/billing/gateways/fluidpay.rb', line 60

def verify_credentials
  response = void('0')
  response.message != 'Authentication Failed'
end

#void(authorization, options = {}) ⇒ Object



45
46
47
48
49
50
# File 'lib/active_merchant/billing/gateways/fluidpay.rb', line 45

def void(authorization, options = {})
  post = {}
  add_reference(post, authorization)

  commit('void', post)
end