Skip to content

Commit

Permalink
Merge pull request #60 from vapor-community/source-fix
Browse files Browse the repository at this point in the history
Another property that is indeed optional from the API.
  • Loading branch information
Andrewangeta authored Aug 26, 2018
2 parents d509288 + 347fb89 commit 225e23e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Stripe/Models/Sources/Source.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public struct StripeSource: StripeModel {
public var amount: Int?
public var clientSecret: String?
public var codeVerification: CodeVerification?
public var created: Date
public var created: Date?
public var currency: StripeCurrency?
public var flow: Flow
public var livemode: Bool
Expand Down Expand Up @@ -52,7 +52,7 @@ public struct StripeSource: StripeModel {
amount = try container.decodeIfPresent(Int.self, forKey: .amount)
clientSecret = try container.decodeIfPresent(String.self, forKey: .clientSecret)
codeVerification = try container.decodeIfPresent(CodeVerification.self, forKey: .codeVerification)
created = try container.decode(Date.self, forKey: .created)
created = try container.decodeIfPresent(Date.self, forKey: .created)
currency = try container.decodeIfPresent(StripeCurrency.self, forKey: .currency)
flow = try container.decode(Flow.self, forKey: .flow)
livemode = try container.decode(Bool.self, forKey: .livemode)
Expand Down

0 comments on commit 225e23e

Please sign in to comment.