@@ -15,6 +15,7 @@ public class PayoutMethodDTO {
|
||||
private String type;
|
||||
private String displayName;
|
||||
private String maskedDetails;
|
||||
private String cardNumber;
|
||||
private boolean isDefault;
|
||||
private boolean isVerified;
|
||||
}
|
||||
|
||||
@@ -129,13 +129,19 @@ public class PayoutMethodService {
|
||||
}
|
||||
|
||||
public PayoutMethodDTO convertToDto(PayoutMethod method) {
|
||||
return PayoutMethodDTO.builder()
|
||||
PayoutMethodDTO payoutMethodDTO = PayoutMethodDTO.builder()
|
||||
.id(method.getId())
|
||||
.type(method.getClass().getSimpleName().replace("PayoutMethod", ""))
|
||||
.displayName(method.getDisplayName())
|
||||
.maskedDetails(method.getMaskedDetails())
|
||||
.isDefault(method.isDefault())
|
||||
.build();
|
||||
|
||||
if (method instanceof CardPayoutMethod cardMethod) {
|
||||
payoutMethodDTO.setCardNumber(cardMethod.getCardNumber());
|
||||
}
|
||||
|
||||
return payoutMethodDTO;
|
||||
}
|
||||
|
||||
private String generateCardHash(String cardNumber) {
|
||||
|
||||
Reference in New Issue
Block a user