mirror of
https://github.com/valitydev/hooker.git
synced 2024-11-06 00:05:17 +00:00
Fix npe with token provider (#11)
* Fix nullable token provider * Fix optional variable
This commit is contained in:
parent
da9a36a4b0
commit
a7b866b090
@ -11,6 +11,8 @@ import dev.vality.swag_webhook_events.model.*;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class PaymentToolUtils {
|
||||
|
||||
@ -23,8 +25,11 @@ public class PaymentToolUtils {
|
||||
.lastDigits(paymentTool.getBankCard().getLastDigits())
|
||||
.cardNumberMask(
|
||||
paymentTool.getBankCard().getBin() + "******" + paymentTool.getBankCard().getLastDigits())
|
||||
.tokenProvider(PaymentToolDetailsBankCard.TokenProviderEnum.fromValue(
|
||||
TokenProviderUtil.getTokenProviderName(paymentTool.getBankCard())))
|
||||
.tokenProvider(
|
||||
Optional.ofNullable(TokenProviderUtil.getTokenProviderName(paymentTool.getBankCard()))
|
||||
.map(PaymentToolDetailsBankCard.TokenProviderEnum::fromValue)
|
||||
.orElse(null)
|
||||
)
|
||||
.paymentSystem(PaymentSystemUtil.getPaymentSystemName(paymentTool.getBankCard()))
|
||||
.issuerCountry(paymentTool.getBankCard().getIssuerCountry() != null
|
||||
? paymentTool.getBankCard().getIssuerCountry().name() : null)
|
||||
|
Loading…
Reference in New Issue
Block a user