Class: Monri::PaymentMethods
- Inherits:
-
Object
- Object
- Monri::PaymentMethods
- Defined in:
- lib/monri/payment_methods.rb
Instance Attribute Summary collapse
- #access_tokens ⇒ Monri::AccessTokens writeonly
- #config ⇒ Monri::Config
- #http_client ⇒ Monri::HttpClient writeonly
Instance Method Summary collapse
Instance Attribute Details
#access_tokens=(value) ⇒ Monri::AccessTokens (writeonly)
9 10 11 |
# File 'lib/monri/payment_methods.rb', line 9 def access_tokens=(value) @access_tokens = value end |
#http_client=(value) ⇒ Monri::HttpClient (writeonly)
6 7 8 |
# File 'lib/monri/payment_methods.rb', line 6 def http_client=(value) @http_client = value end |
Instance Method Details
#list(options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/monri/payment_methods.rb', line 12 def list( = {}) access_token = @access_tokens.create!(scopes: ['payment-methods']).access_token response = @http_client.get('/v2/payment-methods', oauth: access_token) if response.success? response.body else # TODO: handle this case end rescue StandardError => e # TODO: handle this case nil end |