createProcessingTransaction static method
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,
},
);
}