Skip to content

Commit

Permalink
Merge pull request #69 from AppSci/release/1.0.2
Browse files Browse the repository at this point in the history
update decoded payment status
  • Loading branch information
yehorkyrylov authored Oct 21, 2022
2 parents 5b2984a + de15aeb commit 7d40ad0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/PandaSDK/SubsriptionStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ public struct SubscriptionInfo: Codable {
self.price = try container.decodeIfPresent(Double.self, forKey: .price)
self.state = try container.decode(SubscriptionAPIStatus.self, forKey: .state)
self.paymentType = try container.decodeIfPresent(PaymentType.self, forKey: .paymentType) ?? .unknown
self.paymentStatus = try container.decodeIfPresent(PaymentStatus.self, forKey: .paymentStatus) ?? .unknown

if let decodedString = try container.decodeIfPresent(String.self, forKey: .paymentStatus) {
self.paymentStatus = PaymentStatus(rawValue: decodedString) ?? .unknown
} else {
self.paymentStatus = .unknown
}
}
}

Expand Down

0 comments on commit 7d40ad0

Please sign in to comment.