|
|
|
@ -113,7 +113,7 @@
|
|
|
|
|
} */
|
|
|
|
|
</style>
|
|
|
|
|
<script>
|
|
|
|
|
sessionStorage.context = "{{context|safe}}"
|
|
|
|
|
sessionStorage.store_context = "{{context|safe}}"
|
|
|
|
|
sessionStorage.pricing = JSON.stringify({{pricing|tojson}})
|
|
|
|
|
sessionStorage.customer = JSON.stringify({info:{}})
|
|
|
|
|
var cards = {
|
|
|
|
@ -157,7 +157,7 @@
|
|
|
|
|
// @TODO: Generalize this to a function call (poor programming)
|
|
|
|
|
customer.info[field] = value
|
|
|
|
|
sessionStorage.customer = JSON.stringify(customer)
|
|
|
|
|
var link = ([sessionStorage.context,'/static/img/cards/',r[0]+'.svg']).join('')
|
|
|
|
|
var link = ([sessionStorage.store_context,'/static/img/cards/',r[0]+'.svg']).join('')
|
|
|
|
|
jx.dom.set.attribute('pay-icon','src',link)
|
|
|
|
|
return 1
|
|
|
|
|
}else{
|
|
|
|
@ -181,7 +181,7 @@
|
|
|
|
|
}
|
|
|
|
|
checkout.dialog = function(title,message,type){
|
|
|
|
|
ICONS = {'WARN':'fas fa-exclamation-triangle','CHECK':'fas fa-check fa-3x','PROGRESS':'fas fa-cog fa-spin'}
|
|
|
|
|
var uri = ([sessionStorage.context,'/ui/dialog']).join('')
|
|
|
|
|
var uri = ([sessionStorage.store_context,'/ui/dialog']).join('')
|
|
|
|
|
var info = {title:title,message:message,icon:ICONS[type],type:type}
|
|
|
|
|
var httpclient = HttpClient.instance()
|
|
|
|
|
httpclient.setData( JSON.stringify(info))
|
|
|
|
@ -233,7 +233,7 @@
|
|
|
|
|
//
|
|
|
|
|
info.amount = info.amount * 100
|
|
|
|
|
$('.dialog > .message').text('Processing card, please wait ...')
|
|
|
|
|
var uri = ([sessionStorage.context,'/{{product.name|safe}}/pay']).join('/')
|
|
|
|
|
var uri = ([sessionStorage.store_context,'/{{product.name|safe}}/pay']).join('/')
|
|
|
|
|
var http = HttpClient.instance()
|
|
|
|
|
http.setData(JSON.stringify(info))
|
|
|
|
|
http.setHeader('content-type','application/json')
|
|
|
|
|