Class: YandexWidget::Requests
- Inherits:
-
Object
- Object
- YandexWidget::Requests
- Defined in:
- lib/yandex_widget/requests.rb
Constant Summary collapse
- BASE_URL =
'https://payment.yandex.net/api/v3/payments/'
Instance Method Summary collapse
- #init_client ⇒ Object
-
#initialize(path, idempotence_key = nil, params: {}) ⇒ Requests
constructor
A new instance of Requests.
- #request_info ⇒ Object
- #set_status ⇒ Object
Constructor Details
Instance Method Details
#init_client ⇒ Object
11 12 13 14 |
# File 'lib/yandex_widget/requests.rb', line 11 def init_client HTTParty.post(@url, body: @params.to_json, headers: default_headers, basic_auth: auth, format: :json).parsed_response end |
#request_info ⇒ Object
16 17 18 |
# File 'lib/yandex_widget/requests.rb', line 16 def request_info HTTParty.get(@url, basic_auth: auth, format: :json).parsed_response end |
#set_status ⇒ Object
20 21 22 23 |
# File 'lib/yandex_widget/requests.rb', line 20 def set_status HTTParty.post(@url, body: @params.to_json, headers: default_headers, basic_auth: auth, format: :json) end |