Commit e2ab4ee1 by Tuomas Riihimäki

Add property to enable v2 checkout

1 parent 22db167b
Pipeline #174 running
in 0 seconds
......@@ -62,6 +62,7 @@ public enum LanEventPropertyKey {
*/
EVENT_CURRENCY_CODE(Type.TEXT, "EUR"),
ALLOW_FREE_BILLS(Type.BOOL),
KEYCHECKOUT_V2_ENABLED(Type.BOOL)
;
public enum Type {
......
......@@ -30,9 +30,7 @@
});
</script>
</ui:fragment>
<!--
<ui:fragment rendered="#{billEditView.checkoutFiAvailable}">
LEGACY checkout
<table border="0">
<tr>
......@@ -52,7 +50,6 @@
</tr>
</table>
</ui:fragment>
-->
<ui:fragment rendered="#{billEditView.checkoutFiV2Available}">
<table border="0">
......
......@@ -26,7 +26,10 @@ import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import fi.codecrew.moya.beans.CheckoutFiV2BeanLocal;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.checkout.CheckoutCreateResponsePojo;
import fi.codecrew.moya.model.LanEventProperty;
import fi.codecrew.moya.model.LanEventPropertyKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -60,6 +63,8 @@ public class BillEditView extends GenericCDIView {
private transient CheckoutFiV2BeanLocal checkoutV2Bean;
@EJB
private transient BillBeanLocal billbean;
@EJB
private transient EventBeanLocal eventbean;
private List<CheckoutBank> checkoutFiToken;
private CheckoutCreateResponsePojo checkoutFiV2Token;
......@@ -82,12 +87,14 @@ public class BillEditView extends GenericCDIView {
}
public boolean getCheckoutFiV2Available() {
return bill != null && !bill.isPaid() && checkoutbean.isPaymentEnabled();
boolean v2Enabled = eventbean.getPropertyBoolean(LanEventPropertyKey.KEYCHECKOUT_V2_ENABLED);
return v2Enabled && bill != null && !bill.isPaid() && checkoutbean.isPaymentEnabled();
}
public boolean isCheckoutFiAvailable()
{
return bill != null && !bill.isPaid() && checkoutbean.isPaymentEnabled();
boolean v2Enabled = eventbean.getPropertyBoolean(LanEventPropertyKey.KEYCHECKOUT_V2_ENABLED);
return !v2Enabled && bill != null && !bill.isPaid() && checkoutbean.isPaymentEnabled();
}
public boolean isVerkkomaksuFiAvailable()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!