Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Order type fields #6

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 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 string `json:"order_options,omitempty"`
}

OrderRequest struct {
Expand Down Expand Up @@ -127,7 +131,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 +157,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