aliyun_intelligent_captcha 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 26a561b0a86a449d4ab75f8f0705bdc10a0b6c62f35545ce088d2708aee26236
|
|
4
|
+
data.tar.gz: 56ce891e98ef0f5304ada858170834b467087cee347318786ca345f85bbce1b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68d4155f0b9ed5d8e56a0b95f1a0f704d6662c9f331ac35dfad9fd060cc0fdf8ff929086d717a55782bb662e3501abca41d98dd175d47a97ff9130a75b254dbf
|
|
7
|
+
data.tar.gz: c13e6bc3ee2f65d03982c91e3e390c659d2dd6e44cec4de1214117c9888df334d73c76c8d949711aabaa3089fdfef01e2be8b61b3aef5ea2113cfdd3ab1250c1
|
|
@@ -12,7 +12,7 @@ module AliyunIntelligentCaptcha
|
|
|
12
12
|
def passed?
|
|
13
13
|
truthy?(fetch_value("VerifyResult")) ||
|
|
14
14
|
truthy?(fetch_value("Passed")) ||
|
|
15
|
-
|
|
15
|
+
verify_result_from_result_hash? ||
|
|
16
16
|
success_code?
|
|
17
17
|
end
|
|
18
18
|
|
|
@@ -45,5 +45,12 @@ module AliyunIntelligentCaptcha
|
|
|
45
45
|
def truthy?(value)
|
|
46
46
|
value == true || value.to_s.casecmp("true").zero? || value.to_s == "1"
|
|
47
47
|
end
|
|
48
|
+
|
|
49
|
+
def verify_result_from_result_hash?
|
|
50
|
+
result = fetch_value("Result")
|
|
51
|
+
return false unless result.is_a?(Hash)
|
|
52
|
+
|
|
53
|
+
truthy?(result["VerifyResult"]) || (result["VerifyCode"] == "T001")
|
|
54
|
+
end
|
|
48
55
|
end
|
|
49
56
|
end
|