updateFailureTransaction static method

Future<void> updateFailureTransaction({
  1. required String transaction,
  2. required Map<String, dynamic>? failureResponse,
})

Implementation

static Future<void> updateFailureTransaction({
  required String transaction,
  required Map<String, dynamic>? failureResponse,
}) async {
  _firestore.collection(collectionName).doc(transaction).update(
    {
      'failureResponse': failureResponse?['response'] != null
          ? jsonDecode(failureResponse!['response'])
          : 'No response',
      'status': 'failure',
      'failureTime': FieldValue.serverTimestamp(),
    },
  );
}