OpenPopup() to display payment channel selection opt-in dialogs in your Unity project. This allows players to choose between native IAP and Stash Pay payment methods.
Before you begin
This guide assumes you have already set up the Stash Pay Unity SDK. If you haven’t, see the Unity integration guide first.Opening an Opt-in Popup
UseOpenPopup() for payment channel selection opt-in dialogs. Always handle the OnOptinResponse event:
Opening an Opt-in Popup
Use
OpenPopup() exclusively for payment channel selection opt-in flows. For checkout flows, use OpenCheckout() instead.Configuring Popup Size
OpenPopup() supports optional custom size configuration. By default, it uses platform-specific default sizing. You can customize the size using PopupSizeConfig:
Custom Popup Size Configuration
API Reference
Methods
OpenPopup(string url, Action onDismiss = null, Action onSuccess = null, Action onFailure = null, PopupSizeConfig? customSize = null)
Opens Stash opt-in and other remote Stash dialogs in a centered modal popup. Size can be customized using PopupSizeConfig. If not provided, uses platform-specific default sizing.
Events
OnOptinResponse (event Action<string>)
- Fired when user selects a payment channel in opt-in popup. Receives
"native_iap"or"stash_pay".
Types
PopupSizeConfig (struct)
portraitWidthMultiplier(float) - Width multiplier for portrait orientationportraitHeightMultiplier(float) - Height multiplier for portrait orientationlandscapeWidthMultiplier(float) - Width multiplier for landscape orientationlandscapeHeightMultiplier(float) - Height multiplier for landscape orientation
customSize is not provided, the platform-specific defaults are used.