Skip to content

Commit

Permalink
Updated Patreon webhooks once again - 2 formats?
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoAbove committed Oct 6, 2023
1 parent 5740b9f commit 9e059a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/patreon.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,11 @@ router.post("/webhook", async (req, res) => {
case "members:pledge:create": {
const patron = body.data;
const patreonId = patron.relationships.user.data.id;
const pledgeAmount = patron?.attributes?.pledge_amount_cents || patron.will_pay_amount_cents;
const pledgeAmount =
patron?.attributes?.currently_entitled_amount_cents ||
patron?.attributes?.pledge_amount_cents ||
patron?.will_pay_amount_cents ||
patreon?.attributes?.will_pay_amount_cents;
const amount = getComputeAmountForPledgeAmount(pledgeAmount);

let user = await User.findOne({ patreonId });
Expand Down

0 comments on commit 9e059a5

Please sign in to comment.