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,createPaymentandonChangeare top-level fields.onInstallmentSelectedgoes insidecard(card: { onInstallmentSelected }) andonShippingAddressChangedinsideexternalButtons(externalButtons: { onShippingAddressChanged }). - iOS, Android. Implement
TransactionControlleron the object that should react to events (your view model, activity, or a dedicated class) and pass it through thecontrollerfield ofTransactionConfig. Each event maps to a method on that object.showViewis 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 insidecreatePayment) off the main thread yourself.
Per-controller pages
onStatus. Required. The final outcome of the transaction.- Take over the SDK:
showView(iOS, Android),showLoading,createPayment. Override one and the SDK stops doing that step itself. - Listen to events:
onInstallmentSelected,onShippingAddressChanged,onChange(Web). Informational; the SDK behaves the same with or without them.