public class PurchaseOrder extends Object implements OperationResult
This class contains the transactional data which is returned to your Java-based client application by the connected SAP CC system. The transactional data results from the processing of the charging operation requests (event-based, session-based, batch).
Depending on the options of the charging operation request, the purchase order may include:
rated transactions computed by the SAP CC system.charging results containing details about the charging operation.
The purchase order may include notifications related to user alerts generated
during the charging process.
Depending on the options of the charging operation request, these notifications may be located in:
rated transactioncharging resultNote
Allowances do not generate transactions and are not available in charging results.
However, notifications generated by allowances are available in other transactions:
transaction related to the logic which triggered the allowance event.
master transaction related to the logic which created the allowance.
Notifications generated by allowances are always available using the notification framework.
StatefulServiceClient,
AsyncStatefulServiceClient,
BatchServiceClient,
AsyncBatchServiceClientThe XML APIs specify the following XSD fragment:
XSD Fragment
<xs:simpleType name="OrderState">
<xs:restriction base="xs:string">
<xs:enumeration value="paid"/>
<xs:enumeration value="free"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="order">
<xs:complexType>
<xs:sequence>
<xs:element ref="transac" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="chargingResult" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="status" type="OrderState"/>
<xs:attribute name="amount" type="xs:string"/>
<xs:attribute name="snapshotId" type="xs:int"/>
</xs:complexType>
</xs:element>
| Modifier and Type | Field and Description |
|---|---|
static int |
FREE
Indicates that the purchase is free for the customer.
|
static int |
NO_SNAPSHOT_ID
Constant used when no snapshot identifier is available during event rating.
|
static int |
PAID
Indicates that the purchase is already paid.
|
| Constructor and Description |
|---|
PurchaseOrder()
Builds an empty purchase order
|
PurchaseOrder(int state,
Money amount,
AbstractList<ChargingResult> chargingResults)
Builds a purchase order with a state, an amount and a list of
charged transaction sets. |
PurchaseOrder(int state,
Money amount,
int snapshotId)
Builds a purchase order with a state, an amount and a snapshot identifier
|
PurchaseOrder(int state,
Money amount,
int snapshotId,
AbstractList<ChargingResult> chargingResults)
Builds a purchase order with a state, an amount, a snapshot identifier and a list of
charging results. |
PurchaseOrder(int state,
Money amount,
int snapshotId,
Vector<Transaction> transactions)
Builds a purchase order with a state, an amount, a snapshot identifier and a list of
rated transactions dynamically priced by the SAP CC system |
PurchaseOrder(int state,
Money amount,
Vector<Transaction> transactions)
Builds a purchase order with a state, an amount and a list of
rated transactions dynamically priced by the SAP CC system |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
Money |
getAmount()
Returns the total amount of the purchase order.
|
int |
getChargedSnapshotId()
Gets the snapshot identifier used to rate event.
|
List<ChargingResult> |
getChargingResults()
Gets the list of charging results included in the purchase order.
|
String |
getOperandReference()
Gets the code or the reference (if no code exists) that identifies the operand of the operation request;
If the operation is not auditable, the operand reference is
null. |
int |
getState() |
Vector<Transaction> |
getTransactions()
Gets the list of returned transactions.
|
AbstractList<Transaction> |
getUnsynchronizedTransactions()
Gets the list of returned transactions.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAmount(Money price)
Sets the amount of the purchase order.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setChargedSnapshotId(int snapshotId)
Sets the snapshot identifier used to rate event.
|
void |
setState(int s)
Sets the state.
|
public static final int PAID
public static final int FREE
public static final int NO_SNAPSHOT_ID
public PurchaseOrder()
public PurchaseOrder(int state,
Money amount,
int snapshotId)
state - The state of the purchase orderamount - The total amount of the ordersnapshotId - The snapshot identifier used to rate the eventpublic PurchaseOrder(int state,
Money amount,
Vector<Transaction> transactions)
rated transactions dynamically priced by the SAP CC systemstate - The state of the purchase orderamount - The total amount of the ordertransactions - The rated transactions computed by the rating processpublic PurchaseOrder(int state,
Money amount,
int snapshotId,
Vector<Transaction> transactions)
rated transactions dynamically priced by the SAP CC systemstate - The state of the purchase orderamount - The total amount of the ordersnapshotId - The snapshot identifier used to rate the eventtransactions - The rated transactions computed by the rating processpublic PurchaseOrder(int state,
Money amount,
AbstractList<ChargingResult> chargingResults)
charged transaction sets.state - the state of the purchase orderamount - the total amount of the orderchargingResults - the charging results computed by the charging processpublic PurchaseOrder(int state,
Money amount,
int snapshotId,
AbstractList<ChargingResult> chargingResults)
charging results.state - the state of the purchase orderamount - the total amount of the ordersnapshotId - the snapshot identifier used to rate the eventchargingResults - the charging results computed by the charging processpublic String getOperandReference()
OperationResultnull.getOperandReference in interface OperationResultpublic void setState(int s)
public Money getAmount()
public void setAmount(Money price)
price - the amount of the purchase order.public int getChargedSnapshotId()
public void setChargedSnapshotId(int snapshotId)
snapshotId - the snapshot identifier that uses format YYYYMMDDpublic Vector<Transaction> getTransactions()
transactionpublic AbstractList<Transaction> getUnsynchronizedTransactions()
transactionpublic List<ChargingResult> getChargingResults()
This method returns a not-empty list only when called on the result of the method
BatchServiceClient.charge(ChargeableItem, String, String, java.util.Date, String, ChargeExecutionContext).
charging resultspublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into