Skip to content

Commit

Permalink
Remove body for client token
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewc committed Feb 16, 2024
1 parent d4a1843 commit f734a0a
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ class PrimerDataService: NSObject {
typealias ErrorsDelegate = PrimerDataServiceErrorsDelegate
typealias ModelsDelegate = PrimerDataServiceModelsDelegate

struct ClientTokenRequestModel: Encodable {
let currencyCode: String
let amount: Int
}

struct ClientTokenModel: Decodable {
let clientToken: String
}
Expand Down Expand Up @@ -64,8 +59,6 @@ class PrimerDataService: NSObject {
func fetchClientToken(from url: String) async throws -> String {
do {
var request = URLRequest(url: URL(string: "\(url)/client-session")!)
request.httpBody = try JSONEncoder().encode(ClientTokenRequestModel(currencyCode: "GBP", amount: 4999))
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"

let (data, _) = try await URLSession.shared.data(for: request)
Expand Down

0 comments on commit f734a0a

Please sign in to comment.