Class: Splat::Vmobo

Inherits:
Gateway show all
Includes:
VmoboSchema
Defined in:
lib/splat/vendors/vmobo/vmobo_gateway.rb

Constant Summary collapse

SUCCESSFUL =
"200"
BAD_REQUEST =
"400"
FORBIDDEN =
"403"
SERVICE_UNAVAILABLE =
"503"
INTERNAL_ERROR =
"500"
SUPPORTED_COUNTRY_CODES =
['+91']

Instance Attribute Summary

Attributes inherited from Gateway

#vendor

Instance Method Summary collapse

Methods inherited from Gateway

[], #config_option, #configuration, default_configuration, inherited, #required_config

Methods included from Utils

#url_escape

Methods included from Insertion

#insert_values

Constructor Details

#initializeVmobo

Returns a new instance of Vmobo.



18
19
20
21
22
23
24
25
26
# File 'lib/splat/vendors/vmobo/vmobo_gateway.rb', line 18

def initialize()
  super
  self.required_config([:provider_url, :username, :api_key, :keyword])
  @url = URI.parse(self.config_option(:provider_url))
  @username = self.config_option(:username)
  @api_key  = self.config_option(:api_key)
  @keyword  = self.config_option(:keyword)
  @custom_message = SOAP::SOAPRawString.new("<%= custom_message %>")
end

Instance Method Details

#send_bulk_sms(message, numbers, options = {}) ⇒ Object



36
37
38
# File 'lib/splat/vendors/vmobo/vmobo_gateway.rb', line 36

def send_bulk_sms(message, numbers, options = {})
  call_service make_request(message, numbers), options[:response]
end

#send_bulk_sms_with_insertion(message, insertions = {}, options = {}) ⇒ Object



40
41
42
# File 'lib/splat/vendors/vmobo/vmobo_gateway.rb', line 40

def send_bulk_sms_with_insertion(message, insertions = {}, options = {})
   call_service make_request_with_insertion(insert_values(message, insertions)), options[:response]
end

#send_sms(message, number, options = {}) ⇒ Object



32
33
34
# File 'lib/splat/vendors/vmobo/vmobo_gateway.rb', line 32

def send_sms(message, number, options = {})
   call_service make_request(message, [number]), options[:response]
end

#supported_country_codeObject



28
29
30
# File 'lib/splat/vendors/vmobo/vmobo_gateway.rb', line 28

def supported_country_code
  SUPPORTED_COUNTRY_CODE
end