Created
February 27, 2020 03:41
-
-
Save annchar/05ad9cbf7fd324023b16979a624819ce 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
private fun getPaymentDetailToString(payment: Payment): String { | |
return when (payment) { | |
is Payment.CreditCard -> | |
"Credit Card \nName: ${payment.name} \nCard Number: ${payment.number} \nExpired Date: ${payment.expiredDate} \nTransfer Amount: ${payment.transferAmount}" | |
is Payment.CashBank -> | |
"Cash Bank \nBank Code: ${payment.bankCode} \nBank Name: ${payment.bankName} \nTransfer Amount: ${payment.transferAmount}" | |
is Payment.Promptpay -> | |
"Promptpay \nName: ${payment.name} \nCitizen Id: ${payment.citizenId} \nMobile Number: ${payment.mobileNumber} \nTransfer Amount: ${payment.transferAmount}" | |
Payment.NonePayment -> "None Payment" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment