Class: Transbank::Onepay::Base
- Inherits:
-
Object
- Object
- Transbank::Onepay::Base
- Defined in:
- lib/transbank/sdk/onepay/base.rb
Constant Summary collapse
- DEFAULT_CALLBACK =
The base class for Transbank Onepay
"http://no.callback.has/been.set".freeze
- DEFAULT_API_KEY =
'dKVhq1WGt_XapIYirTXNyUKoWTDFfxaEV63-O5jcsdw'.freeze
- DEFAULT_SHARED_SECRET =
'?XW#WOLG##FBAGEAYSNQ5APD#JF@$AYZ'.freeze
Class Attribute Summary collapse
- .api_key ⇒ Object
-
.app_scheme ⇒ String
Returns the app_scheme failing that, the value of ENV (your env variable).
-
.callback_url ⇒ String
Your callback URL, used to resume the payment process after validating with Transbank when paying on Channel::MOBILE.
-
.default_channel ⇒ String
readonly
The default channel.
-
.integration_type ⇒ Symbol
The current integration type.
-
.integration_types ⇒ Hash<String, String>
readonly
Contains all valid integration types.
- .shared_secret ⇒ Object
Class Method Summary collapse
-
.current_integration_type_app_key ⇒ String
The app key used by the current integration type.
-
.current_integration_type_url ⇒ String
The URL that is used by the current integration type.
-
.default_api_key ⇒ String
Returns the ‘ONEPAY_API_KEY’ env variable, or, if ONEPAY_API_KEY doesn’t exist, returns a default api key.
-
.default_shared_secret ⇒ String
Returns the ‘ONEPAY_SHARED_SECRET’ env variable, or, if ONEPAY_SHARED_SECRET doesn’t exist, returns a default shared secret.
Class Attribute Details
.api_key ⇒ Object
86 87 88 89 |
# File 'lib/transbank/sdk/onepay/base.rb', line 86 def api_key return ENV['ONEPAY_API_KEY'] if @api_key.nil? @api_key end |
.app_scheme ⇒ String
Returns the app_scheme failing that, the value of ENV (your env variable)
81 82 83 84 |
# File 'lib/transbank/sdk/onepay/base.rb', line 81 def app_scheme return ENV['ONEPAY_APP_SCHEME'] unless @app_scheme @app_scheme end |
.callback_url ⇒ String
Your callback URL, used to resume the payment process after validating with Transbank when paying on Channel::MOBILE
36 37 38 |
# File 'lib/transbank/sdk/onepay/base.rb', line 36 def callback_url @callback_url end |
.default_channel ⇒ String (readonly)
The default channel. Value must be in Channel.values
56 57 58 |
# File 'lib/transbank/sdk/onepay/base.rb', line 56 def default_channel @default_channel end |
.integration_type ⇒ Symbol
The current integration type
46 47 48 |
# File 'lib/transbank/sdk/onepay/base.rb', line 46 def integration_type @integration_type end |
.integration_types ⇒ Hash<String, String> (readonly)
Contains all valid integration types
26 27 28 |
# File 'lib/transbank/sdk/onepay/base.rb', line 26 def integration_types @integration_types end |
.shared_secret ⇒ Object
99 100 101 102 |
# File 'lib/transbank/sdk/onepay/base.rb', line 99 def shared_secret return ENV['ONEPAY_SHARED_SECRET'] if @shared_secret.nil? @shared_secret end |
Class Method Details
.current_integration_type_app_key ⇒ String
64 65 66 |
# File 'lib/transbank/sdk/onepay/base.rb', line 64 def current_integration_type_app_key @app_keys[@integration_type] end |
.current_integration_type_url ⇒ String
59 60 61 |
# File 'lib/transbank/sdk/onepay/base.rb', line 59 def current_integration_type_url @integration_types[@integration_type] end |
.default_api_key ⇒ String
Returns the ‘ONEPAY_API_KEY’ env variable, or, if ONEPAY_API_KEY doesn’t exist, returns a default api key
94 95 96 97 |
# File 'lib/transbank/sdk/onepay/base.rb', line 94 def default_api_key env_api_key = ENV['ONEPAY_API_KEY'] env_api_key.nil? ? DEFAULT_API_KEY : env_api_key end |
.default_shared_secret ⇒ String
Returns the ‘ONEPAY_SHARED_SECRET’ env variable, or, if ONEPAY_SHARED_SECRET doesn’t exist, returns a default shared secret
107 108 109 110 |
# File 'lib/transbank/sdk/onepay/base.rb', line 107 def default_shared_secret env_shared_secret = ENV['ONEPAY_SHARED_SECRET'] env_shared_secret.nil? ? DEFAULT_SHARED_SECRET : env_shared_secret end |