mirror of
https://github.com/MAGICGrants/campaign-site.git
synced 2026-01-08 03:53:59 -05:00
Merge pull request #178 from MAGICGrants/btcpay-webhook-fix
fix(btcpay webhook): use new paymentMethodId value when getting crypt…
This commit is contained in:
@@ -39,7 +39,7 @@ type WebhookBody = Record<string, any> & {
|
||||
storeId: string
|
||||
invoiceId: string
|
||||
metadata?: DonationMetadata
|
||||
paymentMethod: string
|
||||
paymentMethodId: string
|
||||
}
|
||||
|
||||
async function handleFundingRequiredApiDonation(body: WebhookBody) {
|
||||
@@ -58,9 +58,9 @@ async function handleFundingRequiredApiDonation(body: WebhookBody) {
|
||||
}
|
||||
|
||||
// Handle payment methods like "BTC-LightningNetwork" if added in the future
|
||||
const cryptoCode = body.paymentMethod.includes('-')
|
||||
? body.paymentMethod.split('-')[0]
|
||||
: body.paymentMethod
|
||||
const cryptoCode = body.paymentMethodId.includes('-')
|
||||
? body.paymentMethodId.split('-')[0]
|
||||
: body.paymentMethodId
|
||||
|
||||
const { data: rates } = await btcpayApi.get<BtcPayGetRatesRes>(
|
||||
`/rates?currencyPair=${cryptoCode}_USD`
|
||||
|
||||
Reference in New Issue
Block a user