Skip to content

Scheduling infrastructure for absolutely everyone.

remove application_fee_amount (#8496)

Peer Richelsen81d8628a870a
diff --git a/packages/app-store/stripepayment/lib/PaymentService.ts b/packages/app-store/stripepayment/lib/PaymentService.ts
index a5098ad4b96..ee18a9a8e74 100644
--- a/packages/app-store/stripepayment/lib/PaymentService.ts
+++ b/packages/app-store/stripepayment/lib/PaymentService.ts
@@ -62,9 +62,7 @@ export class PaymentService implements IAbstractPaymentService {
});
// Parse keys with zod
- const { client_id, payment_fee_fixed, payment_fee_percentage } = stripeAppKeysSchema.parse(
- stripeAppKeys?.keys
- );
+ const { payment_fee_fixed, payment_fee_percentage } = stripeAppKeysSchema.parse(stripeAppKeys?.keys);
const paymentFee = Math.round(payment.amount * payment_fee_percentage + payment_fee_fixed);
const customer = await retrieveOrCreateStripeCustomerByEmail(
@@ -76,7 +74,6 @@ export class PaymentService implements IAbstractPaymentService {
amount: payment.amount,
currency: this.credentials.default_currency,
payment_method_types: ["card"],
- application_fee_amount: paymentFee,
customer: customer.id,
};
@@ -143,9 +140,7 @@ export class PaymentService implements IAbstractPaymentService {
});
// Parse keys with zod
- const { client_id, payment_fee_fixed, payment_fee_percentage } = stripeAppKeysSchema.parse(
- stripeAppKeys?.keys
- );
+ const { payment_fee_fixed, payment_fee_percentage } = stripeAppKeysSchema.parse(stripeAppKeys?.keys);
const paymentFee = Math.round(payment.amount * payment_fee_percentage + payment_fee_fixed);
const customer = await retrieveOrCreateStripeCustomerByEmail(
@@ -200,7 +195,7 @@ export class PaymentService implements IAbstractPaymentService {
return paymentData;
}
- async chargeCard(payment: Payment, bookingId: Booking["id"]): Promise<Payment> {
+ async chargeCard(payment: Payment): Promise<Payment> {
try {
const stripeAppKeys = await prisma?.app.findFirst({
select: {
@@ -216,9 +211,7 @@ export class PaymentService implements IAbstractPaymentService {
const setupIntent = paymentObject.setupIntent;
// Parse keys with zod
- const { client_id, payment_fee_fixed, payment_fee_percentage } = stripeAppKeysSchema.parse(
- stripeAppKeys?.keys
- );
+ const { payment_fee_fixed, payment_fee_percentage } = stripeAppKeysSchema.parse(stripeAppKeys?.keys);
const paymentFee = Math.round(payment.amount * payment_fee_percentage + payment_fee_fixed);
diff --git a/packages/trpc/server/routers/viewer/payments.tsx b/packages/trpc/server/routers/viewer/payments.tsx
index 58e0902545a..a044a5c53ae 100644
--- a/packages/trpc/server/routers/viewer/payments.tsx
+++ b/packages/trpc/server/routers/viewer/payments.tsx
@@ -106,7 +106,7 @@ export const paymentsRouter = router({
const paymentInstance = new PaymentService(paymentCredential);
try {
- const paymentData = await paymentInstance.chargeCard(booking.payment[0], booking.id);
+ const paymentData = await paymentInstance.chargeCard(booking.payment[0]);
if (!paymentData) {
throw new TRPCError({ code: "NOT_FOUND", message: `Could not generate payment data` });