Scala library for interaction with SmartyStreets REST API.
Add following to your build.sbt
libraryDependencies += "org.upstartcommerce" %% "smartystreets-scala-sdk" % "1.0.0" // or whatever latest version is
Basic usage is:
import org.upstartcommerce.smartystreets.SmartyStreetsIntegration
import org.upstartcommerce.smartystreets.common._
class MyAddressVerificationService extends SmartyStreetsIntegration {
override val smartyStreetsConfig = SmartyStreetsConfig(
authId = "myAuthId",
authToken = "myAuthToken"
)
}
object Main {
def main(args: Array[String]): Unit = {
val service = new MyAddressVerificationService
val address = USAddressRequest(
street = Some("60 Wall St"),
city = Some("New York"),
state = Some("NY"),
zipcode = Some("10005")
)
service.verifyAddress(address).map { resp =>
println(resp) // Process response
}
}
}Note: Implicit
ActorSystem,ActorMaterializerandExecutionContextare required
See tests for more examples.