Skip to content

Commit 9042213

Browse files
ATO-4761: Fix Verification URLs in sift-ruby (#97)
* ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby * ATO-4761: Fix Verification URLs in sift-ruby
1 parent 435399e commit 9042213

5 files changed

Lines changed: 18 additions & 14 deletions

File tree

HISTORY

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
=== 4.5.1 2025-04-07
2+
- Fix Verification URLs
3+
14
=== 4.5.0 2024-05-16
25
- Support for warnings in Events API
36

lib/sift.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ def self.rest_api_path(version=API_VERSION)
1010
end
1111

1212
# Returns the path for the specified API version
13-
def self.verification_api_send_path(version=API_VERSION)
13+
def self.verification_api_send_path(version=VERIFICATION_API_VERSION)
1414
"/v#{version}/verification/send"
1515
end
1616

1717
# Returns the path for the specified API version
18-
def self.verification_api_resend_path(version=API_VERSION)
18+
def self.verification_api_resend_path(version=VERIFICATION_API_VERSION)
1919
"/v#{version}/verification/resend"
2020
end
2121

2222
# Returns the path for the specified API version
23-
def self.verification_api_check_path(version=API_VERSION)
23+
def self.verification_api_check_path(version=VERIFICATION_API_VERSION)
2424
"/v#{version}/verification/check"
2525
end
2626

lib/sift/client.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def initialize(opts = {})
139139
@api_key = opts[:api_key] || Sift.api_key
140140
@account_id = opts[:account_id] || Sift.account_id
141141
@version = opts[:version] || API_VERSION
142+
@verification_version = opts[:verification_version] || VERIFICATION_API_VERSION
142143
@timeout = opts[:timeout] || 2 # 2-second timeout by default
143144
@path = opts[:path] || Sift.rest_api_path(@version)
144145

@@ -201,7 +202,7 @@ def user_agent
201202
#
202203
# :path::
203204
# Overrides the URI path for this API call.
204-
#
205+
#
205206
# :include_score_percentiles::
206207
# include_score_percentiles(optional) : Whether to add new parameter in the query parameter.
207208
#
@@ -286,7 +287,7 @@ def track(event, properties = {}, opts = {})
286287
#
287288
# :version::
288289
# Overrides the version of the Events API to call.
289-
#
290+
#
290291
# :include_score_percentiles::
291292
# include_score_percentiles(optional) : Whether to add new parameter in the query parameter.
292293
#
@@ -350,7 +351,7 @@ def score(user_id, opts = {})
350351
#
351352
# :timeout::
352353
# Overrides the timeout (in seconds) for this call.
353-
#
354+
#
354355
# :include_score_percentiles::
355356
# include_score_percentiles(optional) : Whether to add new parameter in the query parameter.
356357
#
@@ -755,7 +756,7 @@ def build_default_headers_post(api_key)
755756

756757
def verification_send(properties = {}, opts = {})
757758
api_key = opts[:api_key] || @api_key
758-
version = opts[:version] || @version
759+
version = opts[:verification_version] || @verification_version
759760
timeout = opts[:timeout] || @timeout
760761

761762
raise("properties cannot be empty") if properties.empty?
@@ -767,14 +768,13 @@ def verification_send(properties = {}, opts = {})
767768
:headers => build_default_headers_post(api_key)
768769
}
769770
options.merge!(:timeout => timeout) unless timeout.nil?
770-
771771
response = self.class.post(Sift.verification_api_send_path(@version), options)
772772
Response.new(response.body, response.code, response.response)
773773
end
774774

775775
def verification_resend(properties = {}, opts = {})
776776
api_key = opts[:api_key] || @api_key
777-
version = opts[:version] || @version
777+
version = opts[:verification_version] || @verification_version
778778
timeout = opts[:timeout] || @timeout
779779

780780
raise("properties cannot be empty") if properties.empty?
@@ -793,7 +793,7 @@ def verification_resend(properties = {}, opts = {})
793793

794794
def verification_check(properties = {}, opts = {})
795795
api_key = opts[:api_key] || @api_key
796-
version = opts[:version] || @version
796+
version = opts[:verification_version] || @verification_version
797797
timeout = opts[:timeout] || @timeout
798798

799799
raise("properties cannot be empty") if properties.empty?

lib/sift/version.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module Sift
2-
VERSION = "4.5.0"
2+
VERSION = "4.5.1"
33
API_VERSION = "205"
4+
VERIFICATION_API_VERSION = "1.1"
45
end

test_integration_app/verification_api/test_verification_api.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
class VerificationAPI
44

5-
@@client = Sift::Client.new(:api_key => ENV["API_KEY"], :version=>1.1)
5+
@@client = Sift::Client.new(:api_key => ENV["API_KEY"], :version => 1.1)
66

77
def send()
88
properties = {
99
"$user_id" => $user_id,
1010
"$send_to" => $user_email,
11-
"$verification_type" => "$email",
11+
"$verification_type" => "$email",
1212
"$brand_name" => "MyTopBrand",
1313
"$language" => "en",
1414
"$site_country" => "IN",
@@ -28,5 +28,5 @@ def send()
2828

2929
return @@client.verification_send(properties)
3030
end
31-
31+
3232
end

0 commit comments

Comments
 (0)