chore(funding-required): btcpay invoice payment methods debug

This commit is contained in:
Artur
2024-10-09 16:54:08 -03:00
parent dfbc2f374a
commit c458edfdac
2 changed files with 6 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ async function handle(
const cacheKey = `${query.fund}-${query.asset}-${query.project_status}`
const cachedResponse = cachedResponses[cacheKey]
if (cachedResponse && cachedResponse.expiresAt > new Date()) {
return res.send(cachedResponse.data)
// return res.send(cachedResponse.data)
}
const projects = (await getProjects(query.fund)).filter((project) =>
@@ -134,11 +134,12 @@ async function handle(
metadata,
})
const paymentMethodsResponse = await btcpayApi.get<BtcPayGetPaymentMethodsRes>(
const { data: paymentMethods } = await btcpayApi.get<BtcPayGetPaymentMethodsRes>(
`/invoices/${invoice.id}/payment-methods`
)
console.log(paymentMethods)
paymentMethodsResponse.data.forEach((paymentMethod: any) => {
paymentMethods.forEach((paymentMethod) => {
if (paymentMethod.paymentMethod === 'BTC-OnChain') {
bitcoinAddress = paymentMethod.destination
}

View File

@@ -38,6 +38,8 @@ export type BtcPayGetPaymentMethodsRes = {
rate: string
amount: string
cryptoCode: string
paymentMethod: string
destination: string
}[]
export type BtcPayCreateInvoiceBody = {