MakePaymentOnline method

Future<void> MakePaymentOnline({
  1. dynamic amount,
  2. dynamic mobnum,
  3. dynamic email,
  4. dynamic description,
  5. dynamic name,
  6. dynamic razorpayOrderId,
  7. dynamic medicine_razorpay_key,
})

Implementation

Future<void> MakePaymentOnline({
  amount,
  mobnum,
  email,
  description,
  name,
  razorpayOrderId,
  medicine_razorpay_key,
}) async {
  Razorpay razorpay = Razorpay();
  var options = {
    'key': medicine_razorpay_key,
    'amount': amount,
    'name': name,
    'order_id': razorpayOrderId,
    'description': description.toString(),
    'retry': {'enabled': true, 'max_count': 1},
    'send_sms_hash': true,
    'prefill': {'contact': mobnum, 'email': email},
    'external': {
      'wallets': [
        'paytm',
      ]
    }
  };
  razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
  razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
  razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);
  razorpay.open(options);
}