Skip to content

Commit

Permalink
Fixing LineItems to be LineItemList on Checkout Session
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed May 14, 2020
1 parent 314a64e commit 62f6844
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions checkout/session/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestCheckoutSessionGet(t *testing.T) {
}

func TestCheckoutSessionNew(t *testing.T) {
session, err := New(&stripe.CheckoutSessionParams{
params := &stripe.CheckoutSessionParams{
CancelURL: stripe.String("https://stripe.com/cancel"),
ClientReferenceID: stripe.String("1234"),
LineItems: []*stripe.CheckoutSessionLineItemParams{
Expand Down Expand Up @@ -61,9 +61,12 @@ func TestCheckoutSessionNew(t *testing.T) {
},
},
SuccessURL: stripe.String("https://stripe.com/success"),
})
}
params.AddExpand("line_items")
session, err := New(params)
assert.Nil(t, err)
assert.NotNil(t, session)
assert.Equal(t, session.LineItems.Data[0].Object, "items")
}

func TestCheckoutSessionList(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ type CheckoutSession struct {
Deleted bool `json:"deleted"`
DisplayItems []*CheckoutSessionDisplayItem `json:"display_items"`
ID string `json:"id"`
LineItems []*LineItem `json:"line_items"`
LineItems *LineItemList `json:"line_items"`
Livemode bool `json:"livemode"`
Locale string `json:"locale"`
Metadata map[string]string `json:"metadata"`
Expand Down

0 comments on commit 62f6844

Please sign in to comment.