Skip to content

Commit

Permalink
View for expired invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
shesek committed Nov 28, 2017
1 parent 923b935 commit fabee83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = app => {
if (req.invoice.completed && opt.redirect_url)
return res.redirect(opt.redirect_url)

res.render('checkout', { ...req.invoice, qr: makeQR(req.invoice) })
res.render('checkout', { ...req.invoice, expired: req.invoice_expired, qr: makeQR(req.invoice) })
})

// like /invoice/:invoice/wait, but user-accessible, doesn't reveal the full invoice fields,
Expand Down
13 changes: 8 additions & 5 deletions views/checkout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,19 @@ mixin css(path)
else
h3 #{ formatMsat(msatoshi) }

if !completed
if completed
p.thankyou= opt.thank_you || 'Thank you! Your payment has been received.'

else if expired
p.expired= opt.expired || 'Your invoice has expired. Please try again.'

else
.row
.qr.col-sm-4: img(src=qr)
.pay.col-sm-8
pre= payreq
a.btn.btn-lg.btn-primary(href=`lightning:${payreq}`)= opt.button || 'Pay with wallet'

p.expiry.text-muted Invoice expires in #[span]
else
p.thankyou= opt.thank_you || 'Thank you! Your payment has been received.'

if !completed
script(src=settings.static_url+'checkout.js')
script(src=settings.static_url+'checkout.js')

0 comments on commit fabee83

Please sign in to comment.