mPAY24 Logo

How to work with ORDER objects

Basics

In the mPAY24 context an ORDER is an object, represented by a XML, which contains all the usual information of a shopping cart.
For example: price, currency, items, billing address, shipping address, descriptions for the rows of the shopping cart, etc.
As you might have read in the specification of the mPAY24 interfaces there is a MDXI schema, which defines the order, the type and the allowed count of all these elements. This is also specified in chapter 4.2.9 of the specification.
Accordingly to this schema and using the ORDER class we support, you can create a MDXI-XML very easy. The first thing you should do is to instantiate an object from the ORDER type.

You could then start the creation of the xml-nodes fully intuitional. To create a text (TODO!!!) node with a value you only need to know the position of the node and it's value - for example if you want to create a node with value "a.b@c.de" as "Email" node, which is in the node "BillingAddr" and the "BillingAddr" node is in the "Order" node you should only type the following:

So you don't need to explicitly create the container nodes - "Order" and "BillingAddr".
You can also pass attributes for a node with only one set function call:

With last function call we have created and set a "Mode" attribute for the node "BillingAddr", which equals "ReadOnly".

If the set value equals "", the attribute will not be created.

If you want to create more than one node of the same type you can create it by calling the node as a method with an index as attribute. The index can only be a positive integer!

Example

Input

Output