Skip to main content
This is a client-side JavaScript SDK method, not a REST endpoint. It has no OpenAPI spec and no request playground; the contract is documented here.

Summary

GlobalE.UpdatePaymentMethod starts the update-payment-method flow for a subscription. It loads a dynamic script, injects an iframe into a DOM container that you provide, and runs callbacks when the flow succeeds, is cancelled by the user, or fails. API source: globale.merchant.client.js (GEClient instance exposed as GlobalE).

Signature

Parameters

Callbacks

  • onSuccess(data) – After the customer returns from redirect, when the flow completes successfully:
  • data is usually an object: { statusCode, subscriptionId } — e.g. { statusCode: "Settled", subscriptionId: "your-subscription-id" }.
  • In some cases data may still be a status string only (e.g. "Settled"). Integrators should support both: if typeof data === "object" && data !== null && data.statusCode, use data.statusCode and data.subscriptionId; otherwise treat data as the status string.
  • onCancelation(info) – info may be a status string (e.g. 'UserCanceled').
  • onFailure(error) – error usually contains error.error or error.message and possibly error.details.

Callback responses

Return from redirect

  • On a final status, the matching callback runs (onSuccess, onCancelation, or onFailure)
  • Global‑e then redirects the customer to your return URL (merchantReturnUrl if you supplied one, otherwise ChangePaymentMethodFormReturnUrl)

Clearing the flow

GlobalE.ClearUpdatePaymentMethod() – removes the iframe and resets the state. Use when closing the flow or switching containers.

Common errors

  • 'subscriptionId is required' – subscriptionId was not provided.
  • Invalid cultureCode or currencyCode – must be non‑empty strings if provided.
  • Failed to initialize/execute UpdatePaymentMethod – script load or runtime error.