Module: GeoCerts

Defined in:
lib/geo_certs.rb,
lib/geo_certs/csr.rb,
lib/geo_certs/api.rb,
lib/geo_certs/email.rb,
lib/geo_certs/order.rb,
lib/geo_certs/event.rb,
lib/geo_certs/hello.rb,
lib/geo_certs/errors.rb,
lib/geo_certs/product.rb,
lib/geo_certs/version.rb,
lib/geo_certs/reseller.rb,
lib/geo_certs/agreement.rb,
lib/geo_certs/api_object.rb,
lib/geo_certs/collection.rb,
lib/geo_certs/exceptions.rb,
lib/geo_certs/certificate.rb,
lib/geo_certs/fraud_score.rb,
lib/geo_certs/order/contact.rb,
lib/geo_certs/endpoints/hello.rb,
lib/geo_certs/endpoints/orders.rb,
lib/geo_certs/endpoints/events.rb,
lib/geo_certs/order/organization.rb,
lib/geo_certs/endpoints/products.rb,
lib/geo_certs/endpoints/resellers.rb,
lib/geo_certs/order/administrator.rb,
lib/geo_certs/endpoints/agreements.rb,
lib/geo_certs/parsers/order_parser.rb,
lib/geo_certs/endpoints/fraud_scores.rb,
lib/geo_certs/endpoints/certificates.rb,
lib/geo_certs/order/renewal_information.rb,
lib/geo_certs/order/extended_validation_approver.rb

Overview

To properly configure the GeoCerts library, you must provide your partner ID and api token:

GeoCerts.partner_id = 'ex4Mpl3'
GeoCerts.api_token  = 'abc123DEF456gHi...'

After that, most interaction is performed through other objects within the library, such as GeoCerts::Order, GeoCerts::Certificate, GeoCerts::CSR, etc.

Defined Under Namespace

Modules: Endpoints, Parsers Classes: API, Agreement, AllowableExceptionWithResponse, ApiObject, BadRequest, CSR, Certificate, Collection, ConnectionError, Email, Error, Event, Exception, ExceptionWithResponse, FraudScore, Hello, MessageWithCode, Order, Product, RequestFailed, RequestTimeout, Reseller, ResourceInvalid, ResourceNotCreated, ResourceNotFound, ServerError, Unauthorized, UnprocessableEntity, Warning

Constant Summary

VERSION =
'1.0.0'
HTTP_ERRORS =
[ Timeout::Error,
Errno::EINVAL,
Errno::ECONNRESET,
Errno::ECONNREFUSED,
EOFError,
Net::HTTPBadResponse,
Net::HTTPHeaderSyntaxError,
Net::ProtocolError ]

Class Method Summary (collapse)

Class Method Details

+ (Object) api

:nodoc:



32
33
34
35
36
37
38
39
# File 'lib/geo_certs.rb', line 32

def self.api # :nodoc:
  @api = API.new({
    :version      => 1,
    :host         => host
  }, {
    :credentials  => [partner_id, api_token]
  })
end

+ (Object) api_token



16
17
18
# File 'lib/geo_certs.rb', line 16

def self.api_token
  @api_token
end

+ (Object) api_token=(token)



20
21
22
# File 'lib/geo_certs.rb', line 20

def self.api_token=(token)
  @api_token = token
end

+ (Object) escape(value)

:nodoc:



41
42
43
# File 'lib/geo_certs.rb', line 41

def self.escape(value) # :nodoc:
  value ? CGI.escape(value.to_s) : nil
end

+ (Object) host



61
62
63
64
65
66
67
68
69
70
# File 'lib/geo_certs.rb', line 61

def self.host
  case
  when @_host
    @_host
  when sandbox?
    'https://sandbox.geocerts.com'
  else
    'https://www.geocerts.com'
  end
end

+ (Object) host=(value)

:nodoc:



57
58
59
# File 'lib/geo_certs.rb', line 57

def self.host=(value) #:nodoc:
  @_host = value
end

+ (Object) partner_id



24
25
26
# File 'lib/geo_certs.rb', line 24

def self.partner_id
  @partner_id
end

+ (Object) partner_id=(partner_id)



28
29
30
# File 'lib/geo_certs.rb', line 28

def self.partner_id=(partner_id)
  @partner_id = partner_id
end

+ (Object) sandbox



53
54
55
# File 'lib/geo_certs.rb', line 53

def self.sandbox
  @sandbox
end

+ (Object) sandbox=(value)



45
46
47
# File 'lib/geo_certs.rb', line 45

def self.sandbox=(value)
  @sandbox = value
end

+ (Boolean) sandbox?

Returns:

  • (Boolean)


49
50
51
# File 'lib/geo_certs.rb', line 49

def self.sandbox?
  @sandbox
end