tckimlikdogrulama 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tckimlikdogrulama.rb +6 -6
- data/lib/tckimlikdogrulama/version.rb +1 -1
- metadata +1 -1
data/lib/tckimlikdogrulama.rb
CHANGED
@@ -6,15 +6,15 @@ module Tckimlikdogrulama
|
|
6
6
|
module ClassMethods
|
7
7
|
def tckimlikno_dogrula(options = {})
|
8
8
|
begin
|
9
|
-
|
9
|
+
attr_accessor :first_name, :identification_number, :last_name, :birth_year
|
10
10
|
|
11
|
-
first_name = options[:first_name]
|
12
|
-
last_name = options[:last_name]
|
13
|
-
identification_number = options[:identification_number]
|
14
|
-
birth_year = options[:birth_year]
|
11
|
+
self.first_name = options[:first_name]
|
12
|
+
self.last_name = options[:last_name]
|
13
|
+
self.identification_number = options[:identification_number]
|
14
|
+
self.birth_year = options[:birth_year]
|
15
15
|
|
16
16
|
client = Savon::Client.new("https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL")
|
17
|
-
res = client.request(:tc_kimlik_no_dogrula) {soap.body = { "TCKimlikNo" => identification_number, "Ad" => UnicodeUtils.upcase(first_name, :tr) , "Soyad" => UnicodeUtils.upcase(last_name, :tr), "DogumYili" => birth_year}}
|
17
|
+
res = client.request(:tc_kimlik_no_dogrula) {soap.body = { "TCKimlikNo" => self.identification_number, "Ad" => UnicodeUtils.upcase(self.first_name, :tr) , "Soyad" => UnicodeUtils.upcase(self.last_name, :tr), "DogumYili" => self.birth_year}}
|
18
18
|
unless res.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
|
19
19
|
self.errors.add(:identification_number, "Doğrulanamadı. Lütfen bilgilerinizi kontrol edip, tekrar deneyiniz.")
|
20
20
|
end
|