Skip to content

Commit 9983d5b

Browse files
authored
Merge pull request lichess-org#14412 from kraktus/suspended_paypal
Paypal: consider SUSPENDED subscription status as cancelled
2 parents f0b5748 + 0f6690f commit 9983d5b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/plan/src/main/PayPalClient.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ final private class PayPalClient(
116116

117117
def getSubscription(id: PayPalSubscriptionId): Fu[Option[PayPalSubscription]] =
118118
getOne[PayPalSubscription](s"${path.subscriptions}/$id") recover {
119-
case CantParseException(json, _) if json.str("status").has("CANCELLED") => none
119+
case CantParseException(json, _)
120+
if json.str("status").exists(status => status == "CANCELLED" || status == "SUSPENDED") =>
121+
none
120122
}
121123

122124
def getEvent(id: PayPalEventId): Fu[Option[PayPalEvent]] =

0 commit comments

Comments
 (0)