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 e2ab4ee1
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
22db167b
Pipeline
#174
running
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 @
e2ab4ee
/*
* 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
{
...
...
code/moya-web/WebContent/resources/cditools/bills/verkkomaksubuttons.xhtml
View file @
e2ab4ee
...
...
@@ -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"
>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/shop/BillEditView.java
View file @
e2ab4ee
...
...
@@ -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
()
...
...
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