ready to go code and improved
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.response;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.entites.PaymentStartRecord;
|
||||||
|
import com.billpaymentservice.bbps.entites.TransactionMaster;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PaymentStartWithTransactionDto {
|
||||||
|
private PaymentStartRecord paymentStartRecord;
|
||||||
|
private TransactionMaster transactionMaster;
|
||||||
|
}
|
||||||
@@ -53,10 +53,6 @@ public class PaymentStartRecord extends Auditable {
|
|||||||
@Column(name = "qr_string", columnDefinition = "TEXT")
|
@Column(name = "qr_string", columnDefinition = "TEXT")
|
||||||
private String qrString;
|
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
|
// New callback-related fields
|
||||||
@Column(name = "callback_status")
|
@Column(name = "callback_status")
|
||||||
private String callbackStatus;
|
private String callbackStatus;
|
||||||
@@ -67,13 +63,6 @@ public class PaymentStartRecord extends Auditable {
|
|||||||
@Column(name = "signature")
|
@Column(name = "signature")
|
||||||
private String 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")
|
@Column(name = "response_type")
|
||||||
private String responseType; // e.g., "QR", "HTML", "JSON"
|
private String responseType; // e.g., "QR", "HTML", "JSON"
|
||||||
|
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ public class PaymentStartServiceImpl implements PaymentStartService {
|
|||||||
record.setSignature(signature);
|
record.setSignature(signature);
|
||||||
// update txn status and callback timestamp
|
// update txn status and callback timestamp
|
||||||
record.setTxnStatus(txnStatus);
|
record.setTxnStatus(txnStatus);
|
||||||
record.setCallbackReceivedOn(java.time.LocalDateTime.now().toString());
|
record.setCallbackReceivedOn(LocalDateTime.now().toString());
|
||||||
|
|
||||||
String merchantStatus;
|
String merchantStatus;
|
||||||
if (!signatureMatches) {
|
if (!signatureMatches) {
|
||||||
|
|||||||
@@ -1141,9 +1141,7 @@ public class BillerMapperHelper {
|
|||||||
record.setTxnStatus("PENDING");
|
record.setTxnStatus("PENDING");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Raw request/response
|
|
||||||
record.setRequestBody(requestJson);
|
|
||||||
record.setResponseBody(rawResponse);
|
|
||||||
record.setResponseType(responseType);
|
record.setResponseType(responseType);
|
||||||
|
|
||||||
return paymentStartRecordRepository.save(record);
|
return paymentStartRecordRepository.save(record);
|
||||||
|
|||||||
Reference in New Issue
Block a user