7.21.4 Approve Method

The Approve Method is charging money from an account associated to the current UserId. It may also check if it is allowed to sell the selection to the user (e.g., based on age restrictions).

If the execution of the Method cannot be done due to some application logic, the Method should return an Uncertain StatusCode and provide details of the failure in the Status output Argument. When the Method returns an Uncertain StatusCode, the Method is considered to be failed.

If the Method returns successful, it does not indicate, that the approve has been completed successful. Clients need to access the ApproveStatus Variable to get the information, if the approve successfully finished.

The signature of this Method is specified below. Table 69 and Table 70 specify the Arguments and AddressSpace representation, respectively.

Signature

	Approve (
	  [in]   PriceDataType            Value,
	  [in]   0:String                 UserId,
	  [in]   SelectionDataType        Selection,
	  [out]  0:Int32                    Status);
Table 69 - Approve Arguments
Argument Description
ValueThe value to be approved and charged from the account of the UserId.
UserIdThe UserId where the Value should be charged from the associated account.
SelectionSelection used to be bought. May be needed to check if selling the selection to the user is allowed (e.g., due to age restrictions).
Status

Status of the execution of the method. If issues occurred during execution.

0 = Execution was successful.

-1 = Invalid UserId - UserId unknown

-2 = Invalid UserId - Not the current UserId

-3 = Selection unknown

Vendors may return a vendor specific status starting with number -16 or smaller.

Method Result Codes (defined in Call Service)

Result Code Description
Bad_UserAccessDeniedSee OPC 10000-4 for a general description.
Table 70 - Approve AddressSpace definition
Attribute Value
BrowseNameApprove
References NodeClass BrowseName DataType TypeDefinition ModellingRule
0:HasPropertyVariable0:InputArguments0:Argument[] 0:PropertyType0:Mandatory
0:HasPropertyVariable0:OutputArguments0:Argument[] 0:PropertyType0:Mandatory