increase rounding mode to 4
This commit is contained in:
@@ -24,5 +24,6 @@ public class SdkActionDto {
|
||||
private Boolean sandbox;
|
||||
private String paymentProcessorLabel;
|
||||
private String responseUrl;
|
||||
|
||||
private String returnUrl;
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ public class MPGSWebPaymentProcessor implements TransactionProcessorInterface {
|
||||
private String clientSecret;
|
||||
@Value("${steward.payment.processor.url}")
|
||||
private String url;
|
||||
@Value("${mpgs.return-url}")
|
||||
private String returnUrl;
|
||||
|
||||
@Override
|
||||
public Object process(Transaction transaction) throws Exception {
|
||||
@@ -75,6 +77,7 @@ public class MPGSWebPaymentProcessor implements TransactionProcessorInterface {
|
||||
.sandbox(true)
|
||||
.paymentProcessorLabel("MPGS")
|
||||
.responseUrl("https://stewardbank.co.zw")
|
||||
.returnUrl(returnUrl + "/" + transaction.getReference())
|
||||
.build();
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
|
||||
@@ -119,9 +119,9 @@ public class PurchaseInvoiceHandler implements HandlerInterface {
|
||||
Provider provider = providerService.getProviderRepository()
|
||||
.findByClientId(transaction.getBillClientId());
|
||||
BigDecimal commissionPercentage = BigDecimal.valueOf(provider.getPercentageCommission())
|
||||
.divide(BigDecimal.valueOf(100), 2, RoundingMode.CEILING);
|
||||
.divide(BigDecimal.valueOf(100), 4, RoundingMode.CEILING);
|
||||
BigDecimal commission = transaction.getAmount().multiply(commissionPercentage)
|
||||
.setScale(2, RoundingMode.CEILING);
|
||||
.setScale(4, RoundingMode.CEILING);
|
||||
BigDecimal amount = transaction.getAmount().subtract(commission);
|
||||
|
||||
PurchaseTaxDto purchaseTaxDto = PurchaseTaxDto.builder()
|
||||
|
||||
@@ -28,6 +28,8 @@ sbz.aggregator.encryption-key=91b5b3c7-860f-473c-ac5c-b12d9121819b
|
||||
|
||||
steward.payment.processor.url=${sbz.merchant.url}
|
||||
|
||||
mpgs.return-url=https://vdt.co.zw/#/return
|
||||
|
||||
# ERPNext Configuration
|
||||
erpnext.url=http://62.171.179.108:8080/api
|
||||
erpnext.api.key=dff94c65b52ecbd
|
||||
|
||||
Reference in New Issue
Block a user