initiateTransaction method

  1. @override
Future<String?> initiateTransaction(
  1. String paymentUrl,
  2. String referrer
)
override

Initiates a transaction by invoking a method on the native platform.

It sends the provided paymentUrl and referrer to the native platform to initiate the transaction. Returns a string as a result of native status for initiating the transaction.

Implementation

@override
Future<String?> initiateTransaction(
    String paymentUrl, String referrer) async {
  // Call the native method to initiate the transaction with the payment URL
  final result = await methodChannel.invokeMethod<String?>(
      EpayPlatformInterface.methodChannelInitiateTransaction,
      {'payment_url': paymentUrl, 'referrer': referrer});
  return result;
}