Class: ActiveMerchant::Billing::PixxelsGateway

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

Constant Summary collapse

SUCCESS_CODE =
0
SOFT_DECLINE_CODES =
[65536, 65539, 65542, 65543, 65545, 65547, 65553, 65554, 65556, 65564, 65565, 65566, 65567, 65575].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_network_tokenization?, #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 = {}) ⇒ PixxelsGateway

Returns a new instance of PixxelsGateway.



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

def initialize(options = {})
  requires!(options, :merchant_id, :signature_key)
  super

  @response_http_code = nil
end

Instance Method Details

#cancel(authorization, options) ⇒ Object



50
51
52
53
54
55
# File 'lib/active_merchant/billing/gateways/pixxels.rb', line 50

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

  commit('CANCEL', post)
end

#confirm(options) ⇒ Object



43
44
45
46
47
48
# File 'lib/active_merchant/billing/gateways/pixxels.rb', line 43

def confirm(options)
  post = {}
  add_three_ds_level_2_fields(post, options)

  commit('SALE', post)
end

#pre_authorize(options) ⇒ Object



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

def pre_authorize(options)
  post = {}
  add_three_ds_fields(post, options)

  commit('SALE', 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/pixxels.rb', line 24

def purchase(amount, payment_method, options = {})
  post = {}
  add_invoice(post, amount, options)
  add_device(post, options)
  add_payment_method(post, payment_method, options)
  add_customer_data(post, options)
  add_three_d_url(post, options)
  add_recurring_type(post)

  commit('SALE', post)
end

#recurring(amount, options) ⇒ Object



65
66
67
68
69
70
71
72
73
# File 'lib/active_merchant/billing/gateways/pixxels.rb', line 65

def recurring(amount, options)
  post = {}

  add_recurring_type(post)
  add_recurring_details(post, amount, options)
  add_reference(post, options[:xref])

  commit('SALE', post)
end

#refund(amount, authorization, options) ⇒ Object



57
58
59
60
61
62
63
# File 'lib/active_merchant/billing/gateways/pixxels.rb', line 57

def refund(amount, authorization, options)
  post = {}
  add_refund_details(post, amount, options)
  add_reference(post, authorization)

  commit('REFUND_SALE', post)
end