fix: Removing payment fee on stripe (#10652)
Co-authored-by: Keith Williams <keithwillcode@gmail.com> Co-authored-by: Omar López <zomars@me.com> Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
This commit is contained in:
parent
f14ffb9e44
commit
7a7a5b5285
|
@ -45,18 +45,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
||||||
switchChecked={requirePayment}
|
switchChecked={requirePayment}
|
||||||
switchOnClick={(enabled) => {
|
switchOnClick={(enabled) => {
|
||||||
setRequirePayment(enabled);
|
setRequirePayment(enabled);
|
||||||
}}
|
}}>
|
||||||
description={
|
|
||||||
<>
|
|
||||||
<div className="">
|
|
||||||
{t("payment_app_commission", {
|
|
||||||
paymentFeePercentage: 0.5,
|
|
||||||
fee: 0.1,
|
|
||||||
formatParams: { fee: { currency } },
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
}>
|
|
||||||
<>
|
<>
|
||||||
{recurringEventDefined && (
|
{recurringEventDefined && (
|
||||||
<Alert className="mt-2" severity="warning" title={t("warning_recurring_event_payment")} />
|
<Alert className="mt-2" severity="warning" title={t("warning_recurring_event_payment")} />
|
||||||
|
|
|
@ -68,10 +68,6 @@ export class PaymentService implements IAbstractPaymentService {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Parse keys with zod
|
|
||||||
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(
|
const customer = await retrieveOrCreateStripeCustomerByEmail(
|
||||||
bookerEmail,
|
bookerEmail,
|
||||||
this.credentials.stripe_user_id
|
this.credentials.stripe_user_id
|
||||||
|
@ -108,7 +104,7 @@ export class PaymentService implements IAbstractPaymentService {
|
||||||
stripe_publishable_key: this.credentials.stripe_publishable_key,
|
stripe_publishable_key: this.credentials.stripe_publishable_key,
|
||||||
stripeAccount: this.credentials.stripe_user_id,
|
stripeAccount: this.credentials.stripe_user_id,
|
||||||
}) as unknown as Prisma.InputJsonValue,
|
}) as unknown as Prisma.InputJsonValue,
|
||||||
fee: paymentFee,
|
fee: 0,
|
||||||
refunded: false,
|
refunded: false,
|
||||||
success: false,
|
success: false,
|
||||||
paymentOption: paymentOption || "ON_BOOKING",
|
paymentOption: paymentOption || "ON_BOOKING",
|
||||||
|
@ -146,10 +142,6 @@ export class PaymentService implements IAbstractPaymentService {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Parse keys with zod
|
|
||||||
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(
|
const customer = await retrieveOrCreateStripeCustomerByEmail(
|
||||||
bookerEmail,
|
bookerEmail,
|
||||||
this.credentials.stripe_user_id
|
this.credentials.stripe_user_id
|
||||||
|
@ -191,7 +183,7 @@ export class PaymentService implements IAbstractPaymentService {
|
||||||
stripeAccount: this.credentials.stripe_user_id,
|
stripeAccount: this.credentials.stripe_user_id,
|
||||||
}
|
}
|
||||||
) as unknown as Prisma.InputJsonValue,
|
) as unknown as Prisma.InputJsonValue,
|
||||||
fee: paymentFee,
|
fee: 0,
|
||||||
refunded: false,
|
refunded: false,
|
||||||
success: false,
|
success: false,
|
||||||
paymentOption: paymentOption || "ON_BOOKING",
|
paymentOption: paymentOption || "ON_BOOKING",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user