Sha256: 81dd5b08ff49bdd17e319d82dc9ff957b6a231ca5ae867bc998366f3163902ef
Contents?: true
Size: 1008 Bytes
Versions: 19
Compression:
Stored size: 1008 Bytes
Contents
module Smess class CardBoardFish < HttpBase def deliver request.url = "#{url}?#{params.to_query}" http_get request end attr_accessor :username, :password def validate_config @username = config.fetch(:username) @password = config.fetch(:password) end private def url "https://sms2.cardboardfish.com:9444/HTTPSMS" end def params @params ||= { "S" => "H", "UN" => username, "P" => password, "DA" => sms.to, "M" => sms.message.strip_nongsm_chars.encode("ISO-8859-1"), "SA" => from, "ST" => 5 } end def normal_result(response) response_code = response.code response_code = "0" if response.code.to_s == "200" # Successful response { message_id: message_id, response_code: response_code.to_s, response: {body: response.body}, destination_address: sms.to, data: result_data } end end end
Version data entries
19 entries across 19 versions & 1 rubygems