tckimlikdogrulama 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,47 @@
1
1
  #encoding:utf-8
2
2
  require "tckimlikdogrulama/version"
3
- require "tckimlikdogrula"
4
-
3
+
4
+ require 'savon'
5
+ require 'unicode_utils'
6
+
7
+ module Tckimlikdogrulama
8
+
9
+ module ClassMethods
10
+
11
+ def tckimlikno_dogrula(options = {})
12
+ client = Savon::Client.new("https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL")
13
+ res = client.request(:tc_kimlik_no_dogrula) {soap.body = { "TCKimlikNo" => options[:identification_number], "Ad" => UnicodeUtils.upcase(options[:first_name], :tr) , "Soyad" => UnicodeUtils.upcase(options[:last_name], :tr), "DogumYili" => options[:birth_year]}}
14
+ unless res.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
15
+ false
16
+ else
17
+ true
18
+ end
19
+ end
20
+
21
+ end
22
+
23
+ module InstanceMethods
24
+
25
+ def tckimlikno_dogrula(options = {})
26
+ client = Savon::Client.new("https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL")
27
+ 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}}
28
+ unless res.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
29
+ false
30
+ else
31
+ true
32
+ end
33
+ end
34
+
35
+ end
36
+
37
+ def self.included(receiver)
38
+ receiver.extend ClassMethods
39
+ receiver.send :include, InstanceMethods
40
+ end
41
+
42
+ end
43
+
44
+
45
+ class ActiveRecord::Base
46
+ include Tckimlikdogrulama
47
+ end
@@ -1,3 +1,3 @@
1
1
  module Tckimlikdogrulama
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tckimlikdogrulama
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-12 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: savon
16
- requirement: &70236770352960 !ruby/object:Gem::Requirement
16
+ requirement: &70223889629880 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70236770352960
24
+ version_requirements: *70223889629880
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: unicode_utils
27
- requirement: &70236770352420 !ruby/object:Gem::Requirement
27
+ requirement: &70223889629460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70236770352420
35
+ version_requirements: *70223889629460
36
36
  description: Ad, Soyad, TCKimlikNo ve DogumYili ile Dogrulama Yapar
37
37
  email:
38
38
  - guzelmurat@gmail.com