Skip to content

Customizing Operation Form Data

Roman Štrobl edited this page Mar 18, 2018 · 30 revisions

When creating an operation, you can customize the operation form data. This customization has an effect on how the operation form data is displayed during the operation review step.

The customization should be done by the client which initiates the operation before the authentication process is initiated.

// variable definition
String account = "238400856/0300";
BigDecimal amount = BigDecimal.valueOf(100);
String currency = "CZK";
String note = "Utility Bill Payment - 05/2017";
String dueDate = "2017-06-29";

// operation form data initialization
OperationFormData formData = new OperationFormData();
formData.addTitle("operation.title");
formData.addGreeting("operation.greeting");
formData.addSummary("operation.summary");
formData.addAmount("operation.amount", amount, "operation.currency", currency);
formData.addKeyValue("operation.account", account, OperationFormFieldAttributeFormatted.ValueFormatType.ACCOUNT);
formData.addKeyValue("operation.dueDate", dueDate, OperationFormFieldAttributeFormatted.ValueFormatType.DATE);
formData.addNote("operation.note", note, OperationFormFieldAttributeFormatted.ValueFormatType.TEXT);

// sample operation configuration for bank account choice select
OperationFormFieldConfig bankAccountConfig = new OperationFormFieldConfig();
bankAccountConfig.setId("operation.bankAccountChoice");
bankAccountConfig.setEnabled(false);
bankAccountConfig.setDefaultValue("CZ4043210000000087654321");
formData.getConfig().add(bankAccountConfig);

// operation initialization
final ObjectResponse<CreateOperationResponse> payment = client.createOperation("authorize_payment", data, formData, null);
session.setAttribute("operationId", payment.getResponseObject().getOperationId());
Clone this wiki locally