Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 87465ae3
authored
Dec 05, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make verkkomaksubuttons a component and fix xhtml part of payments
1 parent
2b81bca1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
70 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 @
87465ae
...
@@ -28,39 +28,8 @@
...
@@ -28,39 +28,8 @@
<br
/>
<br
/>
<bill:showBill
bill=
"#{billEditView.bill}"
/>
<bill:showBill
bill=
"#{billEditView.bill}"
/>
<bill:verkkomaksubuttons
rendered=
"#{!billEditView.bill.paid and !billEditView.bill.expired}"
/>
<ui:fragment
rendered=
"#{!billEditView.bill.paid and !billEditView.bill.expired and billEditView.verkkomaksuFiAvailable}"
>
<div
id=
"svm-payment"
>
<a
href=
"#{billEditView.verkkomaksuFiToken.url}"
>
</a>
</div>
<script
type=
"text/javascript"
src=
"//payment.verkkomaksut.fi/js/sv-widget.min.js"
></script>
<script
type=
"text/javascript"
>
SV
.
widget
.
initWithToken
(
'svm-payment'
,
'#{billEditView.verkkomaksuToken.token}'
,
{
width
:
'800'
});
</script>
</ui:fragment>
<ui:fragment
rendered=
"#{!billEditView.bill.paid and !billEditView.bill.expired and billEditView.checkoutFiAvailable}"
>
<table
border=
"0"
>
<tr>
<ui:repeat
varStatus=
"idx"
value=
"#{billEditView.checkoutFiToken}"
var=
"bank"
>
<td>
<form
action=
"#{bank.url}"
method=
"post"
>
<ui:repeat
value=
"#{bank.postParams}"
var=
"valp"
>
<input
type=
"hidden"
name=
"#{valp.key}"
value=
"#{valp.value}"
/>
</ui:repeat>
<input
type=
'image'
src=
'#{bank.icon}'
/>
</form>
</td>
<h:outputText
escape=
"false"
value=
"</tr><tr>"
rendered=
"#{idx.index % 4 == 3}"
/>
</ui:repeat>
</tr>
</table>
</ui:fragment>
<p:outputPanel
rendered=
"#{billEditView.bill.foodwaveBill}"
>
<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>
...
...
code/moya-web/WebContent/resources/cditools/bills/verkkomaksubuttons.xhtml
0 → 100644
View file @
87465ae
<?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"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<ui:fragment
rendered=
"#{billEditView.verkkomaksuFiAvailable}"
>
<p
id=
"svmpayment"
>
<a
href=
"#{billEditView.verkkomaksuFiToken.url}"
>
Go to payments
</a>
</p>
<!-- 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}"
>
<table
border=
"0"
>
<tr>
<ui:repeat
varStatus=
"idx"
value=
"#{billEditView.checkoutFiToken}"
var=
"bank"
>
<td>
<form
action=
"#{bank.url}"
method=
"post"
>
<ui:repeat
value=
"#{bank.postParams}"
var=
"valp"
>
<input
type=
"hidden"
name=
"#{valp.key}"
value=
"#{valp.value}"
/>
</ui:repeat>
<input
type=
'image'
src=
'#{bank.icon}'
/>
</form>
</td>
<h:outputText
escape=
"false"
value=
"</tr><tr>"
rendered=
"#{idx.index % 4 == 3}"
/>
</ui:repeat>
</tr>
</table>
</ui:fragment>
</composite:implementation>
</html>
code/moya-web/WebContent/resources/cditools/products/shop.xhtml
View file @
87465ae
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> -->
<!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<h:outputScript
library=
"primefaces"
name=
"jquery/jquery.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>
<p:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
...
@@ -106,7 +106,12 @@
...
@@ -106,7 +106,12 @@
</h:panelGroup>
</h:panelGroup>
<br
/>
<br
/>
<p:commandButton
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
oncomplete=
"initPaymentButtons()"
onerror=
"location.reload(true);"
action=
"#{cc.attrs.commitaction}"
id=
"commitbutton-botton"
value=
"#{cc.attrs.commitValue}"
/>
...
...
code/moya-web/WebContent/shop/createBill.xhtml
View file @
87465ae
...
@@ -14,11 +14,15 @@
...
@@ -14,11 +14,15 @@
<ui:define
name=
"title"
>
<ui:define
name=
"title"
>
<h1>
#{i18n['page.product.createBill.header']}
</h1>
<h1>
#{i18n['page.product.createBill.header']}
</h1>
</ui:define>
</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"
>
<h:form
id=
"billshopform"
>
<products:shop
commitaction=
"#{productShopView.commitBillCart()}"
items=
"#{productShopView.shoppingcart}"
commitValue=
"#{i18n['productshop.commit']}"
/>
<products:shop
commitaction=
"#{productShopView.commitBillCart()}"
items=
"#{productShopView.shoppingcart}"
commitValue=
"#{i18n['productshop.commit']}"
/>
</h:form>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
code/moya-web/WebContent/shop/showCreatedBill.xhtml
View file @
87465ae
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:bill=
"http://java.sun.com/jsf/composite/cditools/bills"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
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:f=
"http://java.sun.com/jsf/core"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<h:body>
...
@@ -11,38 +15,17 @@
...
@@ -11,38 +15,17 @@
<ui:define
name=
"title"
>
<ui:define
name=
"title"
>
<h1>
#{i18n['page.product.validateBillProducts.header']}
</h1>
<h1>
#{i18n['page.product.validateBillProducts.header']}
</h1>
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<bill:showBill
bill=
"#{billEditView.bill}"
/>
<ui:define
name=
"headerdata"
>
<ui:fragment
rendered=
"#{billEditView.verkkomaksuFiAvailable}"
>
<ui:fragment
rendered=
"#{billEditView.verkkomaksuFiAvailable}"
>
<div
id=
"svm-payment"
>
<script
type=
"text/javascript"
src=
"//payment.paytrail.com/js/payment-widget-v1.0.min.js"
></script>
<a
href=
"#{billEditView.verkkomaksuFiToken.url}"
>
</a>
</div>
<script
type=
"text/javascript"
src=
"//payment.verkkomaksut.fi/js/sv-widget.min.js"
></script>
<script
type=
"text/javascript"
>
SV
.
widget
.
initWithToken
(
'svm-payment'
,
'#{billEditView.verkkomaksuToken.token}'
,
{
width
:
'800'
});
</script>
</ui:fragment>
</ui:fragment>
<ui:fragment
rendered=
"#{billEditView.checkoutFiAvailable}"
>
</ui:define>
<table
border=
"0"
>
<ui:define
name=
"content"
>
<tr>
<bill:showBill
bill=
"#{billEditView.bill}"
/>
<bill:verkkomaksubuttons
/>
<ui:repeat
varStatus=
"idx"
value=
"#{billEditView.checkoutFiToken}"
var=
"bank"
>
<td>
<form
action=
"#{bank.url}"
method=
"post"
>
<ui:repeat
value=
"#{bank.postParams}"
var=
"valp"
>
<input
type=
"hidden"
name=
"#{valp.key}"
value=
"#{valp.value}"
/>
</ui:repeat>
<input
type=
'image'
src=
'#{bank.icon}'
/>
</form>
</td>
<h:outputText
escape=
"false"
value=
"</tr><tr>"
rendered=
"#{idx.index % 4 == 3}"
/>
</ui:repeat>
</tr>
</table>
</ui:fragment>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
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