Skip to content

Commit

Permalink
Merge pull request #86 from vapor-community/connect
Browse files Browse the repository at this point in the history
Make TOS send epoch time for Date.
  • Loading branch information
anthonycastelli authored Jan 7, 2019
2 parents 802a264 + 04fd3db commit 5c0fe29
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 5c0fe29

Please sign in to comment.