xolphin-api 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ea86464949998e7872f71f61ef5b469c35dfb068cec1ac3e21adb8fdfed6d94
4
- data.tar.gz: b343eac1cdfd1560dbd838a380c81a83ad2ea224f225480f23a7cc95ce7a41f7
3
+ metadata.gz: 0b37e70b0b2c0f01661f2a47efffaeec51c13c537df04934e463fadc2551a45d
4
+ data.tar.gz: a90dc771d67d2a0f0dbdc7f265b6c86ff20ef80cf1416aee823fe7f06dde6af8
5
5
  SHA512:
6
- metadata.gz: 7a8cddc0663d80351cd355641961950f7921ca0e130552d29436665b8f9f2f223d996cb16f5a50b5f69d86ac585a8e238b507241f2cdc7cbdcd7a9abd56fa0f0
7
- data.tar.gz: '06923d52ba80d5a18019acf3f62e716bc34d0875ab2c6b3ba43650969c211cf428fca678d9fc351768d0e4519d4a2763401a3b817e1674737fb80372507bf029'
6
+ metadata.gz: d1bd2ac569ee9d8a7739b26eebf19b71a33dad0860798869fba44bb4faadfd0e01aad58f8f6a56efa07e493762738f34963cf2b0a1c3e3520d07897265b9fd41
7
+ data.tar.gz: cee4ebd929af45ac28d6c45d59ff9450defebc51842ff7cb200fd93287f4dd6052e9c6ca591b63bca64a5b5c2f3a89dbbe0658210975e20cdacaaf587723574f
@@ -0,0 +1,40 @@
1
+ require_relative "../lib/xolphin/api"
2
+ require_relative "_credentials.rb"
3
+
4
+ client = Xolphin::Api::Client.new(Credentials.username, Credentials.password, true)
5
+ csr = "-----BEGIN CERTIFICATE REQUEST-----
6
+ MIICuDCCAaACADB0MQswCQYDVQQGEwJOTDEWMBQGA1UEAxMNd3d3LnNzbGRldi5u
7
+ bDEWMBQGA1UEBxMNSGVlcmh1Z293YWFyZDEQMA4GA1UEChMHWG9scGhpbjEWMBQG
8
+ A1UECBMNTm9vcmQtSG9sbGFuZDELMAkGA1UECxMCSVQwggEiMA0GCSqGSIb3DQEB
9
+ AQUAA4IBDwAwggEKAoIBAQDkTFMNKhWObiUH1xDeRcqYiROKvJZEI7njDlQbXeVC
10
+ qSaBSBClJD98OSgE0+arnVyJ5Fnjkovgb9aC8HbWYbiD1tbWD+hKC1wPODEvknl7
11
+ jfRpO36cIglIhftHn5p0k+f86uS2Nz1yr+5qwAEQ7C0UQZxMuBbzK6Uv8m0TbAVV
12
+ CQ+i+uJfuXSsAT8LZbyoJsu50ZySG3uEhCSISh1cS/t/M2INHbXfzGA3GWH2FXCZ
13
+ Qd9eLSBAVEanIr3TlRpNU3f0IDwJpm56BVTNtNL7GI2NilfUF9oSo9PSlPbAkPsN
14
+ BrVdOiZgiOEO74rXE8fjA5Zm8uic6MyFRo4FuTUBWubrAgMBAAGgADANBgkqhkiG
15
+ 9w0BAQsFAAOCAQEAHuB6643oI7oPw5SbFQAcfTfQbyRTXNqwYOO8YRcCkDIu7aX9
16
+ pupGvf+cSa5IDcZ6Dz22/Khp5rYlcutAtEN7d8MNBwBlcVzbWL+DuTU5ZWAxcRi4
17
+ nmiw/C+RxFF+WsUcjwb+dNrTYkz03t7voMg/0NS7RRU/oTu8heDDcH+Ffam1bZJQ
18
+ zi21dz/AsjG9Jc6GJqZs0ImEwCQlBhJYnXPj3FB8U/mzSWSfq502fdtmQrvIgHmI
19
+ RLuxVO9QX0YLQ0ew1x2z+eFfBsfSI1+DkF4+5TrfJP6jQyHBR+VDdGYBO2d8rBw7
20
+ ITIJC9tt2F4GjaPAI1xY9eoq/QfZxzNoNufMuw==
21
+ -----END CERTIFICATE REQUEST-----"
22
+ request = client.request.create(145, 1, csr, 'EMAIL')
23
+
24
+
25
+ request.approver_first_name = "OldFirstName"
26
+ request.approver_last_name = "OldLastName"
27
+ request.approver_phone = "Old+1234567890"
28
+ request.approver_representative_first_name = "FirstName"
29
+ request.approver_representative_last_name = "LastName"
30
+ request.approver_representative_phone = "+1234567890"
31
+ request.approver_representative_position = "CEO"
32
+ request.approver_representative_email = 'approver@emailaddress.com'
33
+ request.approver_email = "email@domain.com"
34
+ request.approver_representative_email = "email@domain.com"
35
+ request.address = "Exmouth House, 3 Pine St, London Ec1R 0Jh"
36
+ request.zipcode = "Ec1R 0Jh"
37
+ request.subject_alternative_names = ["test1.domain.com", "test2.domain.com"]
38
+ request.dcv_type = "FILE"
39
+ response = client.request.send(request)
40
+ puts response.inspect
@@ -0,0 +1,6 @@
1
+ require_relative "../lib/xolphin/api"
2
+ require_relative "_credentials.rb"
3
+
4
+ client = Xolphin::Api::Client.new(Credentials.username, Credentials.password, false)
5
+ result = client.request.get(963437363)
6
+ puts result.inspect
@@ -1,5 +1,6 @@
1
1
  require_relative "../lib/xolphin/api"
