Class: PromisePay::Marketplace
- Inherits:
-
Object
- Object
- PromisePay::Marketplace
- Defined in:
- lib/promise_pay/marketplace.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Marketplace
constructor
A new instance of Marketplace.
- #request_token ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Marketplace
Returns a new instance of Marketplace.
8 9 10 11 |
# File 'lib/promise_pay/marketplace.rb', line 8 def initialize( = {}) @user = .fetch(:user) @password = .fetch(:password) end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
6 7 8 |
# File 'lib/promise_pay/marketplace.rb', line 6 def token @token end |
Instance Method Details
#request_token ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/promise_pay/marketplace.rb', line 13 def request_token response = PromisePay::Request.new( path: api_resource, user: user, password: password ).execute @token = JSON.parse(response)["token"] token end |