Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5edaf1b8
authored
Nov 16, 2019
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add property to enable v2 checkout
1 parent
acaa0805
Pipeline
#173
failed
in 0 seconds
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
19 deletions
code/moya-database/src/main/java/fi/codecrew/moya/model/LanEventPropertyKey.java
code/moya-web/WebContent/resources/cditools/bills/verkkomaksubuttons.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/shop/BillEditView.java
code/moya-database/src/main/java/fi/codecrew/moya/model/LanEventPropertyKey.java
View file @
5edaf1b
/*
/*
* Copyright Codecrew Ry
* Copyright Codecrew Ry
*
*
* All rights reserved.
* All rights reserved.
*
*
* This license applies to any software containing a notice placed by the
* This license applies to any software containing a notice placed by the
* copyright holder. Such software is herein referred to as the Software.
* copyright holder. Such software is herein referred to as the Software.
* This license covers modification, distribution and use of the Software.
* This license covers modification, distribution and use of the Software.
*
*
* Any distribution and use in source and binary forms, with or without
* Any distribution and use in source and binary forms, with or without
* modification is not permitted without explicit written permission from the
* modification is not permitted without explicit written permission from the
* copyright owner.
* copyright owner.
*
*
* A non-exclusive royalty-free right is granted to the copyright owner of the
* 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
* Software to use, modify and distribute all modifications to the Software in
* future versions of the Software.
* future versions of the Software.
*
*
*/
*/
package
fi
.
codecrew
.
moya
.
model
;
package
fi
.
codecrew
.
moya
.
model
;
...
@@ -62,6 +62,7 @@ public enum LanEventPropertyKey {
...
@@ -62,6 +62,7 @@ public enum LanEventPropertyKey {
*/
*/
EVENT_CURRENCY_CODE
(
Type
.
TEXT
,
"EUR"
),
EVENT_CURRENCY_CODE
(
Type
.
TEXT
,
"EUR"
),
ALLOW_FREE_BILLS
(
Type
.
BOOL
),
ALLOW_FREE_BILLS
(
Type
.
BOOL
),
KEYCHECKOUT_V2_ENABLED
(
Type
.
BOOL
)
;
;
public
enum
Type
{
public
enum
Type
{
...
...
code/moya-web/WebContent/resources/cditools/bills/verkkomaksubuttons.xhtml
View file @
5edaf1b
...
@@ -30,9 +30,7 @@
...
@@ -30,9 +30,7 @@
});
});
</script>
</script>
</ui:fragment>
</ui:fragment>
<!--
<ui:fragment
rendered=
"#{billEditView.checkoutFiAvailable}"
>
<ui:fragment
rendered=
"#{billEditView.checkoutFiAvailable}"
>
LEGACY checkout
<table
border=
"0"
>
<table
border=
"0"
>
<tr>
<tr>
...
@@ -52,7 +50,6 @@
...
@@ -52,7 +50,6 @@
</tr>
</tr>
</table>
</table>
</ui:fragment>
</ui:fragment>
-->
<ui:fragment
rendered=
"#{billEditView.checkoutFiV2Available}"
>
<ui:fragment
rendered=
"#{billEditView.checkoutFiV2Available}"
>
<table
border=
"0"
>
<table
border=
"0"
>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/shop/BillEditView.java
View file @
5edaf1b
...
@@ -26,7 +26,10 @@ import javax.enterprise.context.ConversationScoped;
...
@@ -26,7 +26,10 @@ import javax.enterprise.context.ConversationScoped;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
fi.codecrew.moya.beans.CheckoutFiV2BeanLocal
;
import
fi.codecrew.moya.beans.CheckoutFiV2BeanLocal
;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.beans.checkout.CheckoutCreateResponsePojo
;
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.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -60,6 +63,8 @@ public class BillEditView extends GenericCDIView {
...
@@ -60,6 +63,8 @@ public class BillEditView extends GenericCDIView {
private
transient
CheckoutFiV2BeanLocal
checkoutV2Bean
;
private
transient
CheckoutFiV2BeanLocal
checkoutV2Bean
;
@EJB
@EJB
private
transient
BillBeanLocal
billbean
;
private
transient
BillBeanLocal
billbean
;
@EJB
private
transient
EventBeanLocal
eventbean
;
private
List
<
CheckoutBank
>
checkoutFiToken
;
private
List
<
CheckoutBank
>
checkoutFiToken
;
private
CheckoutCreateResponsePojo
checkoutFiV2Token
;
private
CheckoutCreateResponsePojo
checkoutFiV2Token
;
...
@@ -82,12 +87,14 @@ public class BillEditView extends GenericCDIView {
...
@@ -82,12 +87,14 @@ public class BillEditView extends GenericCDIView {
}
}
public
boolean
getCheckoutFiV2Available
()
{
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
()
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
()
public
boolean
isVerkkomaksuFiAvailable
()
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment