Skip to content

Commit

Permalink
Merge pull request #131 from adityaokke/fee-rule-invoice
Browse files Browse the repository at this point in the history
fix(invoice): add WithFeeRule option on invoice
  • Loading branch information
sekaranglila authored Jul 3, 2023
2 parents fadf519 + e78e4a0 commit 8a3d6f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions invoice/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func (c *Client) CreateWithContext(ctx context.Context, data *CreateParams) (*xe
if data.ForUserID != "" {
header.Add("for-user-id", data.ForUserID)
}
if data.WithFeeRule != "" {
header.Add("with-fee-rule", data.WithFeeRule)
}

err := c.APIRequester.Call(
ctx,
Expand Down
1 change: 1 addition & 0 deletions invoice/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
// CreateParams contains parameters for Create
type CreateParams struct {
ForUserID string `json:"-"`
WithFeeRule string `json:"-"` // Note: response header fee_rule_id is not implemented yet
ExternalID string `json:"external_id" validate:"required"`
Amount float64 `json:"amount" validate:"required"`
Description string `json:"description,omitempty"`
Expand Down

0 comments on commit 8a3d6f2

Please sign in to comment.