createProcessingTransaction static method

Future<void> createProcessingTransaction({
  1. required num amount,
  2. required String apiKey,
  3. required String merchantId,
  4. required String salt,
  5. required String appName,
  6. required String description,
  7. required OmniwareUserProfile userProfile,
  8. required String transaction,
  9. required String orderId,
  10. required String platform,
})

Creates a new processing payment transaction record in Firebase.

This method creates a new document in the Firestore collection to track a payment transaction that is in progress. The document includes transaction details such as amount, merchant ID, description, and user profile.

Parameters:

  • amount: The transaction amount.
  • apiKey: The API key used for the transaction.
  • merchantId: The merchant ID for the transaction.
  • salt: The salt value used in the payment process.
  • appName: The name of the application initiating the payment.
  • description: The description of the payment.
  • userProfile: The user's profile information.
  • transaction: The unique transaction ID.
  • orderId: The unique order ID for the payment.

Implementation

static Future<void> createProcessingTransaction({
  required num amount,
  required String apiKey,
  required String merchantId,
  required String salt,
  required String appName,
  required String description,
  required OmniwareUserProfile userProfile,
  required String transaction,
  required String orderId,
  required String platform,
}) async {
  _firestore.collection(collectionName).doc(transaction).set(
    {
      'status': 'processing',
      'gateway': gateway,
      'platform': platform,
      'amount': amount,
      'apiKey': apiKey,
      'merchantId': merchantId,
      'salt': salt,
      'appName': appName,
      'description': description,
      'user': userProfile.toMap(),
      'id': transaction,
      'createdAt': FieldValue.serverTimestamp(),
      'orderId': orderId,
    },
  );
}