module IletiMerkezi
Constants
- VERSION
Attributes
configuration[W]
:reek: Attribute
Public Instance Methods
balance()
click to toggle source
Get balance information
@return [IletiMerkezi::Response]
@api public
# File lib/ileti_merkezi.rb, line 42 def balance Balance.query end
cancel(order_id)
click to toggle source
code(code_id)
click to toggle source
Find status with code id
@param code_id [Integer] Http status code
@return [IletiMerkezi::Status]
@api public
# File lib/ileti_merkezi.rb, line 64 def code(code_id) Status.find(code_id) end
configuration()
click to toggle source
# File lib/ileti_merkezi.rb, line 27 def configuration @configuration ||= Configuration.new end
configure() { |configuration| ... }
click to toggle source
# File lib/ileti_merkezi.rb, line 31 def configure yield(configuration) end
info()
click to toggle source
Get account information
@return [Hash] {
name_surname: 'name-surname', tc_number: nil, title: nil, email: 'email', gsm: 'phone', password: 'password', commercial_title: nil, gsm2: nil, phone_number: nil, fax_number: nil, bill_address: nil, zone: nil, city: nil, zip: nil, charge_home: nil, charge_number: nil
}
@api public
# File lib/ileti_merkezi.rb, line 91 def info response = Account.info response.to_h.fetch(:userInfo, {}) end
report(order_id, page: 1, row_count: 1000)
click to toggle source
Get Sms
order report
@param order_id [Integer], page [Integer], row_count [Integer]
@return [IletiMerkezi::Response]
@api public
# File lib/ileti_merkezi.rb, line 103 def report(order_id, page: 1, row_count: 1000) Report.new(order_id, page: page, row_count: row_count).query end
send(args)
click to toggle source
Sms
send method
@param args [Hash]
@return [IletiMerkezi::Response]
Example:
args1 = {
send_datetime: '15/01/2017 12:00' # Opsiyonel sender: 'TEST' # Opsiyonel phones: ['0555 555 00 01', '0555 555 00 02'] text: 'Test Message'
}
args2 = {
send_datetime: '15/01/2017 12:00' # Opsiyonel sender: 'TEST' # Opsiyonel messages: [ { text: 'First Test Message', phones: ['0555 555 00 01', '0555 555 00 02'], }, { text: 'Second Test Message', phones: ['0555 555 00 03', '0555 555 00 04'], } ]
}
response = IletiMerkezi.send(args1)
or response = IletiMerkezi.send(args2)
@api public
# File lib/ileti_merkezi.rb, line 144 def send(args) Sms.new(args).send end
senders()
click to toggle source
Get senders
@return [Hash]
@api public
# File lib/ileti_merkezi.rb, line 153 def senders response = Account.senders response.to_h.fetch(:smsHeaderInfo, {}) end
status()
click to toggle source
Get Service Status
@return [Boolean]
@api public
# File lib/ileti_merkezi.rb, line 163 def status balance.code == 200 end