fraudlabspro_ruby 3.2.1 → 4.0.0

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: c39b62485c4d279227a862995de30a27026f2afc326518b39bdb2b038a6a6102
4
- data.tar.gz: f00a218900ca763e2ed71df4aa3633097bf1ad72f0627dc55c90dc9dc97e8464
3
+ metadata.gz: 0ea78ccb89debc549cee9658464a8196697d8db7759cba308c0c46ba1ada412c
4
+ data.tar.gz: 97b0a290bc3da3b2c230b79efe9218e38b5d51706009eec6e76f4bf95d8d4ed1
5
5
  SHA512:
6
- metadata.gz: 77d775dce9da4c15ffdbb6beea005000efee5a436cfbbe333f276d75f3362868d0f002f90a606be6669f0d3eeb4c0b15ccba4eb7b7b972b06aa48e80afc21765
7
- data.tar.gz: 1009cef0466e73f615c4cfedf9920a0eb1cb0114baa2eae805aadf090d32bbe8b755f6a445387932802bd88b18327b069f095035f608b558bf241a7678dada0d
6
+ metadata.gz: 9c7648891d25bdc4f3ee2b72dc042f63c8f5d923ffdb95f81e99b9facd83e7f006c744f9e5e8437c6b5dbad075f80f5d5900333fdf16728854ccdc6df13cd996
7
+ data.tar.gz: 3268be5b12d9bf20a5ba37bf4ce85be076a32e9b3749c13793b85908917ace42bb57f8a5c36b20276bbb0494328bf04a16a6add623e0e6cdd49b739a0e2bf06e
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 FraudLabsPro.com
3
+ Copyright (c) 2024 FraudLabsPro.com
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -47,13 +47,13 @@ module FraudlabsproRuby
47
47
  params[:card_number] = params[:card_number][0..5]
48
48
  end
49
49
 
50
- uri = URI.parse("https://api.fraudlabspro.com/v1/order/screen")
50
+ uri = URI.parse("https://api.fraudlabspro.com/v2/order/screen")
51
51
  http = Net::HTTP.new(uri.host, uri.port)
52
52
  http.use_ssl = true
53
53
  request = Net::HTTP::Post.new(uri.request_uri)
