Last active
January 29, 2023 14:07
-
-
Save ms314006/2b50a93df1af20ca7af3355c3a11da0b to your computer and use it in GitHub Desktop.
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
import SuccessTransaction from './SuccessTransaction'; | |
import FailTransaction from './FailTransaction'; | |
import PendingTransaction from './PendingTransaction'; | |
class Transaction { | |
constructor(transaction) { | |
this.id = transaction.id; | |
this.transactionStatusDelegate = this.getTransactionStatusDelegate(transaction); | |
} | |
get statusString() { | |
return this.transactionStatusDelegate.statusString; | |
} | |
get isNonRefundable() { | |
return this.transactionStatusDelegate.isNonRefundable; | |
} | |
getTransactionStatusDelegate(transaction) { | |
// ... | |
} | |
} | |
export default Transaction; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment