mirror of
https://github.com/MAGICGrants/campaign-site.git
synced 2026-01-09 12:27:59 -05:00
chore(funding-required): btcpay invoice payment methods debug
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ export type BtcPayGetPaymentMethodsRes = {
|
||||
rate: string
|
||||
amount: string
|
||||
cryptoCode: string
|
||||
paymentMethod: string
|
||||
destination: string
|
||||
}[]
|
||||
|
||||
export type BtcPayCreateInvoiceBody = {
|
||||
|
||||
Reference in New Issue
Block a user