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