7.11.5 GetPriceForBasket Method

The GetPriceForBasket Method asks for the current price of a basket of selections of the Vending Machine. It takes indications as input that influence the price. The output contains the price information.

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, and the returned OverallPriceInformation and PriceInformationList shall not be interpreted.

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

Signature

	GetPriceForBasket (
	  [in]   0:String                   UserId,
	  [in]   0:String                   PaymentMode,
	  [in]   SelectionDataType[]        BasketContent,
	  [out]  PriceDataType              OverallPriceInformation,
	  [out]  PriceAndContextDataType[]  PriceInformationList,
	  [out]  0:Int32                    Status);
Table 42 - GetPriceForBasket Arguments
Argument Description
UserIdThe UserId context for which the provided price is valid.
PaymentMode

The payment mode that will be used for the payment, which may influence the price. Supported payment modes of the payment service are defined in the PaymentModes of the PaymentService Object, using the PaymentModeId.

It is not allowed to provide a NULL or empty string or to use the PaymentMode "NoCheck".

BasketContentThe content of the basket, for which the price is asked for.
OverallPriceInformationThe overall price for the BasketContent. Shall not be interpreted when the Method returns with an UNCERTAIN StatusCode.
PriceInformationListThe price of each individual content of the basket. The array shall have the same size as the BasketContent array and each entry represents the price for the entry at the same index of the BasketContent. The OverallPriceInformation shall be the sum of each entry of the PriceInformationList. Shall not be interpreted when the Method returns with an UNCERTAIN StatusCode.
Status

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

0 = Execution was successful.

-1 = Machine engine referenced in MachineEngineProductInstanceUri not managed by payment service.

-2 = Invalid UserId

-3 = Invalid PaymentMode

-4 = Invalid SelectionId

-5 = Invalid Option contained in Options

-6 = Invalid SelectionListVersion

-6 = Price service not available

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 43 - GetPriceForBasket AddressSpace definition
Attribute Value
BrowseNameGetPriceForBasket
References NodeClass BrowseName DataType TypeDefinition ModellingRule
0:HasPropertyVariable0:InputArguments0:Argument[] 0:PropertyType0:Mandatory
0:HasPropertyVariable0:OutputArguments0:Argument[] 0:PropertyType0:Mandatory