Module: UnlockGateway::Models::Gateway

Defined in:
lib/unlock_gateway/models/gateway.rb

Overview

Your module UnlockMyGatewayName::Models::Gateway, that should implement this interface, will be included in Unlock’s Gateway model. All methods will run in the context of an instance of Gateway model.

Instance Method Summary collapse

Instance Method Details

#available_settingsObject

This method should return an Array of UnlockGateway::Setting that will be displayed when configuring the gateway’s settings. Here is the place for API keys, etc.



34
35
36
# File 'lib/unlock_gateway/models/gateway.rb', line 34

def available_settings
  []
end

#descriptionObject

This method should return the description of the payment gateway to be displayed in Unlock’s gateways configurations.



13
14
# File 'lib/unlock_gateway/models/gateway.rb', line 13

def description
end

#has_sandbox?Boolean

This method should return true if the gateway has a sandbox alternative and false if not.

Returns:

  • (Boolean)


29
30
31
# File 'lib/unlock_gateway/models/gateway.rb', line 29

def has_sandbox?
  true
end

#imageObject

This method should return the image PATH of the payment gateway to be displayed in Unlock’s gateways configurations, such as ‘my_gateway/logo.png’.



17
18
# File 'lib/unlock_gateway/models/gateway.rb', line 17

def image
end

#nameObject

This method should return the name of the payment gateway to be displayed in Unlock’s gateways configurations.



8
9
10
# File 'lib/unlock_gateway/models/gateway.rb', line 8

def name
  self.module_name
end

#pathObject

This method should return the path for the routes generated by the gateway, such as ‘/my_gateway’.



25
26
# File 'lib/unlock_gateway/models/gateway.rb', line 25

def path
end

#urlObject

This method should return the gateways institutional website URL, to which Unlock will refer users.



21
22
# File 'lib/unlock_gateway/models/gateway.rb', line 21

def url
end