diff --git a/discord/state.py b/discord/state.py index 344a60013..0428ce0b6 100644 --- a/discord/state.py +++ b/discord/state.py @@ -101,6 +101,7 @@ from .audit_logs import AuditLogEntry from .read_state import ReadState from .tutorial import Tutorial from .experiment import UserExperiment, GuildExperiment +from .metadata import Metadata if TYPE_CHECKING: from typing_extensions import Self @@ -2006,8 +2007,8 @@ class ConnectionState: self.dispatch( 'billing_popup_bridge_callback', try_enum(PaymentSourceType, data.get('payment_source_type', 0)), - data.get('path'), - data.get('query'), + data.get('path', ''), + Metadata(data.get('query', {})), data.get('state'), ) diff --git a/discord/types/gateway.py b/discord/types/gateway.py index 74135fd2b..2615fd4af 100644 --- a/discord/types/gateway.py +++ b/discord/types/gateway.py @@ -497,7 +497,7 @@ class BillingPopupBridgeCallbackEvent(TypedDict): payment_source_type: int state: str path: str - query: str + query: Dict[str, str] PaymentUpdateEvent = Payment diff --git a/docs/api.rst b/docs/api.rst index 26eab4f78..43e678d13 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -516,13 +516,17 @@ Billing .. versionadded:: 2.0 + .. versionchanged:: 2.1 + + The type of the ``query`` parameter was corrected from ``str`` to ``Mapping[str, str]``. + :param payment_source_type: The payment source type. :type payment_source_type: :class:`PaymentSourceType` - :param path: The path of the callback. + :param path: The URL path of the callback. :type path: :class:`str` - :param query: The query of the callback. - :type query: :class:`str` - :param state: The state of the callback. + :param query: The URL query parameters of the callback. + :type query: Mapping[:class:`str`, :class:`str`] + :param state: A hash to verify the callback. :type state: :class:`str` Entitlements