Use PayfritFee from database in Stripe payment intent
This commit is contained in:
parent
1787671239
commit
abf444ffe6
1 changed files with 5 additions and 4 deletions
|
|
@ -60,9 +60,9 @@ try {
|
|||
abort;
|
||||
}
|
||||
|
||||
// Get business Stripe account
|
||||
// Get business Stripe account and fee settings
|
||||
qBusiness = queryExecute("
|
||||
SELECT StripeAccountID, StripeOnboardingComplete, Name
|
||||
SELECT StripeAccountID, StripeOnboardingComplete, Name, PayfritFee
|
||||
FROM Businesses
|
||||
WHERE ID = :businessID
|
||||
", { businessID: businessID }, { datasource: "payfrit" });
|
||||
|
|
@ -108,8 +108,9 @@ try {
|
|||
// ============================================================
|
||||
// FEE CALCULATION
|
||||
// ============================================================
|
||||
customerFeePercent = 0.05; // 5% customer pays to Payfrit
|
||||
businessFeePercent = 0.05; // 5% business pays to Payfrit
|
||||
// Customer fee from database (PayfritFee), default 5% if not set
|
||||
customerFeePercent = isNumeric(qBusiness.PayfritFee) && qBusiness.PayfritFee > 0 ? qBusiness.PayfritFee : 0.05;
|
||||
businessFeePercent = 0.05; // 5% business pays to Payfrit (always)
|
||||
cardFeePercent = 0.029; // 2.9% Stripe fee
|
||||
cardFeeFixed = 0.30; // $0.30 Stripe fixed fee
|
||||
|
||||
|
|
|
|||
Reference in a new issue