From 5a0bcb00652f5610e55c1e1949a6891d87a787a4 Mon Sep 17 00:00:00 2001 From: Denis Kuznetsov Date: Tue, 15 Apr 2014 15:13:15 +0400 Subject: [PATCH 1/2] added check camplaign price --- lib/e_pochta_sms.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/e_pochta_sms.rb b/lib/e_pochta_sms.rb index fc264de..bf74bb5 100644 --- a/lib/e_pochta_sms.rb +++ b/lib/e_pochta_sms.rb @@ -15,6 +15,19 @@ def create_address_book(params) end end + def check_campaign_price(params) + params['action'] = 'checkCampaignPrice' + + result = exec_command(params) + result = JSON.parse(result.body) + + if result.has_key? 'error' + false + else + result['result'] + end + end + def get_balance() params = {} params['action'] = 'getUserBalance' From 7a4bde165a597218b5416c7901e67e2fffedb589 Mon Sep 17 00:00:00 2001 From: Denis Kuznetsov Date: Tue, 15 Apr 2014 15:36:37 +0400 Subject: [PATCH 2/2] added get_addressbook --- lib/e_pochta_sms.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/e_pochta_sms.rb b/lib/e_pochta_sms.rb index bf74bb5..a5c3b04 100644 --- a/lib/e_pochta_sms.rb +++ b/lib/e_pochta_sms.rb @@ -28,6 +28,19 @@ def check_campaign_price(params) end end + def get_addressbook(params) + params['action'] = 'getAddressbook' + + result = exec_command(params) + result = JSON.parse(result.body) + + if result.has_key? 'error' + false + else + result['result'] + end + end + def get_balance() params = {} params['action'] = 'getUserBalance'