Troubleshooting
Problem
Is out of the box Amount to Charge field in non-editable for payment group - STORED_VALUE_CARD and OTHER? In case, if it is not then what are the options available to acheive this requirement?
Resolving The Problem
COM has limited support on MaxChargeLimit. Out of the box Amount to Charge field in non-editable for payment group - STORED_VALUE_CARD and OTHER. To achieve the user requirement, there are couple of options:
Option 1:
YFSGetFundsAvailableUE, gets the MaxChargeLimit set in UI. This value can be set as FundsAvailable in UE output. For e.g. If FundsAvailable is 200.00 and MaxChargeLimit is 50.00, in the UE, set FundsAvailable to 50.00. But if FundsAvailable is 200.00 and MaxChargeLimit is 250.00, keep the FundsAvailable to 200.00
Sample implementation:
public class YFSGetFundsAvailableUEImpl implements YFSGetFundsAvailableUE {
private static final double FUNDS_AVAILABLE = 200.00;
@Override
public Document getFundsAvailable(YFSEnvironment arg0, Document indoc)
throws YFSUserExitException {
YFCDocument yDoc = YFCDocument.getDocumentFor(indoc);
double value = Double.parseDouble(yDoc.getElementsByTagName("PaymentMethod").item(0).getAttribute("MaxChargeLimit"));
if(FUNDS_AVAILABLE < value){
value = FUNDS_AVAILABLE;
}
YFCDocument outdoc = null;
try {
outdoc = YFCDocument.parse("<PaymentMethod FundsAvailable=\""+value+"\"/>");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return outdoc.getDocument();
}
}
Option 2:
Extend the Confirm Payment screen in COM to keep an editable text box against Amount to Charge field, instead of non-editable text box available OOB.
Was this topic helpful?
Document Information
Modified date:
11 February 2020
UID
swg21639914