Skip to content

Handling Transactions with the SDK

Rotimi Joshua edited this page Sep 10, 2023 · 1 revision

Flutterwave Logo

Handling Transactions

The SDK provides a way to handle transactions using two delegates for callback methods. These delegates allow you to respond to different transaction outcomes within your application code.

Transaction Handling Methods

// MARK: - Transaction Handling

// This method is called when a transaction is successful
func transactionSuccessful(flwRef: String?, responseData: FlutterwaveDataResponse?) {
    print("DATA Returned \(responseData?.flwRef ?? "Failed to return data")")
    // You can add additional logic here to handle a successful transaction
}

// This method is called when a transaction fails
func transactionFailed(flwRef: String?, responseData: FlutterwaveDataResponse?) {
    print("Failed to return data with FlwRef \(flwRef.orEmpty())")
    // You can add additional logic here to handle a failed transaction
}
Clone this wiki locally