release
This commit is contained in:
parent
22d6066933
commit
b87f987466
32
AGENT.MD
Normal file
32
AGENT.MD
Normal file
@ -0,0 +1,32 @@
|
||||
# Ponytail, lazy senior dev mode
|
||||
|
||||
You are a lazy senior developer. Lazy means efficient, not careless. The best code is the code never written.
|
||||
|
||||
Before writing any code, stop at the first rung that holds:
|
||||
|
||||
1. Does this need to be built at all? (YAGNI)
|
||||
2. Does it already exist in this codebase? Reuse the helper, util, or pattern that's already here, don't re-write it.
|
||||
3. Does the standard library already do this? Use it.
|
||||
4. Does a native platform feature cover it? Use it.
|
||||
5. Does an already-installed dependency solve it? Use it.
|
||||
6. Can this be one line? Make it one line.
|
||||
7. Only then: write the minimum code that works.
|
||||
|
||||
The ladder runs after you understand the problem, not instead of it: read the task and the code it touches, trace the real flow end to end, then climb.
|
||||
|
||||
Bug fix = root cause, not symptom: a report names a symptom. Grep every caller of the function you touch and fix the shared function once — one guard there is a smaller diff than one per caller, and patching only the path the ticket names leaves a sibling caller still broken.
|
||||
|
||||
Rules:
|
||||
|
||||
- No abstractions that weren't explicitly requested.
|
||||
- No new dependency if it can be avoided.
|
||||
- No boilerplate nobody asked for.
|
||||
- Deletion over addition. Boring over clever. Fewest files possible.
|
||||
- Shortest working diff wins, but only once you understand the problem. The smallest change in the wrong place isn't lazy, it's a second bug.
|
||||
- Question complex requests: "Do you actually need X, or does Y cover it?"
|
||||
- Pick the edge-case-correct option when two stdlib approaches are the same size, lazy means less code, not the flimsier algorithm.
|
||||
- Mark intentional simplifications with a `ponytail:` comment. If the shortcut has a known ceiling (global lock, O(n²) scan, naive heuristic), the comment names the ceiling and the upgrade path.
|
||||
|
||||
Not lazy about: understanding the problem (read it fully and trace the real flow before picking a rung, a small diff you don't understand is just laziness dressed up as efficiency), input validation at trust boundaries, error handling that prevents data loss, security, accessibility, the calibration real hardware needs (the platform is never the spec ideal, a clock drifts, a sensor reads off), anything explicitly requested. Lazy code without its check is unfinished: non-trivial logic leaves ONE runnable check behind, the smallest thing that fails if the logic breaks (an assert-based demo/self-check or one small test file; no frameworks, no fixtures). Trivial one-liners need no test.
|
||||
|
||||
(Yes, this file also applies to agents working on the ponytail repo itself. Especially to them.)
|
||||
18
CHANGELOG.md
18
CHANGELOG.md
@ -16,3 +16,21 @@
|
||||
- But can auto enable when password is correct in function tab
|
||||
- **Void Fixed**
|
||||
- Void transaction fixed
|
||||
|
||||
## [2.34] - 29-05-2026
|
||||
- **General**
|
||||
- Settlement fix for qr records missing after Card settlement run
|
||||
- fixed receipt printing loop for auto settlement
|
||||
-
|
||||
- **MMQR Refund**
|
||||
- new auto-retry when MMQR status is "REFUNDING" in response
|
||||
- no more fail records on refund list if "DUPLICATED" response
|
||||
- removed "CANCEL" records in MMQR History
|
||||
-
|
||||
- **CARD Payments**
|
||||
- signature saved in pos device
|
||||
- signature re-show on re-printing receipt
|
||||
- signature re-show on void
|
||||
- signature re-show on refund
|
||||
- pre-auth, pre-auth can, pre-auth com s' manual entry flow are changed
|
||||
- can show/hide manual entry in all transactions
|
||||
@ -14,8 +14,8 @@ android {
|
||||
applicationId "com.utsmm.kbz"
|
||||
minSdk 24
|
||||
targetSdk 33
|
||||
versionCode 36
|
||||
versionName "2.31"
|
||||
versionCode 39
|
||||
versionName "2.34"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
||||
@ -158,10 +158,10 @@ public class MainActivity extends AppCompatActivity implements
|
||||
private void initKey(){
|
||||
// SystemParamsOperation.getInstance().setTmsAddress("https://api-tms.kbzbank.com/sirius");
|
||||
// SystemParamsOperation.getInstance().setEReceiptAddress("https://api-tms.kbzbank.com/receipt");
|
||||
// SystemParamsOperation.getInstance().setTmsAddress("https://api-tms-uat.kbzbank.com:8443/sirius");
|
||||
// SystemParamsOperation.getInstance().setEReceiptAddress("https://api-tms-uat.kbzbank.com:8443/receipt");
|
||||
SystemParamsOperation.getInstance().setTmsAddress("https://sirius-nest.utsmyanmar.com/api/v1");
|
||||
SystemParamsOperation.getInstance().setEReceiptAddress("https://receipt-nest.utsmyanmar.com");
|
||||
SystemParamsOperation.getInstance().setTmsAddress("https://api-tms-uat.kbzbank.com:8443/sirius");
|
||||
SystemParamsOperation.getInstance().setEReceiptAddress("https://api-tms-uat.kbzbank.com:8443/receipt");
|
||||
// SystemParamsOperation.getInstance().setTmsAddress("https://sirius-nest.utsmyanmar.com/api/v1");
|
||||
// SystemParamsOperation.getInstance().setEReceiptAddress("https://receipt-nest.utsmyanmar.com");
|
||||
|
||||
PinPad pinPad = MyApplication.getInstance().deviceEngine.getPinPad();
|
||||
byte[] encryptedPIK = SystemParamsOperation.getInstance().getPIK();
|
||||
|
||||
@ -345,12 +345,14 @@ public class ProcessingFragment extends DataBindingFragment {
|
||||
handleAfterTransaction();
|
||||
break;
|
||||
case SUCCESS:
|
||||
if(requiresSignature()){
|
||||
handleAfterTransaction();
|
||||
}else{
|
||||
sharedViewModel.pushReceipt(buildEReceiptCardReceipt(payDetail, true, BaseErrorCode.getCode(payDetail.getTradeAnswerCode())));
|
||||
handleAfterTransaction();
|
||||
}
|
||||
sharedViewModel.pushReceipt(buildEReceiptCardReceipt(payDetail, true, BaseErrorCode.getCode(payDetail.getTradeAnswerCode())));
|
||||
handleAfterTransaction();
|
||||
// if(requiresSignature()){
|
||||
// handleAfterTransaction();
|
||||
// }else{
|
||||
// sharedViewModel.pushReceipt(buildEReceiptCardReceipt(payDetail, true, BaseErrorCode.getCode(payDetail.getTradeAnswerCode())));
|
||||
// handleAfterTransaction();
|
||||
// }
|
||||
break;
|
||||
case OFFLINE_SUCCESS:
|
||||
if(SystemParamsOperation.getInstance().getDemoStatus()) {
|
||||
|
||||
@ -142,13 +142,13 @@ public class SignatureFragment extends DataBindingFragment {
|
||||
payDetail.setESignBlob(blob);
|
||||
sharedViewModel.payDetail.setValue(payDetail);
|
||||
sharedViewModel.updateESignBlob(payDetail.voucherNo, blob);
|
||||
EReceiptCardRequest request = EReceiptHelper.buildEReceiptCardReceipt(
|
||||
requireContext(),
|
||||
payDetail,
|
||||
true,
|
||||
BaseErrorCode.getCode(payDetail.getTradeAnswerCode()),
|
||||
null);
|
||||
sharedViewModel.pushReceiptWithImage(request, blob);
|
||||
// EReceiptCardRequest request = EReceiptHelper.buildEReceiptCardReceipt(
|
||||
// requireContext(),
|
||||
// payDetail,
|
||||
// true,
|
||||
// BaseErrorCode.getCode(payDetail.getTradeAnswerCode()),
|
||||
// null);
|
||||
// sharedViewModel.pushReceiptWithImage(request, blob);
|
||||
}
|
||||
|
||||
public class ClickEvent {
|
||||
|
||||
@ -328,7 +328,6 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
settlementViewModel.pre_breakdown.setValue(buildBreakdownText(mmkBucket.preCount, mmkBucket.preAmount, usdBucket.preCount, usdBucket.preAmount));
|
||||
settlementViewModel.refund_breakdown.setValue(buildBreakdownText(mmkBucket.refundCount, mmkBucket.refundAmount, usdBucket.refundCount, usdBucket.refundAmount));
|
||||
settlementViewModel.ca_breakdown.setValue(buildBreakdownText(mmkBucket.caCount, mmkBucket.caAmount, usdBucket.caCount, usdBucket.caAmount));
|
||||
|
||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.REVIEW_BATCH) {
|
||||
SettleData settleData = new SettleData(saleCount,saleAmount,preCount,preAmount,refundCount,refundAmount,caCount,caAmount);
|
||||
TradeData tradeData = Params.newTrade(false);
|
||||
@ -384,6 +383,11 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
}
|
||||
}
|
||||
|
||||
private String buildBreakdownText(int mmkCount, long mmkAmount, int usdCount, long usdAmount) {
|
||||
return "MMK " + mmkCount + " / " + POSUtil.getInstance().getDecimalAmountSeparatorFormat(mmkAmount)
|
||||
+ " USD " + usdCount + " / " + POSUtil.getInstance().getDecimalAmountSeparatorFormat(usdAmount);
|
||||
}
|
||||
|
||||
private CurrencyBucket getCurrencyBucket(String currencyCode) {
|
||||
return "USD".equals(normalizeCurrency(currencyCode)) ? usdBucket : mmkBucket;
|
||||
}
|
||||
@ -431,11 +435,6 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
}
|
||||
}
|
||||
|
||||
private String buildBreakdownText(int mmkCount, long mmkAmount, int usdCount, long usdAmount) {
|
||||
return "MMK " + mmkCount + " / " + POSUtil.getInstance().getDecimalAmountSeparatorFormat(mmkAmount)
|
||||
+ " USD " + usdCount + " / " + POSUtil.getInstance().getDecimalAmountSeparatorFormat(usdAmount);
|
||||
}
|
||||
|
||||
private String normalizeCurrency(String currencyCode) {
|
||||
if (currencyCode == null) {
|
||||
return "MMK";
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -11,8 +11,8 @@
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 33,
|
||||
"versionName": "2.13-uat",
|
||||
"versionCode": 39,
|
||||
"versionName": "2.34-uat",
|
||||
"outputFile": "app-uat-release.apk"
|
||||
}
|
||||
],
|
||||
|
||||
@ -116,7 +116,7 @@ public class EmvParamOperation extends ParamOperation{
|
||||
processPayWave();
|
||||
processPayPass();
|
||||
processQuickPass();
|
||||
processJSpeedy();
|
||||
// processJSpeedy();
|
||||
processMPUCtls();
|
||||
processChips();
|
||||
processRids();
|
||||
|
||||
@ -530,7 +530,7 @@
|
||||
"currencyCode": "0104"
|
||||
},
|
||||
{
|
||||
"aidEnable": true,
|
||||
"aidEnable": false,
|
||||
"aid": "A00000006510",
|
||||
"cardScheme": "JCB",
|
||||
"applicationVersion": "0200",
|
||||
@ -553,7 +553,7 @@
|
||||
"currencyCode": "0104"
|
||||
},
|
||||
{
|
||||
"aidEnable": true,
|
||||
"aidEnable": false,
|
||||
"aid": "A0000000651010",
|
||||
"cardScheme": "JCB",
|
||||
"applicationVersion": "0200",
|
||||
@ -576,7 +576,7 @@
|
||||
"currencyCode": "0104"
|
||||
},
|
||||
{
|
||||
"aidEnable": true,
|
||||
"aidEnable": false,
|
||||
"aid": "A0000001570040",
|
||||
"cardScheme": "JCB",
|
||||
"applicationVersion": "0200",
|
||||
|
||||
@ -214,31 +214,16 @@ public abstract class BaseXPrint {
|
||||
|
||||
protected void printTransDetailSettlement(PayDetail payDetail) {
|
||||
SettleData settleData = payDetail.getSettleDataObj();
|
||||
List<CardSettleData> cardSettleDataList = payDetail.getCardSettleData();
|
||||
CurrencySettlementSummary mmkSummary = new CurrencySettlementSummary();
|
||||
CurrencySettlementSummary usdSummary = new CurrencySettlementSummary();
|
||||
|
||||
if (cardSettleDataList != null && !cardSettleDataList.isEmpty()) {
|
||||
for (CardSettleData cardSettleData : cardSettleDataList) {
|
||||
CurrencySettlementSummary summary = "USD".equals(normalizeSettlementCurrency(cardSettleData.getCurrencyCode())) ? usdSummary : mmkSummary;
|
||||
applyCardSettlementSummary(summary, cardSettleData);
|
||||
}
|
||||
} else {
|
||||
mmkSummary.saleCount = settleData.getSaleCount();
|
||||
mmkSummary.saleAmount = settleData.getSaleAmount();
|
||||
mmkSummary.preAuthCompCount = settleData.getPreAuthCompCount();
|
||||
mmkSummary.preAuthCompAmount = settleData.getPreAuthCompAmount();
|
||||
mmkSummary.refundCount = settleData.getRefundCount();
|
||||
mmkSummary.refundAmount = settleData.getRefundAmount();
|
||||
mmkSummary.cashAdvanceCount = settleData.getCashAdvanceCount();
|
||||
mmkSummary.cashAdvanceAmount = settleData.getCashAdvanceAmount();
|
||||
}
|
||||
|
||||
printSettlementCurrencySection("MMK", mmkSummary);
|
||||
if (usdSummary.hasAnyValue()) {
|
||||
emptyLine(1);
|
||||
printSettlementCurrencySection("USD", usdSummary);
|
||||
}
|
||||
print3ColumnsString("TRX TYPE ", "CNT", "AMOUNT");
|
||||
print3ColumnsString("SALE ", countStringFormat(settleData.getSaleCount()), PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getSaleAmount(), SystemParamsOperation.getInstance().getDecimalEnable()));
|
||||
print3ColumnsString("VOID SALE ", countStringFormat(settleData.getVoidSaleCount()), "- " + PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getVoidSaleAmount(), SystemParamsOperation.getInstance().getDecimalEnable()));
|
||||
print3ColumnsString("PREAUTH COMP ", countStringFormat(settleData.getPreAuthCompCount()), PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getPreAuthCompAmount(), SystemParamsOperation.getInstance().getDecimalEnable()));
|
||||
print3ColumnsString("CASH ADV ", countStringFormat(settleData.getCashAdvanceCount()), PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getCashAdvanceAmount(), SystemParamsOperation.getInstance().getDecimalEnable()));
|
||||
print3ColumnsString("REFUND ", countStringFormat(settleData.getRefundCount()), "- " + PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getRefundAmount(), SystemParamsOperation.getInstance().getDecimalEnable()));
|
||||
dotBreak();
|
||||
long totalAmount = settleData.getSaleAmount() + settleData.getPreAuthCompAmount() + settleData.getCashAdvanceAmount()
|
||||
- settleData.getVoidSaleAmount() - settleData.getRefundAmount();
|
||||
print3ColumnsString("TOTAL ", "", PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount, SystemParamsOperation.getInstance().getDecimalEnable()));
|
||||
|
||||
emptyLine(2);
|
||||
}
|
||||
|
||||
@ -192,12 +192,7 @@ public class PrintXImpl extends BaseXPrint implements PrintX {
|
||||
printLogo();
|
||||
printMerchantHeader();
|
||||
printTransHeader(payDetail);
|
||||
List<com.utsmyanmar.paylibs.model.CardSettleData> cardSettleDataList = payDetail.getCardSettleData();
|
||||
if (cardSettleDataList != null && !cardSettleDataList.isEmpty()) {
|
||||
printTransDetailSettlement(payDetail, cardSettleDataList);
|
||||
} else {
|
||||
printTransDetailSettlement(payDetail);
|
||||
}
|
||||
printTransDetailSettlement(payDetail);
|
||||
// printTransFooterSummary();
|
||||
printTransFooterForSettlement();
|
||||
|
||||
|
||||
@ -42,10 +42,10 @@ public class SystemParamsSettings implements Serializable {
|
||||
|
||||
// private String tmsAddress = "https://api-tms.kbzbank.com/sirius";
|
||||
// private String ereceiptAddress = "https://api-tms.kbzbank.com/receipt";
|
||||
// private String tmsAddress = "https://api-tms-uat.kbzbank.com:8443/sirius";
|
||||
// private String ereceiptAddress = "https://api-tms-uat.kbzbank.com:8443/receipt";
|
||||
private String tmsAddress = "https://sirius-nest.utsmyanmar.com/api/v1";
|
||||
private String ereceiptAddress = "https://receipt-nest.utsmyanmar.com";
|
||||
private String tmsAddress = "https://api-tms-uat.kbzbank.com:8443/sirius";
|
||||
private String ereceiptAddress = "https://api-tms-uat.kbzbank.com:8443/receipt";
|
||||
// private String tmsAddress = "https://sirius-nest.utsmyanmar.com/api/v1";
|
||||
// private String ereceiptAddress = "https://receipt-nest.utsmyanmar.com";
|
||||
|
||||
private String binValues = "";
|
||||
private String restrictedBinValues = "";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user