Skip to content

Commit cfd60f2

Browse files
committed
stripe checkout session url
1 parent b99a75c commit cfd60f2

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

pub/stripe-servant/src/Stripe/Resources.hs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ data CheckoutSession = CheckoutSession
249249
csSuccessUrl :: T.Text,
250250
csPaymentMethodTypes :: V.Vector T.Text, -- TODO: make enum
251251
csSubscription :: Maybe SubscriptionId,
252-
csAllowPromotionCodes :: Maybe Bool
252+
csAllowPromotionCodes :: Maybe Bool,
253+
csUrl :: T.Text
253254
}
254255
deriving (Show, Eq)
255256

@@ -321,7 +322,9 @@ instance ToForm PriceCreate where
321322
Nothing -> []
322323
Just x ->
323324
[ ("recurring[interval]", [prcInterval x]),
324-
("recurring[interval_count]", maybeToList $ fmap toUrlPiece $ prcIntervalCount x)
325+
( "recurring[interval_count]",
326+
maybeToList $ fmap toUrlPiece $ prcIntervalCount x
327+
)
325328
]
326329
in Form $
327330
HM.fromList $
@@ -337,7 +340,9 @@ instance ToForm SubscriptionCreate where
337340
toForm sc =
338341
let convertItem (idx, itm) =
339342
[ ("items[" <> toUrlPiece idx <> "][price]", [toUrlPiece $ sciPrice itm]),
340-
("items[" <> toUrlPiece idx <> "][quantity]", maybeToList $ toUrlPiece <$> sciQuantity itm)
343+
( "items[" <> toUrlPiece idx <> "][quantity]",
344+
maybeToList $ toUrlPiece <$> sciQuantity itm
345+
)
341346
]
342347
lineItems =
343348
concatMap convertItem (zip ([0 ..] :: [Int]) (scItems sc))
@@ -353,7 +358,9 @@ instance ToForm CheckoutSessionCreate where
353358
toForm csc =
354359
let convertItem (idx, itm) =
355360
[ ("line_items[" <> toUrlPiece idx <> "][price]", [toUrlPiece $ cscliPrice itm]),
356-
("line_items[" <> toUrlPiece idx <> "][quantity]", [toUrlPiece $ cscliQuantity itm])
361+
( "line_items[" <> toUrlPiece idx <> "][quantity]",
362+
[toUrlPiece $ cscliQuantity itm]
363+
)
357364
]
358365
lineItems =
359366
concatMap convertItem (zip ([0 ..] :: [Int]) (cscLineItems csc))
@@ -370,7 +377,9 @@ instance ToForm CheckoutSessionCreate where
370377
("mode", [cscMode csc]),
371378
("client_reference_id", maybeToList $ cscClientReferenceId csc),
372379
("customer", maybeToList $ fmap toUrlPiece $ cscCustomer csc),
373-
("allow_promotion_codes", maybeToList $ toUrlPiece <$> cscAllowPromotionCodes csc)
380+
( "allow_promotion_codes",
381+
maybeToList $ toUrlPiece <$> cscAllowPromotionCodes csc
382+
)
374383
]
375384
<> lineItems
376385
<> pmt

0 commit comments

Comments
 (0)