feat(helcim): use contributionAmount, inline ×12 annual math
This commit is contained in:
parent
4c8aff34bf
commit
613d077eaa
2 changed files with 38 additions and 48 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
// Create a Helcim subscription
|
// Create a Helcim subscription
|
||||||
import { getHelcimPlanId, requiresPayment, getContributionTierByValue, getTierAmount } from '../../config/contributions.js'
|
import { getHelcimPlanId, requiresPayment } from '../../config/contributions.js'
|
||||||
import Member from '../../models/member.js'
|
import Member from '../../models/member.js'
|
||||||
import { connectDB } from '../../utils/mongoose.js'
|
import { connectDB } from '../../utils/mongoose.js'
|
||||||
import { getSlackService } from '../../utils/slack.ts'
|
import { getSlackService } from '../../utils/slack.ts'
|
||||||
|
|
@ -46,7 +46,7 @@ async function inviteToSlack(member) {
|
||||||
member.name,
|
member.name,
|
||||||
member.email,
|
member.email,
|
||||||
member.circle,
|
member.circle,
|
||||||
member.contributionTier,
|
member.contributionAmount,
|
||||||
inviteResult.status
|
inviteResult.status
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -93,19 +93,19 @@ export default defineEventHandler(async (event) => {
|
||||||
const isFirstActivation = priorMember?.status === 'pending_payment'
|
const isFirstActivation = priorMember?.status === 'pending_payment'
|
||||||
|
|
||||||
// Check if payment is required
|
// Check if payment is required
|
||||||
if (!requiresPayment(body.contributionTier)) {
|
if (!requiresPayment(body.contributionAmount)) {
|
||||||
// For free tier, just update member status
|
// For free tier, just update member status
|
||||||
const member = await Member.findOneAndUpdate(
|
const member = await Member.findOneAndUpdate(
|
||||||
{ helcimCustomerId: body.customerId },
|
{ helcimCustomerId: body.customerId },
|
||||||
{
|
{
|
||||||
status: 'active',
|
status: 'active',
|
||||||
contributionTier: body.contributionTier,
|
contributionAmount: body.contributionAmount,
|
||||||
subscriptionStartDate: new Date()
|
subscriptionStartDate: new Date()
|
||||||
},
|
},
|
||||||
{ new: true }
|
{ new: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
logActivity(member._id, 'subscription_created', { tier: body.contributionTier })
|
logActivity(member._id, 'subscription_created', { amount: body.contributionAmount })
|
||||||
|
|
||||||
await inviteToSlack(member)
|
await inviteToSlack(member)
|
||||||
if (isFirstActivation) await sendWelcomeEmail(member)
|
if (isFirstActivation) await sendWelcomeEmail(member)
|
||||||
|
|
@ -118,7 +118,7 @@ export default defineEventHandler(async (event) => {
|
||||||
email: member.email,
|
email: member.email,
|
||||||
name: member.name,
|
name: member.name,
|
||||||
circle: member.circle,
|
circle: member.circle,
|
||||||
contributionTier: member.contributionTier,
|
contributionAmount: member.contributionAmount,
|
||||||
status: member.status
|
status: member.status
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -128,13 +128,15 @@ export default defineEventHandler(async (event) => {
|
||||||
if (!body.cardToken) {
|
if (!body.cardToken) {
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
statusMessage: 'Payment information is required for this contribution tier'
|
statusMessage: 'Payment information is required for a paid contribution'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tierInfo = getContributionTierByValue(body.contributionTier)
|
|
||||||
const cadence = body.cadence
|
const cadence = body.cadence
|
||||||
const paymentPlanId = getHelcimPlanId(cadence)
|
const paymentPlanId = getHelcimPlanId(cadence)
|
||||||
|
const recurringAmount = cadence === 'annual'
|
||||||
|
? body.contributionAmount * 12
|
||||||
|
: body.contributionAmount
|
||||||
|
|
||||||
if (!paymentPlanId) {
|
if (!paymentPlanId) {
|
||||||
throw createError({
|
throw createError({
|
||||||
|
|
@ -151,7 +153,7 @@ export default defineEventHandler(async (event) => {
|
||||||
dateActivated: new Date().toISOString().split('T')[0],
|
dateActivated: new Date().toISOString().split('T')[0],
|
||||||
paymentPlanId: parseInt(paymentPlanId),
|
paymentPlanId: parseInt(paymentPlanId),
|
||||||
customerCode: body.customerCode,
|
customerCode: body.customerCode,
|
||||||
recurringAmount: getTierAmount(tierInfo, cadence),
|
recurringAmount,
|
||||||
paymentMethod: 'card',
|
paymentMethod: 'card',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -167,7 +169,7 @@ export default defineEventHandler(async (event) => {
|
||||||
const member = await Member.findOneAndUpdate(
|
const member = await Member.findOneAndUpdate(
|
||||||
{ helcimCustomerId: body.customerId },
|
{ helcimCustomerId: body.customerId },
|
||||||
{ $set: {
|
{ $set: {
|
||||||
contributionTier: body.contributionTier,
|
contributionAmount: body.contributionAmount,
|
||||||
helcimSubscriptionId: subscription.id,
|
helcimSubscriptionId: subscription.id,
|
||||||
helcimCustomerId: body.customerId,
|
helcimCustomerId: body.customerId,
|
||||||
paymentMethod: 'card',
|
paymentMethod: 'card',
|
||||||
|
|
@ -178,7 +180,7 @@ export default defineEventHandler(async (event) => {
|
||||||
{ new: true, runValidators: false }
|
{ new: true, runValidators: false }
|
||||||
)
|
)
|
||||||
|
|
||||||
logActivity(member._id, 'subscription_created', { tier: body.contributionTier })
|
logActivity(member._id, 'subscription_created', { amount: body.contributionAmount })
|
||||||
|
|
||||||
await inviteToSlack(member)
|
await inviteToSlack(member)
|
||||||
if (isFirstActivation) await sendWelcomeEmail(member)
|
if (isFirstActivation) await sendWelcomeEmail(member)
|
||||||
|
|
@ -195,7 +197,7 @@ export default defineEventHandler(async (event) => {
|
||||||
email: member.email,
|
email: member.email,
|
||||||
name: member.name,
|
name: member.name,
|
||||||
circle: member.circle,
|
circle: member.circle,
|
||||||
contributionTier: member.contributionTier,
|
contributionAmount: member.contributionAmount,
|
||||||
status: member.status
|
status: member.status
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
||||||
|
|
||||||
import Member from '../../../server/models/member.js'
|
import Member from '../../../server/models/member.js'
|
||||||
import { requireAuth } from '../../../server/utils/auth.js'
|
import { requireAuth } from '../../../server/utils/auth.js'
|
||||||
import { requiresPayment, getHelcimPlanId, getContributionTierByValue, getTierAmount } from '../../../server/config/contributions.js'
|
import { requiresPayment, getHelcimPlanId } from '../../../server/config/contributions.js'
|
||||||
import { createHelcimSubscription } from '../../../server/utils/helcim.js'
|
import { createHelcimSubscription } from '../../../server/utils/helcim.js'
|
||||||
import subscriptionHandler from '../../../server/api/helcim/subscription.post.js'
|
import subscriptionHandler from '../../../server/api/helcim/subscription.post.js'
|
||||||
import { createMockEvent } from '../helpers/createMockEvent.js'
|
import { createMockEvent } from '../helpers/createMockEvent.js'
|
||||||
|
|
@ -18,8 +18,6 @@ vi.mock('../../../server/utils/slack.ts', () => ({
|
||||||
vi.mock('../../../server/config/contributions.js', () => ({
|
vi.mock('../../../server/config/contributions.js', () => ({
|
||||||
requiresPayment: vi.fn(),
|
requiresPayment: vi.fn(),
|
||||||
getHelcimPlanId: vi.fn(),
|
getHelcimPlanId: vi.fn(),
|
||||||
getContributionTierByValue: vi.fn(),
|
|
||||||
getTierAmount: vi.fn(),
|
|
||||||
}))
|
}))
|
||||||
vi.mock('../../../server/utils/resend.js', () => ({
|
vi.mock('../../../server/utils/resend.js', () => ({
|
||||||
sendWelcomeEmail: vi.fn().mockResolvedValue({ success: true })
|
sendWelcomeEmail: vi.fn().mockResolvedValue({ success: true })
|
||||||
|
|
@ -47,7 +45,7 @@ describe('helcim subscription endpoint', () => {
|
||||||
const event = createMockEvent({
|
const event = createMockEvent({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/api/helcim/subscription',
|
path: '/api/helcim/subscription',
|
||||||
body: { customerId: 'cust-1', contributionTier: '0', customerCode: 'code-1' }
|
body: { customerId: 'cust-1', contributionAmount: 0, customerCode: 'code-1' }
|
||||||
})
|
})
|
||||||
|
|
||||||
await expect(subscriptionHandler(event)).rejects.toMatchObject({
|
await expect(subscriptionHandler(event)).rejects.toMatchObject({
|
||||||
|
|
@ -67,7 +65,7 @@ describe('helcim subscription endpoint', () => {
|
||||||
email: 'test@example.com',
|
email: 'test@example.com',
|
||||||
name: 'Test',
|
name: 'Test',
|
||||||
circle: 'community',
|
circle: 'community',
|
||||||
contributionTier: '0',
|
contributionAmount: 0,
|
||||||
status: 'active',
|
status: 'active',
|
||||||
save: vi.fn()
|
save: vi.fn()
|
||||||
}
|
}
|
||||||
|
|
@ -76,7 +74,7 @@ describe('helcim subscription endpoint', () => {
|
||||||
const event = createMockEvent({
|
const event = createMockEvent({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/api/helcim/subscription',
|
path: '/api/helcim/subscription',
|
||||||
body: { customerId: 'cust-1', contributionTier: '0', customerCode: 'code-1' }
|
body: { customerId: 'cust-1', contributionAmount: 0, customerCode: 'code-1' }
|
||||||
})
|
})
|
||||||
|
|
||||||
const result = await subscriptionHandler(event)
|
const result = await subscriptionHandler(event)
|
||||||
|
|
@ -88,12 +86,12 @@ describe('helcim subscription endpoint', () => {
|
||||||
email: 'test@example.com',
|
email: 'test@example.com',
|
||||||
name: 'Test',
|
name: 'Test',
|
||||||
circle: 'community',
|
circle: 'community',
|
||||||
contributionTier: '0',
|
contributionAmount: 0,
|
||||||
status: 'active'
|
status: 'active'
|
||||||
})
|
})
|
||||||
expect(Member.findOneAndUpdate).toHaveBeenCalledWith(
|
expect(Member.findOneAndUpdate).toHaveBeenCalledWith(
|
||||||
{ helcimCustomerId: 'cust-1' },
|
{ helcimCustomerId: 'cust-1' },
|
||||||
expect.objectContaining({ status: 'active', contributionTier: '0' }),
|
expect.objectContaining({ status: 'active', contributionAmount: 0 }),
|
||||||
{ new: true }
|
{ new: true }
|
||||||
)
|
)
|
||||||
expect(createHelcimSubscription).not.toHaveBeenCalled()
|
expect(createHelcimSubscription).not.toHaveBeenCalled()
|
||||||
|
|
@ -107,12 +105,12 @@ describe('helcim subscription endpoint', () => {
|
||||||
const event = createMockEvent({
|
const event = createMockEvent({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/api/helcim/subscription',
|
path: '/api/helcim/subscription',
|
||||||
body: { customerId: 'cust-1', contributionTier: '15', customerCode: 'code-1', cadence: 'monthly' }
|
body: { customerId: 'cust-1', contributionAmount: 15, customerCode: 'code-1', cadence: 'monthly' }
|
||||||
})
|
})
|
||||||
|
|
||||||
await expect(subscriptionHandler(event)).rejects.toMatchObject({
|
await expect(subscriptionHandler(event)).rejects.toMatchObject({
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
statusMessage: 'Payment information is required for this contribution tier'
|
statusMessage: 'Payment information is required for a paid contribution'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -120,15 +118,13 @@ describe('helcim subscription endpoint', () => {
|
||||||
requireAuth.mockResolvedValue(undefined)
|
requireAuth.mockResolvedValue(undefined)
|
||||||
requiresPayment.mockReturnValue(true)
|
requiresPayment.mockReturnValue(true)
|
||||||
getHelcimPlanId.mockReturnValue('99999')
|
getHelcimPlanId.mockReturnValue('99999')
|
||||||
getContributionTierByValue.mockReturnValue({ amount: '15' })
|
|
||||||
getTierAmount.mockReturnValue(15)
|
|
||||||
|
|
||||||
const mockMember = {
|
const mockMember = {
|
||||||
_id: 'member-2',
|
_id: 'member-2',
|
||||||
email: 'paid@example.com',
|
email: 'paid@example.com',
|
||||||
name: 'Paid User',
|
name: 'Paid User',
|
||||||
circle: 'founder',
|
circle: 'founder',
|
||||||
contributionTier: '15',
|
contributionAmount: 15,
|
||||||
status: 'active',
|
status: 'active',
|
||||||
}
|
}
|
||||||
Member.findOneAndUpdate.mockResolvedValue(mockMember)
|
Member.findOneAndUpdate.mockResolvedValue(mockMember)
|
||||||
|
|
@ -139,7 +135,7 @@ describe('helcim subscription endpoint', () => {
|
||||||
const event = createMockEvent({
|
const event = createMockEvent({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/api/helcim/subscription',
|
path: '/api/helcim/subscription',
|
||||||
body: { customerId: 'cust-1', contributionTier: '15', customerCode: 'code-1', cardToken: 'tok-123', cadence: 'monthly' }
|
body: { customerId: 'cust-1', contributionAmount: 15, customerCode: 'code-1', cardToken: 'tok-123', cadence: 'monthly' }
|
||||||
})
|
})
|
||||||
|
|
||||||
const result = await subscriptionHandler(event)
|
const result = await subscriptionHandler(event)
|
||||||
|
|
@ -151,7 +147,7 @@ describe('helcim subscription endpoint', () => {
|
||||||
)
|
)
|
||||||
expect(Member.findOneAndUpdate).toHaveBeenCalledWith(
|
expect(Member.findOneAndUpdate).toHaveBeenCalledWith(
|
||||||
{ helcimCustomerId: 'cust-1' },
|
{ helcimCustomerId: 'cust-1' },
|
||||||
{ $set: expect.objectContaining({ billingCadence: 'monthly', contributionTier: '15', status: 'active' }) },
|
{ $set: expect.objectContaining({ billingCadence: 'monthly', contributionAmount: 15, status: 'active' }) },
|
||||||
{ new: true, runValidators: false }
|
{ new: true, runValidators: false }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
@ -160,15 +156,13 @@ describe('helcim subscription endpoint', () => {
|
||||||
requireAuth.mockResolvedValue(undefined)
|
requireAuth.mockResolvedValue(undefined)
|
||||||
requiresPayment.mockReturnValue(true)
|
requiresPayment.mockReturnValue(true)
|
||||||
getHelcimPlanId.mockReturnValue('88888')
|
getHelcimPlanId.mockReturnValue('88888')
|
||||||
getContributionTierByValue.mockReturnValue({ amount: '15' })
|
|
||||||
getTierAmount.mockReturnValue(150)
|
|
||||||
|
|
||||||
const mockMember = {
|
const mockMember = {
|
||||||
_id: 'member-3',
|
_id: 'member-3',
|
||||||
email: 'annual@example.com',
|
email: 'annual@example.com',
|
||||||
name: 'Annual User',
|
name: 'Annual User',
|
||||||
circle: 'founder',
|
circle: 'founder',
|
||||||
contributionTier: '15',
|
contributionAmount: 15,
|
||||||
status: 'active',
|
status: 'active',
|
||||||
}
|
}
|
||||||
Member.findOneAndUpdate.mockResolvedValue(mockMember)
|
Member.findOneAndUpdate.mockResolvedValue(mockMember)
|
||||||
|
|
@ -179,36 +173,34 @@ describe('helcim subscription endpoint', () => {
|
||||||
const event = createMockEvent({
|
const event = createMockEvent({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/api/helcim/subscription',
|
path: '/api/helcim/subscription',
|
||||||
body: { customerId: 'cust-1', contributionTier: '15', customerCode: 'code-1', cardToken: 'tok-123', cadence: 'annual' }
|
body: { customerId: 'cust-1', contributionAmount: 15, customerCode: 'code-1', cardToken: 'tok-123', cadence: 'annual' }
|
||||||
})
|
})
|
||||||
|
|
||||||
const result = await subscriptionHandler(event)
|
const result = await subscriptionHandler(event)
|
||||||
|
|
||||||
expect(result.success).toBe(true)
|
expect(result.success).toBe(true)
|
||||||
expect(createHelcimSubscription).toHaveBeenCalledWith(
|
expect(createHelcimSubscription).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({ paymentPlanId: 88888, recurringAmount: 150 }),
|
expect.objectContaining({ paymentPlanId: 88888, recurringAmount: 180 }),
|
||||||
'idem-key-123'
|
'idem-key-123'
|
||||||
)
|
)
|
||||||
expect(Member.findOneAndUpdate).toHaveBeenCalledWith(
|
expect(Member.findOneAndUpdate).toHaveBeenCalledWith(
|
||||||
{ helcimCustomerId: 'cust-1' },
|
{ helcimCustomerId: 'cust-1' },
|
||||||
{ $set: expect.objectContaining({ billingCadence: 'annual', contributionTier: '15', status: 'active' }) },
|
{ $set: expect.objectContaining({ billingCadence: 'annual', contributionAmount: 15, status: 'active' }) },
|
||||||
{ new: true, runValidators: false }
|
{ new: true, runValidators: false }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('annual $50 tier recurringAmount is 500', async () => {
|
it('annual $50 tier recurringAmount is 600', async () => {
|
||||||
requireAuth.mockResolvedValue(undefined)
|
requireAuth.mockResolvedValue(undefined)
|
||||||
requiresPayment.mockReturnValue(true)
|
requiresPayment.mockReturnValue(true)
|
||||||
getHelcimPlanId.mockReturnValue('88888')
|
getHelcimPlanId.mockReturnValue('88888')
|
||||||
getContributionTierByValue.mockReturnValue({ amount: '50' })
|
|
||||||
getTierAmount.mockReturnValue(500)
|
|
||||||
|
|
||||||
const mockMember = {
|
const mockMember = {
|
||||||
_id: 'member-4',
|
_id: 'member-4',
|
||||||
email: 'top@example.com',
|
email: 'top@example.com',
|
||||||
name: 'Top Tier',
|
name: 'Top Tier',
|
||||||
circle: 'practitioner',
|
circle: 'practitioner',
|
||||||
contributionTier: '50',
|
contributionAmount: 50,
|
||||||
status: 'active',
|
status: 'active',
|
||||||
}
|
}
|
||||||
Member.findOneAndUpdate.mockResolvedValue(mockMember)
|
Member.findOneAndUpdate.mockResolvedValue(mockMember)
|
||||||
|
|
@ -219,13 +211,13 @@ describe('helcim subscription endpoint', () => {
|
||||||
const event = createMockEvent({
|
const event = createMockEvent({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/api/helcim/subscription',
|
path: '/api/helcim/subscription',
|
||||||
body: { customerId: 'cust-2', contributionTier: '50', customerCode: 'code-2', cardToken: 'tok-456', cadence: 'annual' }
|
body: { customerId: 'cust-2', contributionAmount: 50, customerCode: 'code-2', cardToken: 'tok-456', cadence: 'annual' }
|
||||||
})
|
})
|
||||||
|
|
||||||
await subscriptionHandler(event)
|
await subscriptionHandler(event)
|
||||||
|
|
||||||
expect(createHelcimSubscription).toHaveBeenCalledWith(
|
expect(createHelcimSubscription).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({ paymentPlanId: 88888, recurringAmount: 500 }),
|
expect.objectContaining({ paymentPlanId: 88888, recurringAmount: 600 }),
|
||||||
'idem-key-123'
|
'idem-key-123'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
@ -234,12 +226,11 @@ describe('helcim subscription endpoint', () => {
|
||||||
requireAuth.mockResolvedValue(undefined)
|
requireAuth.mockResolvedValue(undefined)
|
||||||
requiresPayment.mockReturnValue(true)
|
requiresPayment.mockReturnValue(true)
|
||||||
getHelcimPlanId.mockReturnValue(null)
|
getHelcimPlanId.mockReturnValue(null)
|
||||||
getContributionTierByValue.mockReturnValue({ amount: '15' })
|
|
||||||
|
|
||||||
const event = createMockEvent({
|
const event = createMockEvent({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/api/helcim/subscription',
|
path: '/api/helcim/subscription',
|
||||||
body: { customerId: 'cust-1', contributionTier: '15', customerCode: 'code-1', cardToken: 'tok-123', cadence: 'monthly' }
|
body: { customerId: 'cust-1', contributionAmount: 15, customerCode: 'code-1', cardToken: 'tok-123', cadence: 'monthly' }
|
||||||
})
|
})
|
||||||
|
|
||||||
await expect(subscriptionHandler(event)).rejects.toMatchObject({
|
await expect(subscriptionHandler(event)).rejects.toMatchObject({
|
||||||
|
|
@ -255,12 +246,11 @@ describe('helcim subscription endpoint', () => {
|
||||||
requireAuth.mockResolvedValue(undefined)
|
requireAuth.mockResolvedValue(undefined)
|
||||||
requiresPayment.mockReturnValue(true)
|
requiresPayment.mockReturnValue(true)
|
||||||
getHelcimPlanId.mockReturnValue(null)
|
getHelcimPlanId.mockReturnValue(null)
|
||||||
getContributionTierByValue.mockReturnValue({ amount: '15' })
|
|
||||||
|
|
||||||
const event = createMockEvent({
|
const event = createMockEvent({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: '/api/helcim/subscription',
|
path: '/api/helcim/subscription',
|
||||||
body: { customerId: 'cust-1', contributionTier: '15', customerCode: 'code-1', cardToken: 'tok-123', cadence: 'annual' }
|
body: { customerId: 'cust-1', contributionAmount: 15, customerCode: 'code-1', cardToken: 'tok-123', cadence: 'annual' }
|
||||||
})
|
})
|
||||||
|
|
||||||
await expect(subscriptionHandler(event)).rejects.toMatchObject({
|
await expect(subscriptionHandler(event)).rejects.toMatchObject({
|
||||||
|
|
@ -276,8 +266,6 @@ describe('helcim subscription endpoint', () => {
|
||||||
requireAuth.mockResolvedValue(undefined)
|
requireAuth.mockResolvedValue(undefined)
|
||||||
requiresPayment.mockReturnValue(true)
|
requiresPayment.mockReturnValue(true)
|
||||||
getHelcimPlanId.mockReturnValue('99999')
|
getHelcimPlanId.mockReturnValue('99999')
|
||||||
getContributionTierByValue.mockReturnValue({ amount: '15' })
|
|
||||||
getTierAmount.mockReturnValue(15)
|
|
||||||
|
|
||||||
createHelcimSubscription.mockRejectedValue(new Error('Network error'))
|
createHelcimSubscription.mockRejectedValue(new Error('Network error'))
|
||||||
|
|
||||||
|
|
@ -286,7 +274,7 @@ describe('helcim subscription endpoint', () => {
|
||||||
path: '/api/helcim/subscription',
|
path: '/api/helcim/subscription',
|
||||||
body: {
|
body: {
|
||||||
customerId: 'cust-1',
|
customerId: 'cust-1',
|
||||||
contributionTier: '15',
|
contributionAmount: 15,
|
||||||
customerCode: 'code-1',
|
customerCode: 'code-1',
|
||||||
cardToken: 'tok-123',
|
cardToken: 'tok-123',
|
||||||
cadence: 'monthly',
|
cadence: 'monthly',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue