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

Fix issues with Issuing spending limits #1007

Merged
merged 1 commit into from
Jan 4, 2020
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
26 changes: 16 additions & 10 deletions issuing_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,18 @@ type IssuingAuthorizationControlsSpendingLimitsParams struct {
}

// AuthorizationControlsParams is the set of parameters that can be used for the shipping parameter.
// TODO: Rename and "un-share" between Card and Cardholder in the next major version.
type AuthorizationControlsParams struct {
AllowedCategories []*string `form:"allowed_categories"`
BlockedCategories []*string `form:"blocked_categories"`
MaxApprovals *int64 `form:"max_approvals"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turns out this is not deprecated.

SpendingLimits []*IssuingAuthorizationControlsSpendingLimitsParams `form:"spending_limits"`

// The following parameters are considered deprecated and only apply to issuing cards
MaxAmount *int64 `form:"max_amount"`
MaxApprovals *int64 `form:"max_approvals"`
// The following parameter only applies to Cardholder
SpendingLimitsCurrency *string `form:"spending_limits_currency"`

// The following parameter is considered deprecated
MaxAmount *int64 `form:"max_amount"`
}

// IssuingCardShippingParams is the set of parameters that can be used for the shipping parameter.
Expand Down Expand Up @@ -155,16 +159,18 @@ type IssuingAuthorizationControlsSpendingLimits struct {
}

// IssuingCardAuthorizationControls is the resource representing authorization controls on an issuing card.
// TODO: Rename to IssuingAuthorizationControls in the next major
// TODO: Add the Cardholder version to "un-share" between Card and Cardholder in the next major version.
type IssuingCardAuthorizationControls struct {
AllowedCategories []string `json:"allowed_categories"`
BlockedCategories []string `json:"blocked_categories"`
SpendingLimits []*IssuingAuthorizationControlsSpendingLimits `json:"spending_limits"`
AllowedCategories []string `json:"allowed_categories"`
BlockedCategories []string `json:"blocked_categories"`
MaxApprovals int64 `json:"max_approvals"`
SpendingLimits []*IssuingAuthorizationControlsSpendingLimits `json:"spending_limits"`
SpendingLimitsCurrency Currency `json:"spending_limits_currency"`

// The properties below are considered deprecated and can only be used for an issuing card.
Currency Currency `json:"currency"`
MaxAmount int64 `json:"max_amount"`
MaxApprovals int64 `json:"max_approvals"`
// TODO remove in the next major version
Currency Currency `json:"currency"`
MaxAmount int64 `json:"max_amount"`
}

// IssuingCardPIN contains data about the Card's PIN.
Expand Down