Skip to content

Commit

Permalink
Filter subscriptionless invoices (#682)
Browse files Browse the repository at this point in the history
* Filter subscriptionless invoices

* Fix logic
  • Loading branch information
stephencelis committed Oct 9, 2020
1 parent 9e0db8a commit 28c34e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Models/Episodes/0119-ParsersRecap.swift
Expand Up @@ -5,7 +5,7 @@ extension Episode {
blurb: """
It's time to revisit one of our favorite topics: parsing! We want to discuss lots of new parsing topics, such as generalized parsing, performance, reversible parsing and more, but before all of that we will start with a recap of what we have covered previously, and make a few improvements along the way.
""",
codeSampleDirectory: "0119-parsers-recap-pt-1",
codeSampleDirectory: "0119-parsers-recap-pt1",
exercises: _exercises,
fullVideo: nil,
id: 119,
Expand Down
2 changes: 1 addition & 1 deletion Sources/PointFree/StripeWebhooks.swift
Expand Up @@ -23,7 +23,7 @@ let stripeWebhookMiddleware
private let filterInvalidInvoices
: MT<Event<Either<Invoice, Stripe.Subscription>>, Event<Either<Invoice, Stripe.Subscription>>>
= filter(
{ $0.data.object.either({ $0.number != nil }, const(true)) },
{ extraSubscriptionId(fromEvent: $0) == nil || $0.data.object.either({ $0.number != nil }, const(true)) },
or: writeStatus(.ok) >=> respond(text: "OK")
)

Expand Down

0 comments on commit 28c34e3

Please sign in to comment.