Skip to content

Commit

Permalink
Make TOS send epoch time for Date.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewangeta authored and Andrew Edwards committed Jan 7, 2019
1 parent f7bc7aa commit 04fd3db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Sources/Stripe/API/Routes/AccountRoutes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,15 @@ public struct StripeConnectAccountRoutes: AccountRoutes {
}

if let tos = tosAcceptance {
try tos.toEncodedDictionary().forEach { body["tos_acceptance[\($0)]"] = $1 }
if let tosDate = tos.date {
body["tos_acceptance[date]"] = Int(tosDate.timeIntervalSince1970)
}
if let tosIp = tos.ip {
body["tos_acceptance[ip]"] = tosIp
}
if let tosUserAgent = tos.userAgent {
body["tos_acceptance[user_agent]"] = tosUserAgent
}
}

return try request.send(method: .POST, path: StripeAPIEndpoint.account.endpoint, body: body.queryParameters)
Expand Down
2 changes: 0 additions & 2 deletions Sources/Stripe/Errors/StripeError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,3 @@ public enum StripeDeclineCode: String, StripeModel {
case tryAgainLater = "try_again_later"
case withdrawalCountLimitExceeded = "withdrawal_count_limit_exceeded"
}


0 comments on commit 04fd3db

Please sign in to comment.