Skip to content

Instantly share code, notes, and snippets.

@ms314006
Last active January 29, 2023 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ms314006/2b50a93df1af20ca7af3355c3a11da0b to your computer and use it in GitHub Desktop.
Save ms314006/2b50a93df1af20ca7af3355c3a11da0b to your computer and use it in GitHub Desktop.
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