Commit e2ab4ee1 by Tuomas Riihimäki

Add property to enable v2 checkout

1 parent 22db167b
Pipeline #174 running
in 0 seconds
/*
* Copyright Codecrew Ry
*
*
* All rights reserved.
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
*
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* copyright owner.
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
*
*/
package fi.codecrew.moya.model;
......@@ -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!