Class: GlobalSign::OrderGetterByOrderId::Response

Inherits:
Response
  • Object
show all
Defined in:
lib/global_sign/order_getter_by_order_id/response.rb

Defined Under Namespace

Modules: XPath

Constant Summary

Constants inherited from Response

Response::SUCCESS_CODE, Response::WARNING_CODE

Instance Method Summary collapse

Methods inherited from Response

#error?, #error_code, #error_field, #error_message, #initialize, #success?, #warning?, #xpath_errors, #xpath_result

Constructor Details

This class inherits a constructor from GlobalSign::Response

Instance Method Details

#order_status_textObject



48
49
50
# File 'lib/global_sign/order_getter_by_order_id/response.rb', line 48

def order_status_text
  OrderStatus::STATUS_MAPPING[params[:order_status]]
end

#paramsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/global_sign/order_getter_by_order_id/response.rb', line 20

def params
  return @params if @params
  _params = {
    order_id:            @xml.xpath(XPath::ORDER_ID).text,
    order_status:        @xml.xpath(XPath::ORDER_STATUS).text,
    modification_events: modification_events_list
  }

  # options
  _params[:certificate_info] = {
    certificate_status: certificate_info.at('CertificateStatus').text,
    common_name:        certificate_info.at('CommonName').text,
    start_date:         certificate_info.at('StartDate').try(:text),
    end_date:           certificate_info.at('EndDate').try(:text),
    subject_name:       certificate_info.at('SubjectName').try(:text),
  } if certificate_info.text.present?

  _params[:fulfillment] = {
    ca_certificates: ca_certificates_list,
    server_certificate: {
      x509_cert:  server_certificate.at('X509Cert').text,
      pkcs7_cert: server_certificate.at('PKCS7Cert').text,
    }
  } if fulfillment.text.present?

  @params = _params
end

#response_headerObject



16
17
18
# File 'lib/global_sign/order_getter_by_order_id/response.rb', line 16

def response_header
  :OrderResponseHeader
end