Skip to content

Commit

Permalink
Update Order type fields
Browse files Browse the repository at this point in the history
  • Loading branch information
findmyname666 committed Feb 12, 2025
1 parent 6ac4930 commit dd6bc23
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/x509"
"encoding/json"
"errors"
"io/ioutil"
"io"
"net/http"
"time"
)
Expand Down Expand Up @@ -63,6 +63,7 @@ type (
Certificate Certificate `json:"certificate,omitempty"`
Organization *Organization `json:"organization,omitempty"`
OrderValidity OrderValidity `json:"order_validity,omitempty"`
ValidityYears int `json:"validity_years,omitempty"`
CustomExpirationDate string `json:"custom_expiration_date,omitempty"`
Comments string `json:"comments,omitempty"`
ProcessorComment string `json:"processor_comment,omitempty"`
Expand All @@ -82,6 +83,9 @@ type (
CertificateID int `json:"certificate_id,omitempty"`
CertificateChain []CertificateChain `json:"certificate_chain,omitempty"`
Container *Container `json:"container,omitempty"`
DateCreated time.Time `json:"date_created,omitempty"`
Status string `json:"status,omitempty"`
OrderOptions OrderOptions `json:"order_options,omitempty"`
}

OrderRequest struct {
Expand All @@ -96,6 +100,11 @@ type (
Years int `json:"years,omitempty"`
Days int `json:"days,omitempty"`
}

OrderOptions struct {
DefaultNameScope string `json:"default_name_scope"`
CertificateDcvScope string `json:"certificate_dcv_scope"`
}
)

func (o Order) DecodeCertificateChain() ([]*x509.Certificate, error) {
Expand Down Expand Up @@ -127,7 +136,7 @@ func (c *Client) SubmitOrder(order Order, orderType OrderType) (*Order, error) {
}
defer res.Body.Close()

body, err = ioutil.ReadAll(res.Body)
body, err = io.ReadAll(res.Body)
if err != nil {
return nil, err
}
Expand All @@ -153,7 +162,7 @@ func (c *Client) GetOrder(orderID string) (*Order, error) {
}
defer res.Body.Close()

resBody, err := ioutil.ReadAll(res.Body)
resBody, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit dd6bc23

Please sign in to comment.