use of org.olat.resource.accesscontrol.provider.paypal.model.PaypalTransactionStatus in project OpenOLAT by OpenOLAT.
the class PaypalAccessController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
setFormTitle("access.paypal.title");
setFormDescription("access.paypal.desc");
setFormTitleIconCss("o_icon o_icon-fw " + PaypalAccessHandler.METHOD_CSS_CLASS + "_icon");
String uuid = (String) ureq.getUserSession().getEntry("paypal-uuid");
if (StringHelper.containsNonWhitespace(uuid)) {
PaypalTransaction transaction = paypalManager.loadTransactionByUUID(uuid);
PaypalTransactionStatus status = transaction.getStatus();
if (status == PaypalTransactionStatus.CANCELED) {
setFormWarning("paypal.cancelled.transaction");
} else if (status == PaypalTransactionStatus.ERROR) {
setFormWarning("paypal.error.transaction");
}
}
String description = link.getOffer().getDescription();
if (StringHelper.containsNonWhitespace(description)) {
description = StringHelper.xssScan(description);
uifactory.addStaticTextElement("offer.description", description, formLayout);
}
Price price = link.getOffer().getPrice();
String priceStr = PriceFormat.fullFormat(price);
uifactory.addStaticTextElement("offer.price", priceStr, formLayout);
final FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonLayout", getTranslator());
buttonGroupLayout.setRootForm(mainForm);
formLayout.add(buttonGroupLayout);
uifactory.addFormSubmitButton("access.button", formLayout);
}
use of org.olat.resource.accesscontrol.provider.paypal.model.PaypalTransactionStatus in project openolat by klemens.
the class PaypalAccessController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
setFormTitle("access.paypal.title");
setFormDescription("access.paypal.desc");
setFormTitleIconCss("o_icon o_icon-fw " + PaypalAccessHandler.METHOD_CSS_CLASS + "_icon");
String uuid = (String) ureq.getUserSession().getEntry("paypal-uuid");
if (StringHelper.containsNonWhitespace(uuid)) {
PaypalTransaction transaction = paypalManager.loadTransactionByUUID(uuid);
PaypalTransactionStatus status = transaction.getStatus();
if (status == PaypalTransactionStatus.CANCELED) {
setFormWarning("paypal.cancelled.transaction");
} else if (status == PaypalTransactionStatus.ERROR) {
setFormWarning("paypal.error.transaction");
}
}
String description = link.getOffer().getDescription();
if (StringHelper.containsNonWhitespace(description)) {
description = StringHelper.xssScan(description);
uifactory.addStaticTextElement("offer.description", description, formLayout);
}
Price price = link.getOffer().getPrice();
String priceStr = PriceFormat.fullFormat(price);
uifactory.addStaticTextElement("offer.price", priceStr, formLayout);
final FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonLayout", getTranslator());
buttonGroupLayout.setRootForm(mainForm);
formLayout.add(buttonGroupLayout);
uifactory.addFormSubmitButton("access.button", formLayout);
}
Aggregations