2
+ require_relative "_credentials.rb"
2
3
 
3
4
  client = Xolphin::Api::Client.new(Credentials.username, Credentials.password, true)
4
- result = client.request.scheduleValidationCall(960_002_992, "2017-05-01 13:00")
5
+ result = client.request.scheduleValidationCall(963437377, "2024-01-01 13:00", {action: "ScheduledCallback"})
5
6
  puts result.inspect
@@ -1,6 +1,7 @@
1
1
  require_relative "../lib/xolphin/api"
2
+ require_relative "_credentials"
2
3
 
3
- client = Xolphin::Api::Client.new(Credentials.username, Credentials.password, true)
4
+ client = Xolphin::Api::Client.new(Credentials.username, Credentials.password, false)
4
5
  requests = client.request.all
5
6
  requests.each do |request|
6
7
  puts request.id, request.product.id
@@ -7,7 +7,8 @@ module Xolphin
7
7
  attr_accessor :csr, :dcv_type, :subject_alternative_names, :dcv
8
8
  attr_accessor :company, :department, :address, :zipcode, :city, :kvk, :reference
9
9
  attr_accessor :approver_first_name, :approver_last_name, :approver_email, :approver_phone
10
-
10
+ attr_accessor :approver_representative_first_name, :approver_representative_last_name, :approver_representative_email, :approver_representative_phone, :approver_representative_position
11
+
11
12
  def initialize(csr, dcv_type)
12
13
  @csr = csr
13
14
  @dcv_type = dcv_type
@@ -30,7 +31,13 @@ module Xolphin
30
31
  "approverFirstName" => @approver_first_name,
31
32
  "approverLastName" => @approver_last_name,
32
33
  "approverEmail" => @approver_email,
33
- "approverPhone" => @approver_phone
34
+ "approverPhone" => @approver_phone,
35
+ # new validation variables
36
+ "approverRepresentativeFirstName" => @approver_representative_first_name,
37
+ "approverRepresentativeLastName" => @approver_representative_last_name,
38
+ "approverRepresentativeEmail" => @approver_representative_email,
39
+ "approverRepresentativePhone" => @approver_representative_phone,
40
+ "approverRepresentativePosition" => @approver_representative_position,
34
41
  }.reject { |_key, value| value.nil? })
35
42
 
36
43
  if @subject_alternative_names
@@ -7,6 +7,7 @@ module Xolphin
7
7
  attr_accessor :product, :years, :csr, :dcv_type, :subject_alternative_names, :dcv
8
8
  attr_accessor :company, :department, :address, :zipcode, :city, :kvk, :reference
9
9
  attr_accessor :approver_first_name, :approver_last_name, :approver_email, :approver_phone
10
+ attr_accessor :approver_representative_first_name, :approver_representative_last_name, :approver_representative_email, :approver_representative_phone, :approver_representative_position
10
11
 
