Skip to content

Commit

Permalink
update decoded payment status
Browse files Browse the repository at this point in the history
  • Loading branch information
YehorKyrylov committed Oct 21, 2022
1 parent 4793a7e commit de15aeb
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 de15aeb

Please sign in to comment.