Client for www.e-clearing.net written in Scala
This library only supports OCHP 1.2. Newer versions of OCHP will be supported in ochp-client.
-
Open Clearing House Protocol v1.2 generated client and bean classes with help of cxf
-
API trait to communicate with the clearing house:
trait EclearingApi { def recvAllTokens(): List[ChargeToken] def sendAllTokens(tokens: List[ChargeToken]): Result[ChargeToken] def recvNewTokens(lastUpdate: DateTime): List[ChargeToken] def sendNewTokens(tokens: List[ChargeToken]): Result[ChargeToken] def sendAllChargePoints(chargePoints: List[ChargePoint]): Result[ChargePoint] def recvAllChargePoints():List[ChargePoint] def sendNewChargePoints(chargePoints: List[ChargePoint]): Result[ChargePoint] def recvNewChargePoints(lastUpdate: DateTime):List[ChargePoint] def sendCdrs(cdrs: List[CDR]): Result[CDR] def recvCdrs(): List[CDR] def confCdrs(approvedCdrs: List[CDR], declinedCdrs: List[CDR]) }
-
Service trait that can be instantiated like here:
val service = new OchpService { val conf = OchpConfig( wsUri = "http://localhost:8088/mockeCHS-OCHP_1.2", user = "me", password = "mypass" ) val client = OchpClient.createCxfClient(conf) }
-
Add this repository to your pom.xml:
<repository> <id>thenewmotion</id> <name>The New Motion Repository</name> <url>http://nexus.thenewmotion.com/content/groups/public"</url> </repository>
-
Add dependency to your pom.xml:
<dependency> <groupId>com.thenewmotion</groupId> <artifactId>ochp-client-1.2_2.11</artifactId> <version>1.20</version> </dependency>
-
Add the following resolver:
resolvers += "TNM" at "http://nexus.thenewmotion.com/content/groups/public"
-
Add the following dependency:
"com.thenewmotion" %% "ochp-client-1.2" % "1.20",