Class: Spree::Conekta::Provider

Inherits:
Client
  • Object
show all
Defined in:
lib/spree/conekta/provider.rb

Constant Summary

Constants inherited from Client

Client::CHARGE_ENDPOINT, Client::CONEKTA_API, Client::PAYMENT_SOURCES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Client

#connection, #headers, #payment_processor, #post

Constructor Details

#initialize(options = {}) ⇒ Provider

Returns a new instance of Provider.



5
6
7
8
# File 'lib/spree/conekta/provider.rb', line 5

def initialize(options = {})
  self.auth_token = options[:auth_token]
  self.source_method = payment_processor(options[:source_method])
end

Instance Attribute Details

#auth_tokenObject

Returns the value of attribute auth_token.



3
4
5
# File 'lib/spree/conekta/provider.rb', line 3

def auth_token
  @auth_token
end

#source_methodObject

Returns the value of attribute source_method.



3
4
5
# File 'lib/spree/conekta/provider.rb', line 3

def source_method
  @source_method
end

Instance Method Details

#authorize(amount, method_params, gateway_options = {}) ⇒ Object



10
11
12
13
# File 'lib/spree/conekta/provider.rb', line 10

def authorize(amount, method_params, gateway_options = {})
  common = build_common(amount, gateway_options)
  commit common, method_params, gateway_options
end

#capture(amount, method_params, gateway_options = {}) ⇒ Object



15
16
17
# File 'lib/spree/conekta/provider.rb', line 15

def capture(amount, method_params, gateway_options = {})
  Response.new({}, gateway_options)
end