У меня есть приложение iOS, которое использует API Quickbooks для добавления клиентов в таблицу Customer в QB. Каждый раз, когда я пытаюсь добавить клиента, я получаю следующую ошибку:
"Email Address does not conform to the syntax rules of RFC 822. Supplied value:Optional(\"\\mrad@test.com\\\")","code":"2210","element":"PrimaryEmailAddr"}],"type":"ValidationFault"},"time":"2020-04-03T04:44:23.174-07:00"},"intuit_tid":"1-5e872b0a-7f5bb1ee5417f09c63ea8d0e"}
Код, который я использую для добавления клиента:
let qbParams = [
"billingFullName" : billingNameTextField.text!,
"email" : "mrad@test",
"billingLastName" : "Mike",
"billingFirstName" : "Smith",
"phoneNumber" : phoneNumber!,
"billingCity" : billingCityTextField.text!,
"billingState" : billingStateTextField.text!,
"billingZip" : billingZipTextField.text!,
"billingAddressOne" : billingAddressOneTextField.text!,
"billingAddressTwo" : billingAddressTwoTextField.text!,
"ccNum" : ccNumberTextField.text!,
"ccExpMonth" : ccExpMonth,
"ccExpYear" : ccExpYear,
"ccCVC" : ccCVVTextField.text!,
"addressOne" : addressOne,
"addressTwo" : addressTwo,
"city": city!,
"state": state!,
"zip": zip!
]
let manager = Alamofire.SessionManager.default
manager.session.configuration.timeoutIntervalForRequest = 5
manager.request("\(baseURL)/api/qb-signup", method: .post, parameters:
qbParams as Parameters).responseString {
response in
if response.result.isSuccess {
let registerJSON : JSON = JSON(response.result.value!)
print(registerJSON)
}
else {
print("API Call not Successful")
print(response)
}
}
Как видите, Я жестко закодировал адрес электронной почты для целей теста. Я также попробовал это сделать, поставив апострофы вокруг теста, и получил тот же результат:
"Email Address does not conform to the syntax rules of RFC 822. Supplied value:Optional(\"\\'mrad@test.com\\'\")","code":"2210","element":"PrimaryEmailAddr"}],"type":"ValidationFault"},"time":"2020-04-03T05:24:42.174-07:00"},"intuit_tid":"1-5e872b0a-7f5bb1ee5417f09c63ea8d0e"}
Мне кажется, что адрес электронной почты действителен. Мысли?