If true, the data returned by transformParentPageData will be passed to the function
window.Combeenation.onConfigurationFinished(data) on the parent page (or one of its older aliases like
Combeenation.onCheckout etc.).
Provides the checkout data which is passed to the parent page after the configuration is finished.
This is meant to forward the checkout result of the finish. Things to note:
finishResult.actionResults (keyed by finish action type name, e.g. ShopCheckout or Checkout) is the
actual checkout result, so you have to select it here.checkoutParameters, since checkoutParametersHash is built from it on the server and
wouldn't match anymore.finishConfiguration({
sendDataToParentPage: true,
transformParentPageData: finishResult => {
const checkout = Object.values(finishResult.actionResults ?? {}).find(
(r): r is CheckoutFinishActionResponse => r.type === FinishActionResponseTypes.Checkout
);
if (!checkout) throw new Error('No checkout finish action result');
return {
id: checkout.cfgnId,
authentication: checkout.authToken,
checkoutParameters: checkout.checkoutParameters ?? '',
checkoutParametersHash: checkout.checkoutParametersHash ?? '',
queryParameters: Object.fromEntries(new URLSearchParams(window.location.search)),
} satisfies ParentPageCheckoutData;
},
});
The finish result or undefined if the finish failed.
Creates a finish of the current configuration by running all the Configurator's finish actions and optionally passes the resulting data to the parent page.