Skip to content

Commit

Permalink
Code checks
Browse files Browse the repository at this point in the history
  • Loading branch information
caiofaustino committed Nov 3, 2020
1 parent 732da13 commit 715703c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static List<CardType> estimate(@NonNull String cardNumber) {

/**
* Get CardType from the brand name as it appears in the Checkout API.
* @see <a href="https://docs.adyen.com/api-explorer/#/CheckoutService/v65/post/paymentMethods__resParam_storedPaymentMethods-brand></a>"/>
* @see <a href="https://docs.adyen.com/api-explorer/#/CheckoutService/v65/post/paymentMethods__resParam_storedPaymentMethods-brand"></a>
*/
@Nullable
public static CardType getByBrandName(@NonNull String brand) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public final class CardComponent extends BasePaymentComponent<
private static final Set<CardType> NO_CVC_BRANDS;

static {
HashSet<CardType> brandSet = new HashSet<>();
final HashSet<CardType> brandSet = new HashSet<>();
brandSet.add(CardType.BCMC);
NO_CVC_BRANDS = Collections.unmodifiableSet(brandSet);
}
Expand Down Expand Up @@ -173,7 +173,9 @@ protected CardComponentState createComponentState() {
card.setNumber(outputData.getCardNumberField().getValue());
}

card.setSecurityCode(isCvcHidden() ? null : outputData.getSecurityCodeField().getValue());
if (!isCvcHidden()) {
card.setSecurityCode(outputData.getSecurityCodeField().getValue());
}

final ExpiryDate expiryDateResult = outputData.getExpiryDateField().getValue();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public CardConfiguration[] newArray(int size) {
@NonNull List<CardType> supportCardTypes,
boolean hideCvc,
boolean hideCvcStoredCard
) {
) {
super(shopperLocale, environment, clientKey);

mPublicKey = publicKey;
Expand Down Expand Up @@ -319,7 +319,8 @@ public Builder setShowStorePaymentField(boolean showStorePaymentField) {

/**
* Set the unique reference for the shopper doing this transaction.
* This value will simply be passed back to you in the {@link com.adyen.checkout.base.model.payments.request.PaymentComponentData} for convenience.
* This value will simply be passed back to you in the {@link com.adyen.checkout.base.model.payments.request.PaymentComponentData}
* for convenience.
*
* @param shopperReference The unique shopper reference
* @return {@link CardConfiguration.Builder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void onChanged(@Nullable CardOutputData cardOutputData) {
if (cardOutputData != null) {
onCardNumberValidated(cardOutputData.getCardNumberField());
onExpiryDateValidated(cardOutputData.getExpiryDateField());
mSecurityCodeInput.setVisibility( cardOutputData.isCvcHidden() ? GONE : VISIBLE);
mSecurityCodeInput.setVisibility(cardOutputData.isCvcHidden() ? GONE : VISIBLE);
}

if (getComponent().isStoredPaymentMethod()) {
Expand Down

0 comments on commit 715703c

Please sign in to comment.