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 6bc4ad89
authored
Dec 08, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Paytrail fix
1 parent
bab9eed7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
61 deletions
code/moya-web/WebContent/bill/showBill.xhtml
code/moya-web/WebContent/resources/cditools/bills/verkkomaksubuttons.xhtml
code/moya-web/WebContent/resources/cditools/products/shop.xhtml
code/moya-web/WebContent/shop/createBill.xhtml
code/moya-web/WebContent/shop/showCreatedBill.xhtml
code/moya-web/WebContent/bill/showBill.xhtml
View file @
6bc4ad8
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
xmlns:bill=
"http://java.sun.com/jsf/composite/cditools/bills"
xmlns:p=
"http://primefaces.org/ui"
xmlns:f=
"http://java.sun.com/jsf/core"
>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
xmlns:bill=
"http://java.sun.com/jsf/composite/cditools/bills"
xmlns:p=
"http://primefaces.org/ui"
xmlns:f=
"http://java.sun.com/jsf/core"
>
<h:body>
...
...
@@ -14,39 +20,51 @@
<h1>
#{i18n['page.bill.show.header']}
</h1>
</ui:define>
<ui:define
name=
"content"
>
<p:outputPanel
id=
"billPanel"
>
<ui:fragment
rendered=
"#{billEditView.bill.paid}"
>
<h:outputText
value=
"#{i18n['bill.billIsPaid']}"
/>
<br
/>
<h:outputText
value=
"#{i18n['bill.billPaidDate']}"
/>
:
<p:outputPanel
id=
"billPanel"
>
<ui:fragment
rendered=
"#{billEditView.bill.paid}"
>
<h:outputText
value=
"#{i18n['bill.billIsPaid']}"
/>
<br
/>
<h:outputText
value=
"#{i18n['bill.billPaidDate']}"
/>
:
<h:outputText
value=
"#{billEditView.bill.paidDate}"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</ui:fragment>
<br
/>
<bill:showBill
bill=
"#{billEditView.bill}"
/>
<bill:verkkomaksubuttons
rendered=
"#{!billEditView.bill.paid and !billEditView.bill.expired}"
/>
<p:outputPanel
rendered=
"#{billEditView.bill.foodwaveBill}"
>
<span
class=
"notify"
><h:outputText
value=
"#{i18n['foodshop.canBuyToCounter']}"
/></span>
</p:outputPanel>
<br
/>
<p:outputPanel
rendered=
"#{!billEditView.bill.paid and !billEditView.bill.expired}"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</ui:fragment>
<br
/>
<bill:showBill
bill=
"#{billEditView.bill}"
/>
<bill:verkkomaksubuttons
rendered=
"#{!billEditView.bill.paid and !billEditView.bill.expired}"
/>
<p:outputPanel
rendered=
"#{billEditView.bill.foodwaveBill}"
>
<span
class=
"notify"
><h:outputText
value=
"#{i18n['foodshop.canBuyToCounter']}"
/></span>
</p:outputPanel>
<br
/>
<p:outputPanel
rendered=
"#{!billEditView.bill.paid and !billEditView.bill.expired}"
>
<h:form>
<p:commandButton
id=
"cancelbtn"
actionListener=
"#{billEditView.expireBill()}"
onerror=
"location.reload(true);"
value=
"#{i18n['bill.cancel']}"
update=
":billPanel"
>
<p:confirm
header=
"Confirmation"
message=
"Are you sure?"
icon=
"ui-icon-alert"
/>
<p:commandButton
id=
"cancelbtn"
actionListener=
"#{billEditView.expireBill()}"
onerror=
"location.reload(true);"
value=
"#{i18n['bill.cancel']}"
update=
":billPanel"
>
<p:confirm
header=
"Confirmation"
message=
"Are you sure?"
icon=
"ui-icon-alert"
/>
</p:commandButton>
</h:form>
</p:outputPanel>
<p:outputPanel
rendered=
"#{billEditView.bill.user.accountBalance ge billEditView.bill.totalPrice}"
>
<p:outputPanel
rendered=
"#{billEditView.bill.user.accountBalance ge billEditView.bill.totalPrice}"
>
<h:form>
<p:commandButton
id=
"buyCreditsButton"
actionListener=
"#{billEditView.buyWithCredits()}"
onerror=
"location.reload(true);"
value=
"#{i18n['bill.markPaid.credits']}"
update=
":billPanel"
>
<p:confirm
header=
"Confirmation"
message=
"Are you sure?"
icon=
"ui-icon-alert"
/>
<p:commandButton
id=
"buyCreditsButton"
actionListener=
"#{billEditView.buyWithCredits()}"
onerror=
"location.reload(true);"
value=
"#{i18n['bill.markPaid.credits']}"
update=
":billPanel"
>
<p:confirm
header=
"Confirmation"
message=
"Are you sure?"
icon=
"ui-icon-alert"
/>
</p:commandButton>
</h:form>
</p:outputPanel>
...
...
code/moya-web/WebContent/resources/cditools/bills/verkkomaksubuttons.xhtml
View file @
6bc4ad8
...
...
@@ -22,13 +22,12 @@
<!-- When called via ajax this needs to be already loaded!
-->
<script
type=
"text/javascript"
src=
"//payment.paytrail.com/js/payment-widget-v1.0.min.js"
></script>
<script
type=
"text/javascript"
>
function
initPaymentButtons
()
{
SV
.
widget
.
initWithToken
(
'svmpayment'
,
'#{billEditView.verkkomaksuFiToken.token}'
,
{
width
:
'800'
});
}
</script>
</ui:fragment>
<ui:fragment
rendered=
"#{billEditView.checkoutFiAvailable}"
>
...
...
code/moya-web/WebContent/resources/cditools/products/shop.xhtml
View file @
6bc4ad8
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:composite=
"http://java.sun.com/jsf/composite"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
xmlns:p=
"http://primefaces.org/ui"
>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:composite=
"http://java.sun.com/jsf/composite"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
xmlns:p=
"http://primefaces.org/ui"
>
<composite:interface>
<composite:attribute
name=
"items"
required=
"true"
/>
<composite:attribute
name=
"commitValue"
required=
"true"
/>
<composite:attribute
name=
"commitaction"
method-signature=
"java.lang.String action()"
required=
"true"
/>
<composite:attribute
name=
"commitaction"
method-signature=
"java.lang.String action()"
required=
"true"
/>
</composite:interface>
<composite:implementation>
<!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<h:outputScript
library=
"primefaces"
name=
"jquery/jquery.js"
/>
<p:dataTable
columnClasses=
"nowrap,numalign,numalign,numalign,nowrap"
id=
"billcart"
value=
"#{cc.attrs.items}"
var=
"cart"
>
<p:dataTable
columnClasses=
"nowrap,numalign,numalign,numalign,nowrap"
id=
"billcart"
value=
"#{cc.attrs.items}"
var=
"cart"
>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
id=
"name"
value=
"${i18n['product.name']}"
/>
...
...
@@ -37,14 +45,18 @@
<h:outputText
id=
"count"
value=
"${i18n['product.cart.count']}"
/>
</f:facet>
<h:commandButton
action=
"#{productShopView.addMinusOne}"
value=
"#{i18n['productshop.minusOne']}"
>
<h:commandButton
action=
"#{productShopView.addMinusOne}"
value=
"#{i18n['productshop.minusOne']}"
>
<f:ajax
render=
"@form"
/>
</h:commandButton>
<p:inputText
size=
"2"
id=
"cartcount"
escape=
"false"
value=
"#{cart.count}"
>
<f:ajax
render=
"@form"
listener=
"#{productShopView.countChangeListener}"
/>
<p:inputText
size=
"2"
id=
"cartcount"
escape=
"false"
value=
"#{cart.count}"
>
<f:ajax
render=
"@form"
listener=
"#{productShopView.countChangeListener}"
/>
<f:convertNumber
maxFractionDigits=
"2"
minFractionDigits=
"0"
/>
</p:inputText>
<h:commandButton
action=
"#{productShopView.addOne}"
value=
"#{i18n['productshop.plusOne']}"
>
<h:commandButton
action=
"#{productShopView.addOne}"
value=
"#{i18n['productshop.plusOne']}"
>
<f:ajax
render=
"@form"
/>
</h:commandButton>
</p:column>
...
...
@@ -57,7 +69,8 @@
</h:outputText>
</p:column>
<p:column
headerText=
"#{i18n['productshop.discounts']}"
>
<h:dataTable
styleClass=
"noborderTable"
border=
"0"
var=
"disc"
value=
"#{cart.discounts}"
>
<h:dataTable
styleClass=
"noborderTable"
border=
"0"
var=
"disc"
value=
"#{cart.discounts}"
>
<p:column>
<h:outputText
value=
"#{disc.shortdesc}"
/>
</p:column>
...
...
@@ -79,7 +92,9 @@
</p:column>
<p:columnGroup
type=
"footer"
>
<p:row>
<p:column
style=
"text-align: right;"
colspan=
"#{productShopView.hasLimits?5:4}"
footerText=
"#{i18n['productshop.total']}"
/>
<p:column
style=
"text-align: right;"
colspan=
"#{productShopView.hasLimits?5:4}"
footerText=
"#{i18n['productshop.total']}"
/>
<p:column>
<f:facet
name=
"footer"
>
<h:outputText
value=
"#{productShopView.cartPrice}"
>
...
...
@@ -95,23 +110,30 @@
<br
/>
<h:panelGrid
columns=
"3"
rendered=
"#{productShopView.checkAllowStats}"
>
<h:outputText
for=
"allowStats"
value=
"#{i18n['bill.allowStatistics']}"
/>
<h:selectBooleanCheckbox
id=
"allowStats"
value=
"#{productShopView.allowStatistics}"
/>
<h:selectBooleanCheckbox
id=
"allowStats"
value=
"#{productShopView.allowStatistics}"
/>
<h:message
for=
"allowStats"
/>
</h:panelGrid>
<br
/>
<h:panelGroup
rendered=
"#{productShopView.gatherBillInfo}"
>
<h2><p:outputLabel
value=
"#{i18n['bill.notes.title']}"
/>
</h2>
<p:inputTextarea
cols=
"50"
value=
"#{productShopView.otherInfo}"
label=
"#{i18n['otherInfo']}"
/>
<h2>
<p:outputLabel
value=
"#{i18n['bill.notes.title']}"
/>
</h2>
<p:inputTextarea
cols=
"50"
value=
"#{productShopView.otherInfo}"
label=
"#{i18n['otherInfo']}"
/>
</h:panelGroup>
<br
/>
<!-- Paytrail needs to initialize after the ajax call is complete -->
<!-- This function is to be override by the paytrail init function -->
<script
type=
"text/javascript"
>
function
initPaymentButtons
(){};
</script>
<p:commandButton
oncomplete=
"initPaymentButtons()"
onerror=
"location.reload(true);"
action=
"#{cc.attrs.commitaction}"
id=
"commitbutton-botton"
value=
"#{cc.attrs.commitValue}"
/>
<!-- Paytrail needs to initialize after the ajax call is complete -->
<!-- This function is to be override by the paytrail init function -->
<script
type=
"text/javascript"
>
function
initPaymentButtons
()
{
};
</script>
<p:commandButton
ajax=
"false"
onerror=
"location.reload(true);"
action=
"#{cc.attrs.commitaction}"
id=
"commitbutton-botton"
value=
"#{cc.attrs.commitValue}"
/>
...
...
code/moya-web/WebContent/shop/createBill.xhtml
View file @
6bc4ad8
...
...
@@ -14,12 +14,7 @@
<ui:define
name=
"title"
>
<h1>
#{i18n['page.product.createBill.header']}
</h1>
</ui:define>
<ui:define
name=
"headerdata"
>
<ui:fragment
rendered=
"#{billEditView.verkkomaksuFiAvailable}"
>
<script
type=
"text/javascript"
src=
"//payment.paytrail.com/js/payment-widget-v1.0.min.js"
></script>
</ui:fragment>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form
id=
"billshopform"
>
<products:shop
commitaction=
"#{productShopView.commitBillCart()}"
items=
"#{productShopView.shoppingcart}"
commitValue=
"#{i18n['productshop.commit']}"
/>
...
...
code/moya-web/WebContent/shop/showCreatedBill.xhtml
View file @
6bc4ad8
...
...
@@ -15,12 +15,7 @@
<ui:define
name=
"title"
>
<h1>
#{i18n['page.product.validateBillProducts.header']}
</h1>
</ui:define>
<ui:define
name=
"headerdata"
>
<ui:fragment
rendered=
"#{billEditView.verkkomaksuFiAvailable}"
>
<script
type=
"text/javascript"
src=
"//payment.paytrail.com/js/payment-widget-v1.0.min.js"
></script>
</ui:fragment>
</ui:define>
<ui:define
name=
"content"
>
<bill:showBill
bill=
"#{billEditView.bill}"
/>
...
...
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