WebSphere brand IBM WebSphere Telecom Web Services Server, Version 7.1

Payment interface

Several operations are available for the Payment interface using the REST API. All of these operations are based on the Parlay X 2.1 standard.

Note: In the following examples, replace path with the following URL:
  • For REST: http://hostName:port/PaymentService/services/REST
  • For JSON: http://hostName:port/PaymentService/services/JSON

JSON requests, only HTTP POST is supported.

For JSON requests, the field names need to match exactly with the Parlay X 2.1 specifications. The JSON implementation does not supply any default values to the fields.

chargeAmount via POST

Used for charging an amount to an end user's account.

Sample REST request
POST path/chargeAmount?version=1.0&endUserId=tel:+447990123456&currency=GBP &amount=1 & referenceCode=ABC & description=Some billing information
HTTP/1.1 Host: www.example.com
Sample REST response
HTTP Status: 204 No content.
Sample JSON request
POST http://localhost:9080/PaymentService/services/JSON/chargeAmount
{"endUser Identifier":"tel"+447990123456",
"charge":{
"description":"Some billing information",
"currency":"GBP",
"amount": 1000,
"code":"ABC-123"
},
"referenceCode":"ABC"
}
Sample JSON response
HTTP/1.1 200 OK
{}
Note: Either currency and either amount or code must be specified. If both are missing, then an SVC00007 - Invalid charging information message is issued.

refundAmount via POST

Used for refunding an amount to an end user's account

Sample REST request
POST path/refundAmount?version=1.0 & sendUserId=tel:+44790123456&
currency=GBP &amount=1 & referenceCode=ABC&
description= Some billing information
HTTP/1.1 Host: www.example.com
Sample REST response
HTTP Status: 204 No content.
Sample JSON request
POST http://localhost:9080/PaymentService/services/JSON/refundAmount
{
"endUserIdentifier":"tel:+447990123456",
"charge":{
"description":"Some billing information",
"currency":"GBP",
"amount":1000,
"code":"123-ABC"
},
"
referencecode":"ABC"
}
Sample JSON response
HTTP/1.1 200 OK
{}

reserveAmount via POST

Used for reserving a charge for an end user's account.

Sample REST request
POST path/reserveAmount?version=1.0 &endUserId=tel:+447990123456&
currency=GBP & amount=10&
description= some billing information
HTTP/1.1 Host: www.example.com
Sample REST response
<ReserveResponse version=”1.0” reservationId=”1234”/>
Sample JSON request
POST http://localhost:9080/PaymentService/services/JSON/reserveAmount
{
"endUserIdentifier":"tel:+447990123456",
"charge":{
"description":"Some billing information",
currency":"GBP",
"amount":1000,
"code":"123-ABC"
}
}
Sample JSON response
HTTP/1.1 200 OK
{"result":"1234"}

chargeReservation via POST

Used for charging to a previously made reservation.

Sample REST request
POST path/chargeReservation?reserve=1234&version=1.0&
currency=GBP &amount=6&referenceCode=ABC&description=Some billinginformation
HTTP/1.1 Host:www.example.com
Sample REST response
HTTP Status: 204 No Content.
Sample JSON request
POST http://localhost:9080/PaymentService/services/JSON/chargeReservation
{
"reservationIdentifier":"1234",
"charge": {
"description":"Some billing information",
"currency":"GBP",
"amount": 1000,
"code": "123-ABC"
},
"referenceCode": "ABC"
}
Sample JSON response
HTTP/1.1 200 OK

releaseReservation via DELETE

Used for releasing funds left in a previously made reservation to the account from which the reservation was made.

Sample REST request
DELETE path/releaseReservation?reserve=1234&version=0
HTTP/1.1 Host: www.example.com
Sample REST response
HTTP Status: 204 No Content.
Sample JSON request
POST http://localhost:9080/PaymentService/services/JSON/releaseReservation
{"reservationIdentifier":"123-ABC"
}
Sample JSON response
HTTP/1.1 200 OK
{}



Terms of use
(C) Copyright IBM Corporation 2009. All Rights Reserved.