Skip to content

Commit 78d52c3

Browse files
authored
Merge pull request #1158 from jboolean/upgrade-stripe_2025-02-24.acacia
Upgrade stripe lib to latest
2 parents f96fe91 + 779daba commit 78d52c3

File tree

4 files changed

+10
-20
lines changed

4 files changed

+10
-20
lines changed

backend/package-lock.json

Lines changed: 5 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"@types/serverless": "^3.12.16",
4141
"@types/sharp": "^0.31.0",
4242
"@types/source-map-support": "^0.5.6",
43-
"@types/stripe": "^8.0.296",
4443
"@typescript-eslint/eslint-plugin": "^5.61.0",
4544
"@typescript-eslint/parser": "^5.61.1",
4645
"eslint": "^8.52.0",
@@ -85,7 +84,7 @@
8584
"serverless-http": "^3.2.0",
8685
"sharp": "^0.31.3",
8786
"source-map-support": "^0.5.21",
88-
"stripe": "^11.4.0",
87+
"stripe": "^17.7.0",
8988
"tsoa": "^4.1.3",
9089
"typeorm": "^0.3.17",
9190
"typeorm-naming-strategies": "^4.1.0"

backend/src/api/StripeWebhooksResource.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import stripe from './stripe';
44

55
import compact from 'lodash/compact';
66
import groupBy from 'lodash/groupBy';
7-
import Stripe from 'stripe';
7+
import type Stripe from 'stripe';
88
import EmailCampaignService from '../business/email/EmailCampaignService';
99
import * as LedgerService from '../business/ledger/LedgerService';
1010
import * as MerchOrderService from '../business/merch/MerchOrderService';
@@ -45,7 +45,7 @@ router.post<'/', unknown, unknown, Stripe.Event, unknown>(
4545
const event = req.body;
4646
switch (event.type) {
4747
case 'payment_intent.succeeded': {
48-
const paymentIntent = event.data.object as Stripe.PaymentIntent;
48+
const paymentIntent = event.data.object;
4949
const email = paymentIntent.receipt_email;
5050
if (email) {
5151
await EmailCampaignService.addToMailingList(email, 'stripe');
@@ -54,7 +54,7 @@ router.post<'/', unknown, unknown, Stripe.Event, unknown>(
5454
}
5555
case 'checkout.session.async_payment_succeeded':
5656
case 'checkout.session.completed': {
57-
const session = event.data.object as Stripe.Checkout.Session;
57+
const session = event.data.object;
5858
if (session.payment_status !== 'paid') {
5959
console.warn('Checkout session was not paid', session);
6060
break;

backend/src/api/stripe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Stripe from 'stripe';
33
const { STRIPE_SK } = process.env;
44

55
const stripe = new Stripe(STRIPE_SK || '', {
6-
apiVersion: '2022-11-15',
6+
apiVersion: '2025-02-24.acacia',
77
});
88

99
export default stripe;

0 commit comments

Comments
 (0)