initiatePayment method
Implementation
Future<void> initiatePayment({
required String gateway,
required String secretKey,
required String amount,
}) async {
switch (gateway) {
case 'stripe':
debounce.run(() {
_initiateStripePayment(double.parse(amount) * 100, secretKey);
});
break;
case 'razorPay':
_initiateRazorPay(double.parse(amount), secretKey);
break;
case 'payU':
_initiateRazorPay(double.parse(amount), secretKey);
break;
default:
throw UnsupportedError('Unsupported payment gateway: $gateway');
}
}