Skip to content

Commit 8247d3c

Browse files
committed
remove payment link assertion
1 parent 4d7ed9b commit 8247d3c

File tree

4 files changed

+1
-19
lines changed

4 files changed

+1
-19
lines changed

packages/host/app/services/billing-service.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,8 @@ export default class BillingService extends Service {
120120
// so we can identify the user payment in our system when we get the webhook
121121
// the client reference id must be alphanumeric, so we encode the matrix user id
122122
// https://docs.stripe.com/payment-links/url-parameters#streamline-reconciliation-with-a-url-parameter
123-
if (!this.freePlanPaymentLink) {
124-
throw new Error('free payment link is not found');
125-
}
126123
const clientReferenceId = encodeToAlphanumeric(matrixUserId);
127-
return `${this.freePlanPaymentLink.url}?client_reference_id=${clientReferenceId}`;
124+
return `${this.freePlanPaymentLink?.url}?client_reference_id=${clientReferenceId}`;
128125
}
129126

130127
get subscriptionData() {

packages/matrix/helpers/index.ts

-9
Original file line numberDiff line numberDiff line change
@@ -576,15 +576,6 @@ export async function assertLoggedIn(page: Page, opts?: ProfileAssertions) {
576576
}
577577
}
578578

579-
export async function assertPaymentSetup(page: Page, username: string) {
580-
const stripePaymentLink = 'https://buy.stripe.com/test_4gw01WfWb2c1dBm7sv';
581-
const expectedLink = `${stripePaymentLink}?client_reference_id=${username}`;
582-
await expect(page.locator('[data-test-setup-payment]')).toHaveAttribute(
583-
'href',
584-
expectedLink,
585-
);
586-
}
587-
588579
export async function setupUser(
589580
username: string,
590581
realmServer: IsolatedRealmServer,

packages/matrix/tests/registration-with-token.spec.ts

-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
validateEmail,
1818
gotoRegistration,
1919
assertLoggedIn,
20-
assertPaymentSetup,
2120
assertLoggedOut,
2221
logout,
2322
login,
@@ -111,8 +110,6 @@ test.describe('User Registration w/ Token - isolated realm server', () => {
111110

112111
// base 64 encode the matrix user id
113112
const matrixUserId = encodeToAlphanumeric('@user1:localhost');
114-
115-
await assertPaymentSetup(page, matrixUserId);
116113
await setupPayment(matrixUserId, realmServer, page);
117114
await assertLoggedIn(page, {
118115
email: 'user1@example.com',
@@ -204,7 +201,6 @@ test.describe('User Registration w/ Token - isolated realm server', () => {
204201

205202
const user2MatrixUserId = encodeToAlphanumeric('@user2:localhost');
206203

207-
await assertPaymentSetup(page, user2MatrixUserId);
208204
await setupPayment(user2MatrixUserId, realmServer, page);
209205

210206
await assertLoggedIn(page, {

packages/matrix/tests/registration-without-token.spec.ts

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
validateEmail,
1616
gotoRegistration,
1717
assertLoggedIn,
18-
assertPaymentSetup,
1918
setupPayment,
2019
registerRealmUsers,
2120
encodeToAlphanumeric,
@@ -72,7 +71,6 @@ test.describe('User Registration w/o Token', () => {
7271
// base 64 encode the matrix user id
7372
const matrixUserId = encodeToAlphanumeric('@user1:localhost');
7473

75-
await assertPaymentSetup(page, matrixUserId);
7674
await setupPayment(matrixUserId, realmServer, page);
7775
await assertLoggedIn(page);
7876
});

0 commit comments

Comments
 (0)