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

charge schedule #49

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions operations/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,21 @@ type CreateChargeSchedule struct {
WeekdayOfMonth string

Customer string
Amount int
Amount int64
Currency string
Card string
Description string
Metadata map[string]interface{}
}

func (req *CreateChargeSchedule) MarshalJSON() ([]byte, error) {
type charge struct {
Customer string `json:"customer"`
Amount int `json:"amount"`
Amount int64 `json:"amount"`
Currency string `json:"currency,omitempty"`
Card string `json:"card,omitempty"`
Description string `json:"description,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type on struct {
Expand Down Expand Up @@ -82,6 +84,7 @@ func (req *CreateChargeSchedule) MarshalJSON() ([]byte, error) {
Currency: req.Currency,
Card: req.Card,
Description: req.Description,
Metadata: req.Metadata,
},
}

Expand Down
11 changes: 6 additions & 5 deletions schedule/charge_detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package schedule

// ChargeDetail represents charge detail for schedule object.
type ChargeDetail struct {
Amount int `json:"amount"`
Currency string `json:"currency"`
Customer string `json:"customer"`
Card *string `json:"card"`
Description string `json:"description"`
Amount int `json:"amount"`
Currency string `json:"currency"`
Customer string `json:"customer"`
Card *string `json:"card"`
Description string `json:"description"`
Metadata map[string]interface{} `json:"metadata"`
}