11
12
  def initialize(product, years, csr, dcv_type)
12
13
  @product = product
@@ -34,7 +35,13 @@ module Xolphin
34
35
  "approverFirstName" => @approver_first_name,
35
36
  "approverLastName" => @approver_last_name,
36
37
  "approverEmail" => @approver_email,
37
- "approverPhone" => @approver_phone
38
+ "approverPhone" => @approver_phone,
39
+ # new validation variables
40
+ "approverRepresentativeFirstName" => @approver_representative_first_name,
41
+ "approverRepresentativeLastName" => @approver_representative_last_name,
42
+ "approverRepresentativeEmail" => @approver_representative_email,
43
+ "approverRepresentativePhone" => @approver_representative_phone,
44
+ "approverRepresentativePosition" => @approver_representative_position,
38
45
  }.reject { |_key, value| value.nil? })
39
46
 
40
47
  if @subject_alternative_names
@@ -7,6 +7,7 @@ module Xolphin
7
7
  attr_accessor :product, :years, :csr, :dcv_type, :subject_alternative_names, :dcv, :language
8
8
  attr_accessor :company, :department, :address, :zipcode, :city, :kvk, :reference, :referenceOrderNr
9
9
  attr_accessor :approver_first_name, :approver_last_name, :approver_email, :approver_phone
10
+ attr_accessor :approver_representative_first_name, :approver_representative_last_name, :approver_representative_email, :approver_representative_phone, :approver_representative_position
10
11
 
11
12
  def initialize(product, years, csr, dcv_type)
12
13
  @product = product
@@ -35,6 +36,11 @@ module Xolphin
35
36
  "approverLastName" => @approver_last_name,
36
37
  "approverEmail" => @approver_email,
37
38
  "approverPhone" => @approver_phone,
39
+ "approverRepresentativeFirstName" => @approver_representative_first_name,
40
+ "approverRepresentativeLastName" => @approver_representative_last_name,
41
+ "approverRepresentativeEmail" => @approver_representative_email,
42
+ "approverRepresentativePhone" => @approver_representative_phone,
43
+ "approverRepresentativePosition" => @approver_representative_position,
38
44
  "language" => @language,
39
45
  "referenceOrderNr" => @referenceOrderNr
40
46
  }.reject { |_key, value| value.nil? })
@@ -3,9 +3,24 @@ require 'time'
3
3
  module Xolphin
4
4
  module Api
5
5
  module Endpoint
6
+ class RequestDeprecate
7
+ extend Gem::Deprecate
8
+
9
+ def initialize(http)
10
+ @http = http
11
+ end
12
+
13
+ def _send()
14
+ end
15
+
16
+ deprecate :_send, 'The [approverFirstName, approverLastName, approverPhone] fields are deprecated please use [approverRepresentativeFirstName, approverRepresentativeLastName, approverRepresentativePhone].', 2023, 11
17
+ end
18
+
6
19
  class Request
20
+
7
21
  def initialize(http)
8
22
  @http = http
23
+ @deprecated = RequestDeprecate.new(@http)
9
24
  end
10
25
 
11
26
  def all
@@ -39,8 +54,15 @@ module Xolphin
39
54
  end
40
55
 
41
56
  def send(request)
42
- result = @http.post("/requests", request.to_param)
57
+ requestParams = request.to_param
58
+ deprecatedFields = ["approverFirstName", "approverLastName", "approverPhone"]
59
+
60
+ if deprecatedFields.any? { |element| requestParams.include?(element) }
61
+ @deprecated._send()
62
+ end
43
63
 
64
+ result = @http.post("/requests", requestParams)
65
+
44
66
  Xolphin::Api::Responses::Request.new(result)
45
67
  end
46
68
 
@@ -63,6 +85,15 @@ module Xolphin
63
85
 
64
86
  Xolphin::Api::Responses::Notes.new(result)
65
87
  end
88
+
89
+ def scheduleValidationCall(id, date_time, extra = nil)
90
+ t = Time.parse(date_time)
91
+ params = { 'date' => t.strftime("%Y-%m-%d"), 'time' => t.strftime("%H:%M") }
92
+
93
+ params.merge!(extra) if extra.is_a?(Hash)
94
+
95
+ @http.post("requests/#{id}/schedule-validation-call", params)
96
+ end
66
97
 
