fix: pass charge
param as JSON
This commit is contained in:
parent
6c63d3000f
commit
d93b199735
|
@ -226,6 +226,7 @@
|
|||
mixins: [windowMixin],
|
||||
data() {
|
||||
return {
|
||||
charge: JSON.parse('{{charge | tojson}}'),
|
||||
newProgress: 0.4,
|
||||
counter: 1,
|
||||
newTimeLeft: '',
|
||||
|
@ -246,7 +247,7 @@
|
|||
startPaymentNotifier() {
|
||||
this.cancelListener()
|
||||
|
||||
this.cancelListener = LNbits.event.onInvoicePaid(
|
||||
this.cancelListener = LNbits.events.onInvoicePaid(
|
||||
this.wallet,
|
||||
payment => {
|
||||
this.checkBalance()
|
||||
|
@ -258,7 +259,7 @@
|
|||
LNbits.api
|
||||
.request(
|
||||
'GET',
|
||||
'/satspay/api/v1/charges/balance/{{ charge.id }}',
|
||||
`/satspay/api/v1/charges/balance/${this.charge.id}`,
|
||||
'filla'
|
||||
)
|
||||
.then(function (response) {
|
||||
|
@ -316,12 +317,13 @@
|
|||
}
|
||||
},
|
||||
created: function () {
|
||||
console.log('{{ charge.onchainaddress }}' == 'None')
|
||||
if ('{{ charge.lnbitswallet }}' == 'None') {
|
||||
this.lnbtc = false
|
||||
this.onbtc = true
|
||||
}
|
||||
console.log('### charge ', this.charge)
|
||||
this.lnbtc = !!this.charge.lnbitswallet
|
||||
this.onbtc = !!this.charge.onchainwallet
|
||||
|
||||
// empty for onchain
|
||||
this.wallet.inkey = '{{ wallet_inkey }}'
|
||||
|
||||
this.getTheTime()
|
||||
this.getThePercentage()
|
||||
var timerCount = this.timerCount
|
||||
|
|
|
@ -24,14 +24,15 @@ async def index(request: Request, user: User = Depends(check_user_exists)):
|
|||
|
||||
|
||||
@satspay_ext.get("/{charge_id}", response_class=HTMLResponse)
|
||||
async def display(request: Request, charge_id):
|
||||
async def display(request: Request, charge_id: str):
|
||||
charge = await get_charge(charge_id)
|
||||
if not charge:
|
||||
raise HTTPException(
|
||||
status_code=HTTPStatus.NOT_FOUND, detail="Charge link does not exist."
|
||||
)
|
||||
wallet = await get_wallet(charge.lnbitswallet)
|
||||
inkey = wallet.inkey if wallet else None
|
||||
return satspay_renderer().TemplateResponse(
|
||||
"satspay/display.html",
|
||||
{"request": request, "charge": charge, "wallet_key": wallet.inkey},
|
||||
{"request": request, "charge": charge.dict(), "wallet_inkey": inkey},
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user