public class ForbiddenChargeException extends OperationFailureException implements IChargingResultHolderException
service access information, when agreement (contract, subscription) is not valid any longer,
when the price plan forbids charging, or when arguments are not correct.
Important Notes
This exception is specified in HCI but it is also available in the Message TCP technical interface. See the Exception and Error Handling section of this technical interface.
For example, if your client application requests a charging operation in real time,
the SAP CC system may reply this forbidden charge exception.
In an offline charging scenario, the SAP CC system
may include this exception in the BatchChargeException or RerateSubscriptionException as the cause.
The possible reasons are:
| Failure | Reason Code | Reason Code (HCI) | Customizing and Integration | Troubleshooting (Next Steps) |
|---|---|---|---|---|
No access information found
| 0 | noAccessFound
|
Note To design the exception and error handling functions (automated treatments, logging and manual treatments), see the Field Detail section in this topic. Refer to the information available in the Customizing subsection of each failure. |
Note For troubleshooting investigations, see the Field Detail section in this topic. Refer to the information available in the Next Steps subsection of each failure. |
Out of validity period
| 1 | outOfValidityPeriod
| ||
Not authorized
| 2 | notAuthorized
| ||
Illegal argument
| 3 | illegalArgument
| ||
Prerating not resolved yet
| 4 | preRatingNotResolvedYet
| ||
Incompatible currencies
| 5 | incompatibleCurrencies
| ||
Overrun cycle detected
| 6 | overrunCycleDetected
| ||
Cannot charge account
| 7 | cannotChargeAccount
| ||
Account blocked
| 8 | accountBlocked
| ||
Account locked
| 9 | accountLocked
| ||
Account closed
| 10 | accountClosed
| ||
Pending session not stopped yet
| 13 | pendingSessionNotStoppedYet
| ||
No subscription found
| 14 | noSubscriptionFound
| ||
Calculate tax error
| 15 | calculateTaxError
| ||
Invalid account (deprecated and now revoked)
| 16 | invalidAccount
| ||
Refill refused
| 17 | refillRefused
|
Consider the detailed information in the Field Detail section in this topic.
Depending on your business requirements, design and develop the handling functions in your client application.
Example
For example, you can implement the recording of the received exception in log entries in your client application or system. The administrator of this customized application (or system) can then investigate, perform some troubleshooting operations, and schedule an action plan to correct the potential anomaly.
ForbiddenChargingProcessException,
InvalidTaxException,
Serialized FormThe XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="forbiddenChargeFault">
<xs:complexType>
<xs:attribute name="error" type="ForbiddenChargeFaultErrorType"/>
<xs:attribute name="message" type="xs:string"/>
<xs:attribute name="reason" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="ForbiddenChargeFaultErrorType">
<xs:restriction base="xs:string">
<xs:enumeration value="noAccessFound"/>
<xs:enumeration value="outOfValidityPeriod"/>
<xs:enumeration value="notAuthorized"/>
<xs:enumeration value="illegalArgument"/>
<xs:enumeration value="preRatingNotResolvedYet"/>
<xs:enumeration value="incompatibleCurrencies"/>
<xs:enumeration value="overrunCycleDetected"/>
<xs:enumeration value="cannotChargeAccount"/>
<xs:enumeration value="accountBlocked"/>
<xs:enumeration value="accountLocked"/>
<xs:enumeration value="accountClosed"/>
<xs:enumeration value="pendingSessionNotStoppedYet"/>
<xs:enumeration value="noSubscriptionFound"/>
<xs:enumeration value="calculateTaxError"/>
<xs:enumeration value="invalidAccount"/> <!-- deprecated -->
<xs:enumeration value="refillRefused"/>
</xs:restriction>
</xs:simpleType>
| Modifier and Type | Field and Description |
|---|---|
static int |
ACCOUNT_BLOCKED
8: Error when the operation fails because the prepaid account is blocked.
|
static int |
ACCOUNT_CLOSED
10: Error when the operation fails because the prepaid account is closed.
|
static int |
ACCOUNT_LOCKED
9: Error when the operation fails because the
prepaid account is locked in the subscriber account. |
static int |
CALCULATE_TAX_ERROR
15: Error when tax calculation fails; Originated from an
InvalidTaxException. |
static int |
CANNOT_CHARGE_ACCOUNT
7: Error when the operation fails because the prepaid account or the credit limit balance
has an amount smaller than the amount to be charged.
|
static int |
ILLEGAL_ARGUMENT
3: Error when the operation is called with illegal arguments.
|
static int |
INCOMPATIBLE_CURRENCIES
5: Error when the operation fails because the transaction generated by the execution of the price plan
has a currency incompatible with the currency of the prepaid account or the credit limit balance to be charged.
|
static int |
INVALID_ACCOUNT
Deprecated.
Revoked: the value 16 and this field label (INVALID_ACCOUNT) are not used anymore.
|
static int |
NO_ACCESS_FOUND
0: Error when the user technical identifier (USID) provided in the chargeable item, for the specified service (SID),
does not correspond to an existing contract (or subscription) in customer master data owned by the service provider.
|
static int |
NO_SUBSCRIPTION_FOUND
14: Error when no subscription can be found for a chargeable item.
|
static int |
NOT_AUTHORIZED
2: Error when the execution of a price plan does not authorize access for a chargeable item.
|
static int |
OUT_OF_VALIDITY_PERIOD
1: Error when the service consumption date of the incoming chargeable item does not correspond to
a period when the identified contract (or subscription) can be charged for the digital service.
|
static int |
OVERRUN_CYCLE_DETECTED
6: Error when the operation fails because a cycle has been detected during an overrun
between prepaid account.
|
static int |
PRERATING_NOT_RESOLVED_YET
4: Error when the operation fails because it should corrupt the
rating records history of a subscription.
|
static int |
REFILL_REFUSED
17: Error when refilling a prepaid account from another one.
|
static int |
SESSION_NOT_STOPPED_YET
13: Error when the operation fails because it should corrupt balance and/or counters
because simultaneous prerating and session-based charging on the same subscriber account.
|
| Constructor and Description |
|---|
ForbiddenChargeException()
Builds an empty forbidden charge exception.
|
ForbiddenChargeException(ForbiddenChargingProcessException fcpe)
Builds an empty forbidden charge exception.
|
ForbiddenChargeException(int error,
java.lang.String message)
Constructs an exception with a message and an error
that explain why the charging is forbidden.
|
ForbiddenChargeException(int error,
java.lang.String message,
ChargingResult chargingResult)
Constructs an exception with a message and an error
that explain why the charging is forbidden.
|
ForbiddenChargeException(int error,
java.lang.String message,
java.lang.String reason)
Constructs an exception with a message and an error
and a sub message and a sub error
that explain why the charging is forbidden.
|
ForbiddenChargeException(int error,
java.lang.String message,
java.lang.String reason,
ChargingResult chargingResult)
Constructs an exception with a cause, a message and an error
that explain why the charging is forbidden.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(java.lang.String cData)
Adds character data to the content element.
|
void |
addChild(java.lang.String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
static void |
asyncThrow(int reason,
java.lang.String msg,
ForbiddenChargeListener listener) |
ChargingResult |
getChargingResult()
Returns the
ChargingResult that provides structured information about the exception. |
int |
getError()
Returns the error that forbids the charging/refilling process.
|
java.lang.String |
getMessage()
Returns the detailed message explaining why
charging is forbidden.
|
java.lang.String |
getReason()
Returns the reason that forbids the charging process.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
getOperandReferencepublic static final int NO_ACCESS_FOUND
To solve this issue:
public static final int OUT_OF_VALIDITY_PERIOD
This error happens when end customers are not allowed to use the digital service for the consumption date set in the chargeable item. This error is a business error and should not be retried.
Do not implement an automated treatment.
To solve this issue:
public static final int NOT_AUTHORIZED
public static final int ILLEGAL_ARGUMENT
public static final int PRERATING_NOT_RESOLVED_YET
public static final int INCOMPATIBLE_CURRENCIES
public static final int OVERRUN_CYCLE_DETECTED
public static final int CANNOT_CHARGE_ACCOUNT
public static final int ACCOUNT_BLOCKED
public static final int ACCOUNT_LOCKED
prepaid account is locked in the subscriber account.public static final int ACCOUNT_CLOSED
public static final int SESSION_NOT_STOPPED_YET
Note
This constant is also used when the session cleanup fails due to a lack of session memory.
public static final int NO_SUBSCRIPTION_FOUND
public static final int CALCULATE_TAX_ERROR
InvalidTaxException.@Deprecated public static final int INVALID_ACCOUNT
public static final int REFILL_REFUSED
public ForbiddenChargeException()
public ForbiddenChargeException(ForbiddenChargingProcessException fcpe)
public ForbiddenChargeException(int error,
java.lang.String message)
error - The error codemessage - The messagepublic ForbiddenChargeException(int error,
java.lang.String message,
ChargingResult chargingResult)
error - The error codemessage - The messagechargingResult - The ChargingResult which provides structured information about the exceptionpublic ForbiddenChargeException(int error,
java.lang.String message,
java.lang.String reason)
error - The error codemessage - The messagereason - The reasonpublic ForbiddenChargeException(int error,
java.lang.String message,
java.lang.String reason,
ChargingResult chargingResult)
error - The error codemessage - The messagereason - The reasonchargingResult - The ChargingResult that provides structured information about the exceptionpublic int getError()
NO_ACCESS_FOUND,
OUT_OF_VALIDITY_PERIOD,
NOT_AUTHORIZED,
ILLEGAL_ARGUMENT,
PRERATING_NOT_RESOLVED_YET,
INCOMPATIBLE_CURRENCIES,
OVERRUN_CYCLE_DETECTED,
CANNOT_CHARGE_ACCOUNT,
ACCOUNT_BLOCKED,
ACCOUNT_LOCKED,
ACCOUNT_CLOSED,
SESSION_NOT_STOPPED_YET,
NO_SUBSCRIPTION_FOUND,
CALCULATE_TAX_ERROR,
INVALID_ACCOUNT (deprecated and revoked),
REFILL_REFUSEDpublic java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic java.lang.String getReason()
OUT_OF_VALIDITY_PERIODpublic ChargingResult getChargingResult()
IChargingResultHolderExceptionChargingResult that provides structured information about the exception.
Example
The ForbiddenChargeException and InvalidItemException exceptions include
such a charging result complex object.
getChargingResult in interface IChargingResultHolderExceptionChargingResult that provides structured information about the exceptionpublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addCharacterData(java.lang.String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void addChild(java.lang.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 marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic static void asyncThrow(int reason,
java.lang.String msg,
ForbiddenChargeListener listener)