This chapter describes the SOA service request and response if custom Purchase Pre-Requisites Provider for an external system is used.
Note: This description works with a Service Request Type in XML format |
Formatting a Request
In the path field insert the path the service: e.g. http://xxx.caleaccess.com/Cwo2OngoingPurchaseService.Tests/SOAPTestService.svc
In the Post Format field insert a request like the example below:
<tem:ProcessPurchasePreRequisitesOnline xmlns:tem="http://tempuri.org/" xmlns:cwo2="http://schemas.datacontract.org/2004/07/Cwo2OngoingPurchaseService.Tests">
<tem:purchasePreRequisitesRequest>
<cwo2:Article>{3}</cwo2:Article>
<cwo2:CarReg>{0}</cwo2:CarReg>
<cwo2:DeviceID>{5}</cwo2:DeviceID>
<cwo2:IdMsg>{4}</cwo2:IdMsg>
<cwo2:IdentifierType>{1}</cwo2:IdentifierType>
<cwo2:PaymentDate>{6}</cwo2:PaymentDate>
<cwo2:PaymentServiceId>{2}</cwo2:PaymentServiceId>
</tem:purchasePreRequisitesRequest>
</tem:ProcessPurchasePreRequisitesOnline>
Dynamic variables that can be used in the Post Format for an Purchase Pre Requisites Provider:
Variable {n} |
Variable Name |
Description |
Data Type |
WebOffice Version |
---|---|---|---|---|
0 |
PreRequisites Identifier |
Predefined payment reference, license plate, booking code etc. |
String |
1* |
1 |
PreRequisites Identifier Type |
Specifies the content type of used identifier, 1 = Text 2 = Card Serial Number 3 = Hashed Pan
|
Int |
1* |
2 |
Payment Service ID |
|
Int |
|
3 |
ArticleID |
Article used in this purchase |
Int |
|
4 |
GUID Message Identifier |
|
Guid |
|
5 |
Terminal ID |
Terminal name |
String |
|
6 |
Payment Date UTC |
When request was received in WebOffice Format: yyyy-MM-ddTHH:mm:ss |
dateTime |
|
7 |
Start Date UTC |
Starting date for purchase payment time. Example parking time starting point (after initial free time) in UTC Format: yyyy-MM-ddTHH:mm:ss |
dateTime |
|
8 |
End Date UTC |
End date for the purchase, example parking time ending point in UTC Format: yyyy-MM-ddTHH:mm:ss |
dateTime |
|
9 |
Parking Zone Name |
Name for the parking zone used in this purchase. |
String |
|
10 |
Parking Zone Number |
Number for the parking zone used in this purchase. |
Int |
|
11 |
Parking ID |
Parking ID in WebOffice |
Int |
|
12 |
Code |
Predefined payment reference, license plate, booking code etc. |
String |
2* |
13 |
Card Serial Number |
Specifies Hashed Pan |
String |
2* |
14 |
Hashed PAN |
Specifies Card Serial Number |
String |
2* |
15 |
Login Authorization Token |
Specifies Login Authorization Token |
String |
2* |
* The WebOffice version used depends on the data sent in by the CWT.
When sending the request WebOffice will insert the request in a SOAP envelope like done below.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tem:ProcessPurchasePreRequisitesOnline xmlns:tem="http://tempuri.org/">
<tem:purchasePreRequisitesRequest>
<tem:Article>10002</tem:Article>
<tem:CarReg>FXTRF</tem:CarReg>
<tem:DeviceID>ylva10</tem:DeviceID>
<tem:IdMsg>bf979e1a-0d4c-4682-8bfd-5d31f587dd3a</tem:IdMsg>
<tem:IdentifierType>1</tem:IdentifierType>
<tem:PaymentDate>2015-09-15T13:27:59</tem:PaymentDate>
<tem:PaymentServiceId>1</tem:PaymentServiceId>
</tem:purchasePreRequisitesRequest>
</tem:ProcessPurchasePreRequisitesOnline>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Formatting the response
Requirements of the response.
1.Must contain a tag with name OngoingPurchaseResponse.
2.The tag OngoingPurchaseResponse must have a child tag with the name Purchase with an attribute ExternalID if the fields Response Node XPath, Response External ID Attribute, and Response External Description Attribute in form Ongoing purchase provider details are empty. Otherwise these parameters can be used for defining where to find the external id and description in the response message,
Example
<s:Body xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<ProcessPurchasePreRequisitesOnlineResponse xmlns="http://tempuri.org/">
<ProcessPurchasePreRequisitesOnlineResult xmlns:a="http://schemas.datacontract.org/2004/07/Cwo2OngoingPurchaseService.Tests" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:ExternalReference>ExternalReference</a:ExternalReference>
<a:IdMsg>bf979e1a-0d4c-4682-8bfd-5d31f587dd3a </a:IdMsg>
<a:ParkingEnd i:nil="true" /><a:ParkingStart i:nil="true" />
<a:RateAmount i:nil="true" />
<a:RateId>15000</a:RateId>
<a:ResultCode>1</a:ResultCode>
<a:ResultDescription>FixedTariff</a:ResultDescription>
</ProcessPurchasePreRequisitesOnlineResult>
</ProcessPurchasePreRequisitesOnlineResponse>
</s:Body>
Description of variables in response from ongoing purchase provider.
Number |
Attribute Name |
Description |
Data Type |
---|---|---|---|
0 |
ExternalID |
Unique message identifier will not be sent to terminal.
|
guid |
1 |
ExternalDescription |
Description (Optional). Will be sent to terminal. |
nvarchar(255) |
2 |
ResultCode |
Result code from third party. Result code can be set to one of following values: 1 = ValidIdentifierPurchaseAllowed 2 = ValidIdentifierPurchaseNotAllowed 3 = UnknownIdentifier 4 = IdentifierExpired Will be sent to terminal. |
int |
3 |
RateId |
Identifies witch tariff package to be used for current pre requisites identifier *1). Will be sent to terminal. RateId or RateAmount must be returned. RateId is checked first. Note that if RateId is returned is must be greater than 15000. |
int |
4 |
RateAmount |
Specifies the amount to pay for the current pre requisites identifier. RateId or RateAmount must be returned. RateId is checked first. Used for generation of tariff script sent to CWT *1). |
decimal |
5 |
StartDateUtc |
Specifies parking start date time. Format to be used 2016-04-27T07:00:00 (don’t add Z as postfix). Will be sent to terminal StartDateUtc is used together with EndDateUtc if RateId is not specified and RateAmount is specified. Used for generation of tariff scipt sent to CWT *1). |
DateTime |
6 |
EndDateUtc |
Specifies parking end date time. Used for generation of tariff scipt sent to CWT *1). Format to be used 2016-04-27T07:00:00 (don’t add Z as postfix). |
DateTime |
7 |
ExternalReference |
Third party reference |
string |
1) Example for tariff scripts sent to CWT:
Nr |
Attributes returned from Third Part |
TSC script |
---|---|---|
1 |
RateId |
TSC script according to tariff package id defined in RateId. |
2 |
RateAmount |
"PACKAGE \"@ExtTariffDynamicAmount\"; max ticks = {0}; min ticks = {0}; INTERVAL \"Always\"; timepredicate = #always; tariffrate = unit {0} per {1};";
Description for above script {0}=tick value for the terminal. {1}=1 |
3 |
RateAmount, StartDateUtc, EndDateUtc |
"PACKAGE \"@ExtTariffDynamicAmount\"; max ticks = {0}; min ticks = {0}; INTERVAL \"Always\"; timepredicate = #always; tariffrate = unit {0} per {1};";
Description for above script {0}=tick value for the terminal. {1}=duration in minutes (EndDateUtc- StartDateUtc) |