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: caa9e4f6902d4de2aac79931b4defab776b00dd83adc8d3aa3f74939474fce64
4
- data.tar.gz: a46e141473aec0fbe94c8e44570ffa1b4ed3e1fc10e52594795248ece4b4440c
3
+ metadata.gz: 26a561b0a86a449d4ab75f8f0705bdc10a0b6c62f35545ce088d2708aee26236
4
+ data.tar.gz: 56ce891e98ef0f5304ada858170834b467087cee347318786ca345f85bbce1b3
5
5
  SHA512:
6
- metadata.gz: ba5cabbf2947d157fbb3d5fadb8ffeb55e89bb5052e7506b81d63409036834e48f1d736a0081ab6ef3fec267258d586711b278d4beefe28aa9944de2496b2ca6
7
- data.tar.gz: a32e969511454e5364c5f6167e1edaadd01d8715316dbd03353e3738aae89aa147d056111c7b686073b0cfe31b240772879daa7c941901d604da0d12be9252b1
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
- truthy?(fetch_value("Result")) ||
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AliyunIntelligentCaptcha
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyun_intelligent_captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ming