Skip to content

Commit

Permalink
Add promotion_code to Discount (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkonidas authored Dec 11, 2020
1 parent be0bbaa commit b0436ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/stripe/subscriptions/discount.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ defmodule Stripe.Discount do
deleted: boolean | nil,
end: Stripe.timestamp() | nil,
start: Stripe.timestamp(),
subscription: Stripe.id() | nil
subscription: Stripe.id() | nil,
promotion_code: Stripe.id() | nil
}

defstruct [
Expand All @@ -24,6 +25,7 @@ defmodule Stripe.Discount do
:deleted,
:end,
:start,
:subscription
:subscription,
:promotion_code
]
end
3 changes: 2 additions & 1 deletion test/fixtures/discount.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"customer": "cus_DCUJlLSyrGaqab",
"end": 1595517288,
"start": 1532358888,
"subscription": "sub_DG9Uq9WOevR9Uo"
"subscription": "sub_DG9Uq9WOevR9Uo",
"promotion_code": "promo_1HuRNuKKEsQW5O8UAfIZ33ox"
}
3 changes: 2 additions & 1 deletion test/stripe/converter_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ defmodule Stripe.ConverterTest do
end: 1_595_517_288,
object: "discount",
start: 1_532_358_888,
subscription: "sub_DG9Uq9WOevR9Uo"
subscription: "sub_DG9Uq9WOevR9Uo",
promotion_code: "promo_1HuRNuKKEsQW5O8UAfIZ33ox"
}

fixture = Helper.load_fixture("discount.json")
Expand Down

0 comments on commit b0436ad

Please sign in to comment.