67
98
  def sendComodoSAEmail(id, to, language = nil)
68
99
  @http.post("requests/#{id}/sa", 'sa_email' => to, 'language' => language)
@@ -72,11 +103,6 @@ module Xolphin
72
103
  @http.post("requests/#{id}/upload-document", 'document' => document, 'description' => description)
73
104
  end
74
105
 
75
- def scheduleValidationCall(id, date_time)
76
- t = Time.parse(date_time)
77
- @http.post("requests/#{id}/schedule-validation-call", 'date' => t.strftime("%Y-%m-%d"), 'time' => t.strftime("%H:%M"))
78
- end
79
-
80
106
  def retryDCV(id, domain, dcv_type, email = nil)
81
107
  @http.post("requests/#{id}/retry-dcv", "domain" => domain, "dcvType" => dcv_type, "email" => email)
82
108
  end
@@ -18,8 +18,9 @@ module Xolphin
18
18
  def get(path, params = {})
19
19
  uri = URI.parse(File.join(api_url, path))
20
20
  uri.query = URI.encode_www_form(params) unless params.empty?
21
+ pkgver = Xolphin::Api::VERSION
21
22
 
22
- request = Net::HTTP::Get.new(uri)
23
+ request = Net::HTTP::Get.new(uri, {'User-Agent' => "xolphin-api-ruby/#{pkgver}"})
23
24
  request.basic_auth(@username, @password)
24
25
 
25
26
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
@@ -31,8 +32,9 @@ module Xolphin
31
32
 
32
33
  def post(path, params = {})
33
34
  uri = URI.parse(File.join(api_url, path))
35
+ pkgver = Xolphin::Api::VERSION
34
36
 
35
- request = Net::HTTP::Post.new(uri)
37
+ request = Net::HTTP::Post.new(uri, {'User-Agent' => "xolphin-api-ruby/#{pkgver}"})
36
38
  request.basic_auth(@username, @password)
37
39
  request.set_form_data(params)
38
40
 
@@ -46,8 +48,9 @@ module Xolphin
46
48
  def download(path, params = {})
47
49
  uri = URI.parse(File.join(api_url, path))
48
50
  uri.query = URI.encode_www_form(params) unless params.empty?
51
+ pkgver = Xolphin::Api::VERSION
49
52
 
50
- request = Net::HTTP::Get.new(uri)
53
+ request = Net::HTTP::Get.new(uri, {'User-Agent' => "xolphin-api-ruby/#{pkgver}"})
51
54
  request.basic_auth(@username, @password)
52
55
 
53
56
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
@@ -11,6 +11,10 @@ module Xolphin
11
11
  def id
12
12
  @data["id"]
13
13
  end
14
+
15
+ def order_number
16
+ @data["orderNumber"]
17
+ end
14
18
 
15
19
  def domain_name
16
20
  @data["domainName"]
@@ -75,7 +79,26 @@ module Xolphin
75
79
  def approver_phone
76
80
  @data["approverPhone"]
77
81
  end
82
+ def approver_representative_first_name
83
+ @data["approverRepresentativeFirstName"]
84
+ end
78
85
 
86
+ def approver_representative_last_name
87
+ @data["approverRepresentativeLastName"]
88
+ end
89
+
90
+ def approver_representative_email
91
+ @data["approverRepresentativeEmail"]
92
+ end
93
+
94
+ def approver_representative_phone
95
+ @data["approverRepresentativePhone"]
96
+ end
97
+
98
+ def approver_position
99
+ @data["approverRepresentativePosition"]
100
+ end
101
+
79
102
  def postbox
80
103
  @data["postbox"]
81
104
  end
@@ -1,5 +1,5 @@
1
1
  module Xolphin
2
2
  module Api
3
- VERSION = "1.8.0".freeze
3
+ VERSION = "1.9.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xolphin-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xolphin
@@ -78,7 +78,9 @@ files:
78
78
  - examples/certificate_renew.rb
79
79
  - examples/get_notes.rb
80
80
  - examples/invoices_get.rb
81
+ - examples/request_create.rb
81
82
  - examples/request_create_ee.rb
83
+ - examples/request_get_id.rb
82
84
  - examples/request_validation_call.rb
83
85
  - examples/requests_get.rb
84
86
  - examples/send_csa_email.rb