54
54
  request.set_form_data({
55
55
  'key' => FraudlabsproRuby::Configuration.api_key,
56
- 'format' => params[:format] || 'json',
56
+ 'format' => 'json',
57
57
  'source' => 'sdk-ruby',
58
58
  'source_version' => FraudlabsproRuby::VERSION,
59
59
  'flp_checksum' => params[:flp_checksum] || '',
@@ -107,13 +107,13 @@ module FraudlabsproRuby
107
107
 
108
108
  # Sends feedback back to FraudLabs Pro.
109
109
  def self.feedback(params = {})
110
- uri = URI.parse("https://api.fraudlabspro.com/v1/order/feedback")
110
+ uri = URI.parse("https://api.fraudlabspro.com/v2/order/feedback")
111
111
  http = Net::HTTP.new(uri.host, uri.port)
112
112
  http.use_ssl = true
113
113
  request = Net::HTTP::Post.new(uri.request_uri)
114
114
  request.set_form_data({
115
115
  'key' => FraudlabsproRuby::Configuration.api_key,
116
- 'format' => params[:format] || 'xml',
116
+ 'format' => 'json',
117
117
  'id' => params[:transaction_id],
118
118
  'action' => params[:status] || '',
119
119
  'note' => params[:note] || ''
@@ -130,15 +130,11 @@ module FraudlabsproRuby
130
130
 
131
131
  # Gets transaction result.
132
132
  def self.getTransaction(params = {})
133
- if params[:format] == nil
134
- params[:format] = 'xml'
135
- end
136
-
137
133
  if params[:id_type] == nil
138
134
  params[:id_type] = ''
139
135
  end
140
136
 
141
- uri = URI.parse("https://api.fraudlabspro.com/v1/order/result?key=" + FraudlabsproRuby::Configuration.api_key + "&format=" + params[:format] + "&id=" + params[:transaction_id] + "&id_type=" + params[:id_type])
137
+ uri = URI.parse("https://api.fraudlabspro.com/v2/order/result?key=" + FraudlabsproRuby::Configuration.api_key + "&format=json&id=" + params[:transaction_id] + "&id_type=" + params[:id_type])
142
138
  http = Net::HTTP.new(uri.host, uri.port)
143
139
  http.use_ssl = true
144
140
  request = Net::HTTP::Get.new(uri.request_uri)
@@ -13,13 +13,13 @@ module FraudlabsproRuby
13
13
  params[:tel] = '+' + params[:tel]
14
14
  end
15
15
 
16
- uri = URI.parse("https://api.fraudlabspro.com/v1/verification/send")
16
+ uri = URI.parse("https://api.fraudlabspro.com/v2/verification/send")
17
17
  http = Net::HTTP.new(uri.host, uri.port)
18
18
  http.use_ssl = true
19
19
  request = Net::HTTP::Post.new(uri.request_uri)
20
20
  request.set_form_data({
21
21
  'key' => FraudlabsproRuby::Configuration.api_key,
22
- 'format' => params[:format] || 'json',
22
+ 'format' => 'json',
23
23
  'source' => 'sdk-ruby',
24
24
  'source_version' => FraudlabsproRuby::VERSION,
25
25
  'tel' => params[:tel],
@@ -39,11 +39,7 @@ module FraudlabsproRuby
39
39
 
40
40
  # Get Verification result.
41
41
  def self.verifySMS(params = {})
42
- if params[:format] == nil
43
- params[:format] = 'json'
44
- end
45
-
46
- uri = URI.parse("https://api.fraudlabspro.com/v1/verification/result?key=" + FraudlabsproRuby::Configuration.api_key + "&format=" + params[:format] + "&tran_id=" + params[:tran_id] + "&otp=" + params[:otp])
42
+ uri = URI.parse("https://api.fraudlabspro.com/v2/verification/result?key=" + FraudlabsproRuby::Configuration.api_key + "&format=json&tran_id=" + params[:tran_id] + "&otp=" + params[:otp])
47
43
  http = Net::HTTP.new(uri.host, uri.port)
48
44
  http.use_ssl = true
49
45
  request = Net::HTTP::Get.new(uri.request_uri)
@@ -1,3 +1,3 @@
1
1
  module FraudlabsproRuby
2
- VERSION = "3.2.1"
2
+ VERSION = "4.0.0"
3
3
  end
@@ -7,7 +7,7 @@ describe "FraudlabsproRuby" do
7
7
  ip: '8.8.8.8'
8
8
  )
9
9
  data = JSON.parse(result.body)
10
- expect(data['fraudlabspro_message']).to eq 'INVALID API KEY'
10
+ expect(data['error']['error_message']).to eq 'INVALID API KEY'
11
11
  end
12
12
 
13
13
  it "work correctly with Api Key exist" do
@@ -32,9 +32,9 @@ describe "FraudlabsproRuby" do
32
32
  )
33
33
  data = JSON.parse(result.body)
34
34
  if $test_api_key == 'YOUR_API_KEY'
35
- expect(data['fraudlabspro_id']).to eq 'NA'
35
+ expect(data['error']['error_message']).to eq 'INVALID API KEY'
36
36
  else
37
- expect(data['ip_country']).to eq 'US'
37
+ expect(data['ip_geolocation']['country_code']).to eq 'US'
38
38
  end
39
39
  end
40
40
 
@@ -45,7 +45,11 @@ describe "FraudlabsproRuby" do
45
45
  id_type: FraudlabsproRuby::Api::Order::FLP_ID
46
46
  )
47
47
  data = JSON.parse(result.body)
48
- expect(data['fraudlabspro_id']).to eq 'NA'
48
+ if $test_api_key == 'YOUR_API_KEY'
49
+ expect(data['error']['error_message']).to eq 'INVALID API KEY'
50
+ else
51
+ expect(data['error']['error_message']).to eq 'TRANSACTION NOT FOUND'
52
+ end
49
53
  end
50
54
 
51
55
  it "work correctly with validate order" do
@@ -56,9 +60,9 @@ describe "FraudlabsproRuby" do
56
60
  )
57
61
  data = JSON.parse(result.body)
58
62
  if $test_api_key == 'YOUR_API_KEY'
59
- expect(data['fraudlabspro_message']).to eq 'INVALID API KEY'
63
+ expect(data['error']['error_message']).to eq 'INVALID API KEY'
60
64
  else
61
- expect(data['fraudlabspro_message']).to eq 'INVALID TRANSACTION ID'
65
+ expect(data['error']['error_message']).to eq 'TRANSACTION NOT FOUND'
62
66
  end
63
67
  end
64
68
 
@@ -11,9 +11,9 @@ describe "FraudlabsproRuby" do
11
11
  )
12
12
  data = JSON.parse(result.body)
13
13
  if $test_api_key == 'YOUR_API_KEY'
14
- expect(data['error']).to eq 'API key not found.'
14
+ expect(data['error']['error_message']).to eq 'INVALID API KEY'
15
15
  else
16
- expect(data['error']).to eq 'Invalid phone number.'
16
+ expect(data['error']['error_message']).to eq 'INVALID PHONE NUMBER'
17
17
  end
18
18
  end
19
19
 
@@ -25,9 +25,9 @@ describe "FraudlabsproRuby" do
25
25
  )
26
26
  data = JSON.parse(result.body)
27
27
  if $test_api_key == 'YOUR_API_KEY'
28
- expect(data['error']).to eq 'API key not found.'
28
+ expect(data['error']['error_message']).to eq 'INVALID API KEY'
29
29
  else
30
- expect(data['error']).to eq 'Invalid OTP.'
30
+ expect(data['error']['error_message']).to eq 'INVALID OTP'
31
31
  end
32
32
  end
33
33
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fraudlabspro_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - fraudlabspro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-21 00:00:00.000000000 Z
11
+ date: 2024-01-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby SDK enables user to easily implement fraud detection feature into
14
14
  their solution using the API from www.fraudlabspro.com
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubygems_version: 3.3.7
57
+ rubygems_version: 3.4.22
58
58
  signing_key:
59
59
  specification_version: 4
60
60
  summary: FraudLabs Pro Ruby SDK