Source:
<code>public void processGatewayAuthorisationResponse( String chargeExternalId, ChargeStatus oldChargeStatus, AppleDecryptedPaymentData applePaymentData, GatewayResponse<BaseAuthoriseResponse> operationResponse) { logger.info("Processing gateway auth response for apple pay"); Optional<String> transactionId = extractTransactionId(chargeExternalId, operationResponse); ChargeStatus status = extractChargeStatus(operationResponse.getBaseResponse(), operationResponse.getGatewayError()); <START> AuthCardDetails authCardDetailsToBePersisted = new AuthCardDetails(); <END> authCardDetailsToBePersisted.setCardHolder(applePaymentData.getPaymentInfo().getCardholderName()); authCardDetailsToBePersisted.setCardNo(applePaymentData.getPaymentInfo().getLastDigitsCardNumber()); authCardDetailsToBePersisted.setPayersCardType(applePaymentData.getPaymentInfo().getCardType()); authCardDetailsToBePersisted.setCardBrand(applePaymentData.getPaymentInfo().getBrand()); authCardDetailsToBePersisted.setEndDate(applePaymentData.getApplicationExpirationDate().format(EXPIRY_DATE_FORMAT)); authCardDetailsToBePersisted.setCorporateCard(false); ChargeEntity updatedCharge = chargeService.updateChargePostAuthorisation( chargeExternalId, status, transactionId, Optional.empty(), operationResponse.getSessionIdentifier(), authCardDetailsToBePersisted, Optional.of(WalletType.APPLE_PAY)); logger.info("Authorisation for ({} {}) for ({}) - .'. -> {}", updatedCharge.getExternalId(), updatedCharge.getPaymentGatewayName().getName(), transactionId.orElse("missing transaction ID"), updatedCharge.getGatewayAccount().getAnalyticsId(), updatedCharge.getGatewayAccount().getId(), operationResponse, oldChargeStatus, status); metricRegistry.counter(String.format( "gateway-operations.%s.%s.%s.authorise.result.%s", updatedCharge.getGatewayAccount().getGatewayName(), updatedCharge.getGatewayAccount().getType(), updatedCharge.getGatewayAccount().getId(), status.toString())).inc(); }</code><technical_language>I a converter method nice here? AuthCardDetails.from(blah something</technical_language>

Target:
public void processGatewayAuthorisationResponse( String chargeExternalId, ChargeStatus oldChargeStatus, AppleDecryptedPaymentData applePaymentData, GatewayResponse<BaseAuthoriseResponse> operationResponse) { logger.info("Processing gateway auth response for apple pay"); Optional<String> transactionId = extractTransactionId(chargeExternalId, operationResponse); ChargeStatus status = extractChargeStatus(operationResponse.getBaseResponse(), operationResponse.getGatewayError()); AuthCardDetails authCardDetailsToBePersisted = authCardDetailsFor(applePaymentData); ChargeEntity updatedCharge = chargeService.updateChargePostApplePayAuthorisation( chargeExternalId, status, transactionId, Optional.empty(), operationResponse.getSessionIdentifier(), authCardDetailsToBePersisted); logger.info("Authorisation for ({} {}) for ({}) - .'. -> {}", updatedCharge.getExternalId(), updatedCharge.getPaymentGatewayName().getName(), transactionId.orElse("missing transaction ID"), updatedCharge.getGatewayAccount().getAnalyticsId(), updatedCharge.getGatewayAccount().getId(), operationResponse, oldChargeStatus, status); metricRegistry.counter(String.format( "gateway-operations.%s.%s.%s.authorise.result.%s", updatedCharge.getGatewayAccount().getGatewayName(), updatedCharge.getGatewayAccount().getType(), updatedCharge.getGatewayAccount().getId(), status.toString())).inc(); }