Skip to main content
Controllers are how your code receives the SDK’s events and, when needed, overrides default behavior. Implement only the ones you need.

Defaults

Implement onStatus in every integration. The others are optional. Web has no showView: the SDK renders the form inside your elementSelector. To submit it from your own button, set showPayButton: false and call transaction.submit().

How to wire controllers

  • Web. Each event is a plain function set on the transaction config. onStatus, showLoading, createPayment and onChange are top-level fields. onInstallmentSelected goes inside card (card: { onInstallmentSelected }) and onShippingAddressChanged inside externalButtons (externalButtons: { onShippingAddressChanged }).
  • iOS, Android. Implement TransactionController on the object that should react to events (your view model, activity, or a dedicated class) and pass it through the controller field of TransactionConfig. Each event maps to a method on that object. showView is available on mobile only.

Threading

On iOS and Android, every controller method is invoked on the main thread. You can update UI directly from inside it. Move any blocking work (e.g. backend calls inside createPayment) off the main thread yourself.

Per-controller pages