Skip to content

Commit

Permalink
better handle subscribing with a gifted sub
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Oct 25, 2024
1 parent aafd43a commit 43d3aa2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions HabitRPG/Utilities/PurchaseHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class PurchaseHandler: NSObject, SKPaymentTransactionObserver {
}
} else if self.isSubscription(productIdentifier) {
if !user.isSubscribed || user.purchased?.subscriptionPlan?.dateCreated == nil ||
user.purchased?.subscriptionPlan?.isGifted == true ||
(user.purchased?.subscriptionPlan?.customerId == transaction.original?.transactionIdentifier
&& transaction.original?.transactionIdentifier != transaction.transactionIdentifier
&& PurchaseHandler.habiticaSubMapping[transaction.payment.productIdentifier] != user.purchased?.subscriptionPlan?.planId) {
Expand Down

0 comments on commit 43d3aa2

Please sign in to comment.