convertToLegacySession

Converts the current Session instance to a legacy AirwallexSession object.

This conversion is primarily required for Local Payment Methods (LPM), as they are not yet supported by the unified Session flow.

Determines which legacy session to create based on Session properties:

Preserves PaymentIntentProvider for Express Checkout scenarios where applicable.

Return

A legacy AirwallexSession object representing the current session state

Throws

if required properties are missing