Skip to content

Commit

Permalink
changed stripe fee for EU to 1.2% (#339)
Browse files Browse the repository at this point in the history
Co-authored-by: quantum-grit <[email protected]>
  • Loading branch information
quantum-grit and quantum-grit authored Oct 4, 2022
1 parent 79d0273 commit f11d522
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/api/src/donations/events/stripe-payment.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ describe('StripePaymentService', () => {
it('calculate payment-intent.succeeded with BG tax included in charge', async () => {
const billingDetails = getPaymentData(mockPaymentIntentBGIncluded)
expect(billingDetails.netAmount).toEqual(1000)
expect(billingDetails.chargedAmount).toEqual(1065)
expect(billingDetails.chargedAmount).toEqual(1063)
})
})

it('calculate payment-intent.succeeded with BG tax not included in charge', async () => {
const billingDetails = getPaymentData(mockPaymentIntentBGIncludedNot)
expect(billingDetails.netAmount).toEqual(936)
expect(billingDetails.netAmount).toEqual(938)
expect(billingDetails.chargedAmount).toEqual(1000)
})

Expand Down
8 changes: 4 additions & 4 deletions apps/api/src/donations/events/stripe-payment.testdata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@ export const mockPaymentIntentCreated: Stripe.PaymentIntent = {
export const mockPaymentIntentBGIncluded: Stripe.PaymentIntent = {
id: 'pi_3LNwijKApGjVGa9t1F9QYd5s',
object: 'payment_intent',
amount: 1065,
amount: 1063,
amount_capturable: 0,
amount_details: {
tip: {},
},
amount_received: 1065,
amount_received: 1063,
application: null,
application_fee_amount: null,
automatic_payment_methods: null,
Expand All @@ -422,8 +422,8 @@ export const mockPaymentIntentBGIncluded: Stripe.PaymentIntent = {
{
id: 'ch_3LNwijKApGjVGa9t1tuRzvbL',
object: 'charge',
amount: 1065,
amount_captured: 1065,
amount: 1063,
amount_captured: 1063,
amount_refunded: 0,
application: null,
application_fee: null,
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/donations/helpers/stripe-fee-calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function stripeIncludeFeeCalculator(netAmount: number, region: CardRegion
}

export function stripeIncludeFeeCalculatorEU(netAmount: number) {
return (netAmount + 50) / (1 - 0.014)
return (netAmount + 50) / (1 - 0.012)
}

export function stripeIncludeFeeCalculatorUK(netAmount: number) {
Expand All @@ -50,7 +50,7 @@ export function stripeIncludeFeeCalculatorOther(netAmount: number) {
export function stripeFeeCalculator(chargedAmount: number, region: CardRegion) {
switch (region) {
case CardRegion.EU: {
return chargedAmount * 0.014 + 50
return chargedAmount * 0.012 + 50
}
case CardRegion.UK: {
return chargedAmount * 0.025 + 50
Expand Down

2 comments on commit f11d522

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 72.42% 1804/2491
🔴 Branches 44.81% 216/482
🔴 Functions 45.02% 217/482
🟡 Lines 70.49% 1593/2260

Test suite run success

172 tests passing in 62 suites.

Report generated by 🧪jest coverage report action from f11d522

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 72.42% 1804/2491
🔴 Branches 44.81% 216/482
🔴 Functions 45.02% 217/482
🟡 Lines 70.49% 1593/2260

Test suite run success

172 tests passing in 62 suites.

Report generated by 🧪jest coverage report action from f11d522

Please sign in to comment.