Class: ActiveMerchant::Billing::XpayGateway

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

Constant Summary collapse

ENDPOINTS_MAPPING =
{
  purchase: 'orders/2steps/payment',
  authorize: 'orders/2steps/init',
  capture: 'operations/{%s}/captures',
  verify: 'orders/card_verification',
  void: 'operations/{%s}/cancels',
  refund: 'operations/{%s}/refunds'
}

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, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #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 = {}) ⇒ XpayGateway

Returns a new instance of XpayGateway.



25
26
27
28
29
# File 'lib/active_merchant/billing/gateways/xpay.rb', line 25

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

Instance Method Details

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



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

def authorize(amount, payment_method, options = {})
  post = {}
  add_auth_purchase(post, amount, payment_method, options)
  commit('authorize', post, options)
end

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



42
43
44
45
# File 'lib/active_merchant/billing/gateways/xpay.rb', line 42

def capture(amount, authorization, options = {})
  post = {}
  commit('capture', post, options)
end

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



31
32
33
34
# File 'lib/active_merchant/billing/gateways/xpay.rb', line 31

def purchase(amount, payment_method, options = {})
  post = {}
  commit('purchase', post, options)
end

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



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

def refund(amount, authorization, options = {})
  post = {}
  commit('refund', post, options)
end

#scrub(transcript) ⇒ Object



66
# File 'lib/active_merchant/billing/gateways/xpay.rb', line 66

def scrub(transcript) end

#supports_scrubbing?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/active_merchant/billing/gateways/xpay.rb', line 62

def supports_scrubbing?
  true
end

#verify(credit_card, options = {}) ⇒ Object



57
58
59
60
# File 'lib/active_merchant/billing/gateways/xpay.rb', line 57

def verify(credit_card, options = {})
  post = {}
  commit('verify', post, options)
end

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



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

def void(authorization, options = {})
  post = {}
  commit('void', post, options)
end