Skip to content

Commit

Permalink
breaking: change response types for invoices-authorize, invoices-capt…
Browse files Browse the repository at this point in the history
…ure, invoices-native-payment; breaking: create/update card; add invoice expiry; add invoice qr_code; add invoice delete; add project public metadata; add hosted payment page support (#20)

Co-authored-by: ProcessOut Fountain <[email protected]>
  • Loading branch information
1 parent 4e8ce65 commit 1b5b838
Show file tree
Hide file tree
Showing 11 changed files with 272 additions and 141 deletions.
9 changes: 9 additions & 0 deletions card_shipping.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ type CardShipping struct {
Zip *string `json:"zip,omitempty"`
// Phone is the shipping phone number
Phone *Phone `json:"phone,omitempty"`
// FirstName is the first name of the card shipping
FirstName *string `json:"first_name,omitempty"`
// LastName is the last name of the card shipping
LastName *string `json:"last_name,omitempty"`
// Email is the email of the card shipping
Email *string `json:"email,omitempty"`

client *ProcessOut
}
Expand Down Expand Up @@ -59,6 +65,9 @@ func (s *CardShipping) Prefill(c *CardShipping) *CardShipping {
s.CountryCode = c.CountryCode
s.Zip = c.Zip
s.Phone = c.Phone
s.FirstName = c.FirstName
s.LastName = c.LastName
s.Email = c.Email

return s
}
Expand Down
12 changes: 1 addition & 11 deletions card_update_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import (

// CardUpdateRequest represents the CardUpdateRequest API object
type CardUpdateRequest struct {
// UpdateType is the card update type. Possible values: "new-cvc2" or "other"
UpdateType *string `json:"update_type,omitempty"`
// UpdateReason is the card update reason.
UpdateReason *string `json:"update_reason,omitempty"`
// PreferredScheme is the customer preferred scheme, such as carte bancaire vs visa
// PreferredScheme is the customer preferred scheme, such as carte bancaire vs visa. Can be set to none to clear the previous value
PreferredScheme *string `json:"preferred_scheme,omitempty"`

client *ProcessOut
Expand All @@ -41,8 +37,6 @@ func (s *CardUpdateRequest) Prefill(c *CardUpdateRequest) *CardUpdateRequest {
return s
}

s.UpdateType = c.UpdateType
s.UpdateReason = c.UpdateReason
s.PreferredScheme = c.PreferredScheme

return s
Expand Down Expand Up @@ -83,13 +77,9 @@ func (s CardUpdateRequest) Update(cardID string, options ...CardUpdateRequestUpd

data := struct {
*Options
UpdateType interface{} `json:"update_type"`
UpdateReason interface{} `json:"update_reason"`
PreferredScheme interface{} `json:"preferred_scheme"`
}{
Options: opt.Options,
UpdateType: s.UpdateType,
UpdateReason: s.UpdateReason,
PreferredScheme: s.PreferredScheme,
}

Expand Down
Loading

0 comments on commit 1b5b838

Please sign in to comment.