class QuickPay::API::Client
Constants
- CONTENT_TYPE_JSON_REGEX
- DEFAULT_HEADERS
- HTTPS
- Request
Public Class Methods
Source
# File lib/quickpay/api/client.rb, line 18 def initialize(username: nil, password: nil, base_uri: "https://api.quickpay.net", options: {}) @read_timeout = options.fetch(:read_timeout, 60) @write_timeout = options.fetch(:write_timeout, 60) @connect_timeout = options.fetch(:connect_timeout, 60) @json_opts = options.fetch(:json_opts, nil) uri_parser = URI::Parser.new @username = uri_parser.escape(username) if username @password = uri_parser.escape(password) if password @base_uri = base_uri end
Private Instance Methods
Source
# File lib/quickpay/api/client.rb, line 103 def scrub_body(body, content_type) return "" if body.to_s.empty? if [CONTENT_TYPE_JSON_REGEX, %r{application/x-www-form-urlencoded}].any? { |regex| regex.match(content_type) } body else "<scrubbed for Content-Type #{content_type}>" end end