-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: document PaymentSdkTransactionType
- add documentation for PaymentSdkTransactionType class
- Loading branch information
1 parent
5d1a58f
commit e4ada12
Showing
1 changed file
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
enum PaymentSdkTransactionType { SALE, AUTH, REGISTER } | ||
/// Enum representing different types of payment transactions. | ||
enum PaymentSdkTransactionType { | ||
/// Represents a sale transaction. | ||
SALE, | ||
|
||
/// Represents an authorization transaction. | ||
AUTH, | ||
|
||
/// Represents a register transaction. | ||
REGISTER | ||
} | ||
|
||
/// Extension on [PaymentSdkTransactionType] to provide additional functionality. | ||
extension PaymentSdkTransactionTypeExtension on PaymentSdkTransactionType { | ||
/// Gets the name of the transaction type as a string. | ||
/// | ||
/// Returns: | ||
/// - "auth" for [PaymentSdkTransactionType.AUTH] | ||
/// - "register" for [PaymentSdkTransactionType.REGISTER] | ||
/// - "sale" for [PaymentSdkTransactionType.SALE] (default) | ||
String get name { | ||
switch (this) { | ||
case PaymentSdkTransactionType.AUTH: | ||
return "auth"; | ||
case PaymentSdkTransactionType.REGISTER: | ||
return "Register"; | ||
return "register"; | ||
default: | ||
return "sale"; | ||
} | ||
} | ||
} | ||
} |