Pay by Bank · Mobile SDK

Take a payment

Start a Pay by Bank payment with the same processor you use for cards and wallets.

Before you start

  • The PaymentProcessor is created, its payment result callback is set and initiate has completed - see Payment Setup.
  • Pay by Bank is enabled on your account.
  • The return URL is registered with the operating system - see Return URL setup.

Check that Pay by Bank is available

The payment methods available to the session are returned when the processor is initiated. Check for OPENBANKING before showing the button, in the same way you check for the card, Apple Pay and Google Pay methods.

Kotlin
if (processor.hasPaymentMethod(AcceptPaymentMethods.OPENBANKING)) {
  // Pay by Bank can be offered in this session
}
Swift
if processor.hasPaymentMethod(method: AcceptPaymentMethods.openbanking) {
  // Pay by Bank can be offered in this session
}

Use the built-in button

The SDK includes a Pay by Bank button for Compose, Android Views and iOS. It is optional - if you prefer your own button, call processBankPayment directly as shown in the next section.

The button renders only when the processor is initiated, Pay by Bank is available in the session and the device is connected. The Compose button is annotated @ExperimentalMobileUI, and takes an optional enabled flag so you can disable it while another payment is in progress.

Compose

Kotlin
import com.accesspaysuite.mobilesdk.data.common.BillingAddress
import com.accesspaysuite.mobilesdk.ui.bank.BankPayButton
import com.accesspaysuite.mobilesdk.ui.ExperimentalMobileUI

@OptIn(ExperimentalMobileUI::class)
@Composable
fun PayByBankButton(billingAddress: BillingAddress) {
  BankPayButton(
      billingAddress = billingAddress,
      returnUrl = "https://pay.example.com/pay-by-bank/return"
  )
}

Android View

XML
<com.accesspaysuite.mobilesdk.ui.bank.BankPayButtonView
  android:id="@+id/payByBankButton"
  android:layout_width="match_parent"
  android:layout_height="wrap_content" />
Kotlin
val button = findViewById<BankPayButtonView>(R.id.payByBankButton)
button.billingAddress = billingAddress
button.returnUrl = "https://pay.example.com/pay-by-bank/return"

iOS

Swift
import mobilesdk

let controller = BankPayButtonController.shared
controller.setBillingAddress(address: billingAddress)
controller.setReturnUrl(url: returnUrl)
let button = controller.make()
// Embed the returned UIViewController in your view hierarchy

Start the payment

Call processBankPayment with the customer's billing address and the HTTPS return URL described in Return URL setup. The SDK creates the payment and opens its bank selection sheet; the rest of the journey happens inside the SDK.

Kotlin
processor.processBankPayment(
  billingAddress = billingAddress,
  returnUrl = "https://pay.example.com/pay-by-bank/return"
)
Swift
try processor.processBankPayment(
  billingAddress: billingAddress,
  returnUrl: "https://pay.example.com/pay-by-bank/return"
)

The billing address is required, and Pay by Bank is only available in supported countries - the API expects countryCode to be GBR. The processor must be initiated and its payment result callback set before this call, otherwise the error is reported through that callback.

The sheet cannot be swiped away or left accidentally: the customer either completes the bank authorisation or confirms a cancel. The sheet stays open while the SDK waits for the resume response and closes when the outcome is delivered.

Track the transaction id

The API assigns the transaction id when it accepts the payment. Register the transaction id callback to receive it while the bank flow is still in progress, which is useful for reconciling the payment in your own records or in support tooling.

Kotlin
processor.setTransactionIdCallback { transactionId ->
  // The API-assigned transaction id
  // Called on a background thread - dispatch to the main thread for UI work
}
Swift
processor.setTransactionIdCallback { transactionId in
  // The API-assigned transaction id
}

The callback is shared by every payment method, so register it once with the other processor callbacks. See Transaction id callback for the interface form and the thread it runs on.

Handle the result

The outcome is delivered through the payment result callback, like any other payment method:

StatusWhat it means for Pay by Bank
SuccessThe bank authorisation completed and the SDK confirmed the transaction as authorised.
ErrorThe payment failed or could not be confirmed. Keep the transaction id: the transaction may still be settling, as described below.
CanceledThe customer left the bank flow without authorising the payment. Canceled is a Mobile SDK status - the API has no cancelled state, so a cancelled payment shows as Failed in the payment dashboard.
PendingThe resume could not confirm the payment because the provider is still processing it. Keep the transaction id and retrieve the transaction for its final status - see Pending transactions.
SessionExpiredThe client token expired before the payment finished.
After a result is delivered the session is invalidated and cannot be reused, except for Canceled. A new initiation is required for another payment.

The SDK sends the resume request once when the customer returns. If the provider is still processing the payment, it does not resume again - the API only allows one resume per transaction. It reports Pending with the transaction id instead, and you retrieve the transaction for the final status as described below.

If the bank finished before the customer returned, the resume is rejected because there is nothing left to resume. The SDK recognises that and reports the transaction's outcome: Success when the bank completed the payment, Error when the bank declined it.

Pending transactions

