Extension.Api.CheckoutData reference
Extensions in Sana has access to additional data storage functionality for checkout via Api.CheckoutData
property. This property holds an instance of DataManager
type which serves as an entry
point to save or retrieve data that the extension needs to store in Sana during checkout process.
Methods
Save
Saves data for current checkout process. Technically, the data is saved in current basket record in SQL database. This data will be removed as soon as checkout is finished and the basket is cleared automatically. The data which is saved can be any primitive or complex type.
Important
If this method is called during invoice payment or offline order payment process, the data will be stored only in memory during actual request lifecycle and will be removed when the request is finished.
string data = "some data";
Api.CheckoutData.Save(data);
Get
Gets data previously saved for current checkout process.
// generic type parameter is used to cast the resulting data object to
var data = Api.CheckoutData.Get<string>();