delete some colums from payment start record
This commit is contained in:
@@ -50,32 +50,14 @@ public class PaymentStartRecord extends Auditable {
|
||||
@Column(name = "txn_id")
|
||||
private String txnId;
|
||||
|
||||
@Column(name = "qr_string", columnDefinition = "TEXT")
|
||||
private String qrString;
|
||||
|
||||
// `createdOn` is provided by the base `Auditable` class as a LocalDateTime field,
|
||||
// so we must not redeclare it here (it caused an incompatible return-type error).
|
||||
// The Auditable base class already defines `createdOn` of type LocalDateTime.
|
||||
|
||||
// New callback-related fields
|
||||
@Column(name = "callback_status")
|
||||
private String callbackStatus;
|
||||
|
||||
@Column(name = "bank_response", columnDefinition = "TEXT")
|
||||
private String bankResponse;
|
||||
|
||||
@Column(name = "signature")
|
||||
private String signature;
|
||||
|
||||
// Store original request body and full response body
|
||||
@Column(name = "request_body", columnDefinition = "TEXT")
|
||||
private String requestBody;
|
||||
|
||||
@Column(name = "response_body", columnDefinition = "TEXT")
|
||||
private String responseBody;
|
||||
|
||||
@Column(name = "response_type")
|
||||
private String responseType; // e.g., "QR", "HTML", "JSON"
|
||||
private String responseType;
|
||||
|
||||
@Column(name = "txn_status")
|
||||
private String txnStatus;
|
||||
|
||||
@@ -164,8 +164,7 @@ public class PaymentStartServiceImpl implements PaymentStartService {
|
||||
|
||||
// success: persist and return
|
||||
helper.updateInboundLogSuccess(inboundLog, respBody, String.valueOf(outcomeCode));
|
||||
String responseType = (apiResponse.getResponseData() != null && apiResponse.getResponseData().getQrString() != null && !apiResponse.getResponseData().getQrString().isEmpty()) ? BBPSConstant.RESPONSE_TYPE_QR : BBPSConstant.RESPONSE_TYPE_JSON;
|
||||
|
||||
String responseType = BBPSConstant.RESPONSE_TYPE_INTENT;
|
||||
bbpsMapperHelper.savePaymentStartRecord(request, apiResponse, txnId, orderNo, requestJson, respBody, responseType);
|
||||
LOGGER.info("[startIntentPayment] saved record txnId={} orderNo={} responseType={}", txnId, orderNo, responseType);
|
||||
|
||||
@@ -294,7 +293,7 @@ public class PaymentStartServiceImpl implements PaymentStartService {
|
||||
LOGGER.info("[startWebPayment] received HTML response txnId={} length={}", txnId, respBody.length());
|
||||
|
||||
// Save record with HTML (persist original request and HTML response)
|
||||
String responseTypeWeb = BBPSConstant.RESPONSE_TYPE_HTML;
|
||||
String responseTypeWeb = BBPSConstant.RESPONSE_TYPE_WEB;
|
||||
String rawResponseWeb = respBody == null ? "" : respBody;
|
||||
|
||||
// Try to extract useful fields from returned HTML (txnId, amount, mid)
|
||||
@@ -313,7 +312,7 @@ public class PaymentStartServiceImpl implements PaymentStartService {
|
||||
rd.setAmount(parsedAmount != null && !parsedAmount.isEmpty() ? parsedAmount : "0.00");
|
||||
rd.setMid(parsedMid);
|
||||
rd.setOrderNo(orderNo);
|
||||
rd.setQrString("HTML_RESPONSE");
|
||||
rd.setQrString(BBPSConstant.RESPONSE_TYPE_WEB);
|
||||
rd.setCreatedOn(LocalDateTime.now().toString());
|
||||
|
||||
apiResp.setResponseData(rd);
|
||||
@@ -401,10 +400,7 @@ public class PaymentStartServiceImpl implements PaymentStartService {
|
||||
return new ResponseModel(BBPSConstant.MSG_NO_MATCHING_RECORD, BBPSConstant.MERCHANT_ACK_NO_MATCH, BBPSConstant.HTTP_OK_INT, null);
|
||||
}
|
||||
|
||||
// Update record with bank response and signature
|
||||
record.setBankResponse(decrypted);
|
||||
record.setSignature(signature);
|
||||
// update txn status and callback timestamp
|
||||
record.setTxnStatus(txnStatus);
|
||||
record.setCallbackReceivedOn(java.time.LocalDateTime.now().toString());
|
||||
|
||||
|
||||
@@ -222,6 +222,9 @@ public class BBPSConstant extends BBPS_RESPONSE_COD_CONSTANT {
|
||||
public static final String INTERNALSERVER_ERROR_STR = "600";
|
||||
public static final String USER_UNAUTHORIZED_STR = "401";
|
||||
public static final String OK_STR = "200";
|
||||
public static final String RESPONSE_TYPE_INTENT = "INTENT";
|
||||
public static final String RESPONSE_TYPE_WEB = "WEB";
|
||||
|
||||
|
||||
// Newly added constant for invalid JSON status code
|
||||
|
||||
|
||||
@@ -721,7 +721,6 @@ public class BillerMapperHelper {
|
||||
parent.setUserId(responseWrapper.getUserId());
|
||||
// Map incoming DTO date strings into Auditable LocalDateTime fields
|
||||
Date parentCreatedOn = parseToDate(responseWrapper.getCreationDate());
|
||||
|
||||
Date parentUpdatedOn = parseToDate(responseWrapper.getModifiedDate());
|
||||
parent.setCreatedEpochDate(responseWrapper.getCreatedEpochDate());
|
||||
parent.setModifiedEpochDate(responseWrapper.getModifiedEpochDate());
|
||||
@@ -1130,9 +1129,6 @@ public class BillerMapperHelper {
|
||||
record.setTxnId(Optional.ofNullable(
|
||||
apiResponse.getResponseData().getTxnId()).orElse("DUMMY_TXN"));
|
||||
|
||||
record.setQrString(Optional.ofNullable(
|
||||
apiResponse.getResponseData().getQrString()).orElse("NO_QR"));
|
||||
|
||||
Date createdOn = parseToDate(apiResponse.getResponseData().getCreatedOn());
|
||||
|
||||
record.setTxnStatus("PENDING");
|
||||
@@ -1141,9 +1137,6 @@ public class BillerMapperHelper {
|
||||
record.setTxnStatus("PENDING");
|
||||
}
|
||||
|
||||
// Raw request/response
|
||||
record.setRequestBody(requestJson);
|
||||
record.setResponseBody(rawResponse);
|
||||
record.setResponseType(responseType);
|
||||
|
||||
return paymentStartRecordRepository.save(record);
|
||||
|
||||
Reference in New Issue
Block a user