Skip to content

Commit a599a44

Browse files
committed
Cleanup code
1 parent 51abbc0 commit a599a44

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/api/functions/stripe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export const getPaymentMethodDescriptionString = ({
226226
if (!bankData) {
227227
return null;
228228
}
229-
return `${friendlyName} (${bankData.bank_name} ${capitalizeFirstLetter(bankData.account_type!)} ${bankData.last4})`;
229+
return `${friendlyName} (${bankData.bank_name} ${capitalizeFirstLetter(bankData.account_type || "checking")} ${bankData.last4})`;
230230
case "card":
231231
const cardData = paymentMethod[paymentMethodType];
232232
if (!cardData) {

src/api/routes/stripe.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import {
66
} from "@aws-sdk/client-dynamodb";
77
import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
88
import { withRoles, withTags } from "api/components/index.js";
9-
import {
10-
buildAuditLogTransactPut,
11-
createAuditLogEntry,
12-
} from "api/functions/auditLog.js";
9+
import { buildAuditLogTransactPut } from "api/functions/auditLog.js";
1310
import {
1411
createStripeLink,
1512
deactivateStripeLink,
@@ -22,11 +19,7 @@ import {
2219
supportedStripePaymentMethods,
2320
} from "api/functions/stripe.js";
2421
import { getSecretValue } from "api/plugins/auth.js";
25-
import {
26-
environmentConfig,
27-
genericConfig,
28-
notificationRecipients,
29-
} from "common/config.js";
22+
import { genericConfig, notificationRecipients } from "common/config.js";
3023
import {
3124
BaseError,
3225
DatabaseFetchError,
@@ -492,7 +485,7 @@ Please ask the payee to try again, perhaps with a different payment method, or c
492485
paymentMethodData[paymentMethodType];
493486
if (!paymentMethodDescriptionData) {
494487
throw new InternalServerError({
495-
internalLog: `Unknown payment method type ${paymentMethodData.type}!`,
488+
internalLog: `No payment method data for ${paymentMethodData.type}!`,
496489
});
497490
}
498491
const paymentMethodString = getPaymentMethodDescriptionString({

0 commit comments

Comments
 (0)