createProcessingTransaction static method

Future<void> createProcessingTransaction({
  1. required num amount,
  2. required String rzpKey,
  3. required String appName,
  4. String? itemName,
  5. required RzpUserProfile userProfile,
  6. required String transaction,
  7. required String orderId,
})

Implementation

static Future<void> createProcessingTransaction({
  required num amount,
  required String rzpKey,
  required String appName,
  String? itemName,
  required RzpUserProfile userProfile,
  required String transaction,
  required String orderId,
}) async {
  _firestore.collection('razorpayPaymentTransaction').doc(transaction).set(
    {
      'status': 'processing',
      'gateway': 'razorpay',
      'platform': Platform.isAndroid ? 'android' : 'ios',
      'amount': amount,
      'rzpKey': rzpKey,
      'appName': appName,
      'itemName': itemName,
      'user': userProfile.toMap(),
      'id': transaction,
      'createdAt': FieldValue.serverTimestamp(),
      'orderId': orderId,
    },
  );
}