Class: Tamara::PaymentOptions::Check

Inherits:
ApplicationService show all
Includes:
JsonSchemas::PaymentOptions::Check
Defined in:
lib/tamara/api/payment_options/check.rb

Constant Summary

Constants included from JsonSchemas::Validator

JsonSchemas::Validator::ERROR_MESSAGES

Class Method Summary collapse

Instance Method Summary collapse

Methods included from JsonSchemas::Validator

#validate_params!

Methods inherited from ApplicationService

#call, #initialize

Methods included from Request

#api_token, #error_message, #handle_response_error, #headers, #parsed_response, #response_body, #response_status

Constructor Details

This class inherits a constructor from Tamara::ApplicationService

Class Method Details

.call(country:, phone_number:, order_value:, is_vip: false, opts: {}) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/tamara/api/payment_options/check.rb', line 6

def self.call(country:, phone_number:, order_value:, is_vip: false, opts: {})
  new(country: country,
      phone_number: phone_number,
      order_value: order_value,
      is_vip: is_vip,
      opts: opts).call
end

Instance Method Details

#call_apiObject



14
15
16
# File 'lib/tamara/api/payment_options/check.rb', line 14

def call_api
  ::Faraday.post(url, api_params.to_json, headers)
end