Attaching Custom Data
It is possible to attach custom data to any purchase. The data attached to a purchase gets persisted. It can also be updated and read back.
How Does It Work
- When initializing a new purchase (see InitializePayment), you can append any string that gets paired with the purchase and persisted.
- Any time you call UpdateItems, the last version the attachment call gets overwritten by the new one. If you do not define any attachment, the last one (if it exists) gets removed.
- Any time you ask for the purchase status (see GetPurchaseStatus), the returned data will contain a property called Attachment with the latest version of the attached string (or null).
The custom data is passed along as a string. Since we do not
process such a data in any way (expect for storing it, updating and allowing you
to read it back), the string format is completely up to you. It can be e.g. a JSON
or an XML.
Currently, there is no limit for the string length, but we
will probably introduce some in the future.