Commit 6bc4ad89 by Tuomas Riihimäki

Paytrail fix

1 parent bab9eed7
<!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>
......@@ -22,31 +28,43 @@
<br />
<h:outputText value="#{i18n['bill.billPaidDate']}" />:
<h:outputText value="#{billEditView.bill.paidDate}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
<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}"/>
<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>
<span class="notify"><h:outputText
value="#{i18n['foodshop.canBuyToCounter']}" /></span>
</p:outputPanel>
<br />
<p:outputPanel rendered="#{!billEditView.bill.paid and !billEditView.bill.expired}">
<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>
......
......@@ -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}">
......
<?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>
......@@ -16,7 +23,8 @@
<!-- <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}" />
......
......@@ -14,11 +14,6 @@
<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">
<h:form id="billshopform">
<products:shop commitaction="#{productShopView.commitBillCart()}" items="#{productShopView.shoppingcart}" commitValue="#{i18n['productshop.commit']}" />
......
......@@ -16,11 +16,6 @@
<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}" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!