3333 CreateTposData ,
3434 CreateTposInvoice ,
3535 CreateUpdateItemData ,
36+ CreateWithdrawPay ,
3637 LnurlCharge ,
3738 PayLnurlWData ,
3839 Tpos ,
@@ -237,15 +238,15 @@ async def api_tpos_atm_pin_check(tpos_id: str, atmpin: int) -> LnurlCharge:
237238 return token
238239
239240
240- @tpos_api_router .get (
241+ @tpos_api_router .post (
241242 "/api/v1/atm/withdraw/{k1}/{amount}/pay" , status_code = HTTPStatus .OK
242243)
243244async def api_tpos_atm_pay (
244- request : Request , k1 : str , amount : int , pay_link : str = Query (...)
245+ request : Request , k1 : str , amount : int , data : CreateWithdrawPay
245246):
246247 try :
247248 # get the payment_request from the lnurl
248- pay_link = pay_link .replace ("lnurlp://" , "https://" )
249+ pay_link = data . pay_link .replace ("lnurlp://" , "https://" )
249250 async with httpx .AsyncClient () as client :
250251 headers = {"user-agent" : "lnbits/tpos" }
251252 r = await client .get (pay_link , follow_redirects = True , headers = headers )
@@ -258,10 +259,10 @@ async def api_tpos_atm_pay(
258259 if resp ["tag" ] != "payRequest" :
259260 return {"success" : False , "detail" : "Wrong tag type" }
260261
261- if amount < resp ["minSendable" ]:
262+ if amount < int ( resp ["minSendable" ]) :
262263 return {"success" : False , "detail" : "Amount too low" }
263264
264- if amount > resp ["maxSendable" ]:
265+ if amount > int ( resp ["maxSendable" ]) :
265266 return {"success" : False , "detail" : "Amount too high" }
266267
267268 cb_res = await client .get (
0 commit comments