Class: Pay::AppConfig
- Inherits:
-
AppUtils::BaseConfig
- Object
- AppUtils::BaseConfig
- Pay::AppConfig
- Defined in:
- lib/ruby/pay.rb
Overview
AppConfig class
Instance Attribute Summary collapse
-
#b2c_result_url ⇒ Object
Returns the value of attribute b2c_result_url.
-
#balance_result_url ⇒ Object
Returns the value of attribute balance_result_url.
-
#confirmation_url ⇒ Object
Returns the value of attribute confirmation_url.
-
#initiator_name ⇒ Object
Returns the value of attribute initiator_name.
-
#initiator_password ⇒ Object
Returns the value of attribute initiator_password.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#short_code ⇒ Object
Returns the value of attribute short_code.
-
#ssl_certificate ⇒ Object
Returns the value of attribute ssl_certificate.
-
#validation_url ⇒ Object
Returns the value of attribute validation_url.
Attributes inherited from AppUtils::BaseConfig
Class Method Summary collapse
-
.setup(provider: DarajaAuthProvider.create, short_code: nil, confirmation_url: nil, validation_url: nil, b2c_result_url: nil, initiator_name: nil, initiator_password: nil, ssl_certificate: nil, balance_result_url: nil) ⇒ Object
receive all inputs for payment setup.
Instance Method Summary collapse
-
#initialize(provider: DarajaAuthProvider.create, short_code: nil, confirmation_url: nil, validation_url: nil, b2c_result_url: nil, initiator_name: nil, initiator_password: nil, ssl_certificate: nil, balance_result_url: nil) ⇒ AppConfig
constructor
A new instance of AppConfig.
-
#register_urls ⇒ Array
register all request types (fail / success) urls.
Methods inherited from AppUtils::BaseConfig
Constructor Details
#initialize(provider: DarajaAuthProvider.create, short_code: nil, confirmation_url: nil, validation_url: nil, b2c_result_url: nil, initiator_name: nil, initiator_password: nil, ssl_certificate: nil, balance_result_url: nil) ⇒ AppConfig
Returns a new instance of AppConfig.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ruby/pay.rb', line 20 def initialize( provider: DarajaAuthProvider.create, short_code: nil, confirmation_url: nil, validation_url: nil, b2c_result_url: nil, initiator_name: nil, initiator_password: nil, ssl_certificate: nil, balance_result_url: nil ) super(is_sandbox: provider.is_sandbox) @short_code = short_code @confirmation_url = confirmation_url @validation_url = validation_url @provider = provider @b2c_result_url = b2c_result_url @initiator_name = initiator_name @initiator_password = initiator_password @ssl_certificate = ssl_certificate @balance_result_url = balance_result_url end |
Instance Attribute Details
#b2c_result_url ⇒ Object
Returns the value of attribute b2c_result_url.
10 11 12 |
# File 'lib/ruby/pay.rb', line 10 def b2c_result_url @b2c_result_url end |
#balance_result_url ⇒ Object
Returns the value of attribute balance_result_url.
10 11 12 |
# File 'lib/ruby/pay.rb', line 10 def balance_result_url @balance_result_url end |
#confirmation_url ⇒ Object
Returns the value of attribute confirmation_url.
10 11 12 |
# File 'lib/ruby/pay.rb', line 10 def confirmation_url @confirmation_url end |
#initiator_name ⇒ Object
Returns the value of attribute initiator_name.
10 11 12 |
# File 'lib/ruby/pay.rb', line 10 def initiator_name @initiator_name end |
#initiator_password ⇒ Object
Returns the value of attribute initiator_password.
10 11 12 |
# File 'lib/ruby/pay.rb', line 10 def initiator_password @initiator_password end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
18 19 20 |
# File 'lib/ruby/pay.rb', line 18 def provider @provider end |
#short_code ⇒ Object
Returns the value of attribute short_code.
10 11 12 |
# File 'lib/ruby/pay.rb', line 10 def short_code @short_code end |
#ssl_certificate ⇒ Object
Returns the value of attribute ssl_certificate.
10 11 12 |
# File 'lib/ruby/pay.rb', line 10 def ssl_certificate @ssl_certificate end |
#validation_url ⇒ Object
Returns the value of attribute validation_url.
10 11 12 |
# File 'lib/ruby/pay.rb', line 10 def validation_url @validation_url end |
Class Method Details
.setup(provider: DarajaAuthProvider.create, short_code: nil, confirmation_url: nil, validation_url: nil, b2c_result_url: nil, initiator_name: nil, initiator_password: nil, ssl_certificate: nil, balance_result_url: nil) ⇒ Object
receive all inputs for payment setup
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/ruby/pay.rb', line 44 def self.setup( provider: DarajaAuthProvider.create, short_code: nil, confirmation_url: nil, validation_url: nil, b2c_result_url: nil, initiator_name: nil, initiator_password: nil, ssl_certificate: nil, balance_result_url: nil ) AppConfig.new(provider: provider, short_code: short_code, confirmation_url: confirmation_url, validation_url: validation_url, b2c_result_url: b2c_result_url, initiator_name: initiator_name, initiator_password: initiator_password, ssl_certificate: ssl_certificate, balance_result_url: balance_result_url) end |
Instance Method Details
#register_urls ⇒ Array
register all request types (fail / success) urls
68 69 70 |
# File 'lib/ruby/pay.rb', line 68 def register_urls %w[Completed Cancelled].map { |status| setup_status(status) } end |