The first resume can come back before the provider has finished - for example authResponse.status is PROCESSING, or the transaction is WAITING. A transaction can only be resumed once, so the SDK stops and reports Status.Pending with its transaction id instead of resuming again.

This is not a decline. Keep the id and retrieve the transaction from your backend once the bank has finished, until transaction.status is no longer WAITING or PENDING. Notifications are configured when a payment is created and cannot be requested on the Mobile SDK payment, so retrieving the transaction is the way to learn the final status.

If you use the individual callbacks, the pending case has its own callback:

Kotlin
processor.setPaymentResultCallback(
  onPaymentSuccess = { /* Payment successful */ },
  onPaymentFailed = { reason, traceId -> /* Payment failed */ },
  onPaymentMethodCanceled = { /* Customer canceled */ },
  onPaymentPending = { transactionId ->
      // Pass the id to your backend; it retrieves the transaction
  }
)
Swift
processor.setPaymentResultCallback(
  onPaymentSuccess: { /* Payment successful */ },
  onPaymentFailed: { reason, traceId in /* Payment failed */ },
  onPaymentMethodCanceled: { /* Customer canceled */ },
  onPaymentPending: { transactionId in
      // Pass the id to your backend; it retrieves the transaction
  }
)

If you use a PaymentResultCallback, it arrives as a status instead:

Kotlin
when (status) {
  is Status.Pending -> {
      val transactionId = status.transactionId
      // Pass the id to your backend; it retrieves the transaction
  }
  // ...
}

Retrieve the transaction with that id from your backend. The API uses your credentials, so do not make this call from the app:

Retrieving a completed Pay by Bank payment
EndpointDefinition
GET /acceptor/rest/transactions/{instId}/{transactionId}
cURL
curl -X GET "{targetEnvironmentPath}/acceptor/rest/transactions/{instId}/{transactionId}" \
  -u "{apiUser}:{apiPassword}"
Response
HTTP/1.1 200
{
  "processing": {
    "model": "MANAGE",
    "authResponse": {
      "acquirerName": "Tink",
      "gatewayReference": "e947439bd10e4975a2720f552570bc54",
      "status": "AUTHORISED"
    },
    "route": "TINK"
  },
  "paymentMethod": {
    "openbanking": {
      "remittanceReference": "Hz6Ca85E",
      "account": {
        "sortCode": "967443",
        "accountNumber": "****9434",
        "bankName": "uk-demobank-open-banking-redirect"
      },
      "mode": "REDIRECT"
    },
    "billingAddress": {
      "line1": "Flat 1",
      "city": "London",
      "postcode": "AA1 2BB",
      "country": "United Kingdom",
      "countryCode": "GBR"
    },
    "paymentClass": "OPENBANKING"
  },
  "transaction": {
    "transactionId": "11476791330",
    "merchantRef": "obDemo",
    "merchantDescription": "Sample Transaction",
    "status": "SUCCESS",
    "stage": "COMPLETE",
    "type": "PAYMENT",
    "amount": 10.00,
    "consumerSpend": 10.00,
    "currency": "GBP",
    "transactionTime": "2025-11-21T09:37:09.821Z",
    "receivedTime": "2025-11-21T09:37:09.821Z"
  },
  "history": [
    {
      "transactionStatus": "PENDING",
      "reasonCode": "U110",
      "reasonMessage": "Suspended for completion of authorisation",
      "timeStamp": "2025-11-21T09:37:11.741Z"
    },
    {
      "transactionStatus": "PENDING",
      "reasonCode": "U200",
      "reasonMessage": "Waiting for downstream authoriser to complete processing",
      "timeStamp": "2025-11-21T09:42:09.228Z"
    },
    {
      "transactionStatus": "SUCCESS",
      "reasonCode": "S100",
      "reasonMessage": "Authorised",
      "timeStamp": "2025-11-21T09:43:08.961Z"
    }
  ],
  "followUpStatus": {},
  "link": [
    {
      "href": "https://api.mite.pay360.com/acceptor/rest/transactions/5315271/11476791330",
      "rel": "self"
    }
  ]
}
Notes:
  • Retrieval is how you get the final status of a payment the customer has authorised at their bank: the transfer settles after they come back, so the resume may still report U200.
  • history is the whole progression — suspended (U110), waiting for the transfer (U200), then S100 — and paymentMethod.openbanking.account is the account the customer paid from, which is only known once they have chosen it.
Poll the transaction until it leaves WAITING and PENDING. A transaction that has already reached SUCCESS needs no further polling.

Get the final status

Success from the SDK means the bank authorisation went through. A Pay by Bank transaction is still PENDING while the Faster Payments transfer settles, and moves to SUCCESS afterwards - usually within two hours. Retrieve the transaction with the transaction id to learn when the money moved.

The same flow is described for the APIs in Get the final status.

Refunds and limitations

  • A payment can be refunded once it has reached SUCCESS, in full or as multiple partial refunds up to the original amount - see Refund a payment.
  • Pay by Bank transactions cannot be deferred.
  • The payment method cannot be saved for reuse.