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.
-
.commerce_logo_url ⇒ String
The url of the commerce logo to be displayed in the Onepay mobile app.
-
.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.
-
.qr_width_height ⇒ Integer
The width and height in pixels for the returned QR.
- .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
96 97 98 99 |
# File 'lib/transbank/sdk/onepay/base.rb', line 96 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)
91 92 93 94 |
# File 'lib/transbank/sdk/onepay/base.rb', line 91 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 |
.commerce_logo_url ⇒ String
The url of the commerce logo to be displayed in the Onepay mobile app.
66 67 68 |
# File 'lib/transbank/sdk/onepay/base.rb', line 66 def commerce_logo_url @commerce_logo_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 |
.qr_width_height ⇒ Integer
The width and height in pixels for the returned QR.
61 62 63 |
# File 'lib/transbank/sdk/onepay/base.rb', line 61 def qr_width_height @qr_width_height end |
.shared_secret ⇒ Object
109 110 111 112 |
# File 'lib/transbank/sdk/onepay/base.rb', line 109 def shared_secret return ENV['ONEPAY_SHARED_SECRET'] if @shared_secret.nil? @shared_secret end |
Class Method Details
.current_integration_type_app_key ⇒ String
Returns the app key used by the current integration type.
74 75 76 |
# File 'lib/transbank/sdk/onepay/base.rb', line 74 def current_integration_type_app_key @app_keys[@integration_type] end |
.current_integration_type_url ⇒ String
Returns the URL that is used by the current integration type.
69 70 71 |
# File 'lib/transbank/sdk/onepay/base.rb', line 69 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
104 105 106 107 |
# File 'lib/transbank/sdk/onepay/base.rb', line 104 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
117 118 119 120 |
# File 'lib/transbank/sdk/onepay/base.rb', line 117 def default_shared_secret env_shared_secret = ENV['ONEPAY_SHARED_SECRET'] env_shared_secret.nil? ? DEFAULT_SHARED_SECRET : env_shared_secret end |