-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,8 @@ import { | |
PodboxTicketActionRequest, | ||
PodboxTicketActionResponseValue, | ||
PollFeedRequest, | ||
PollFeedResponseValue | ||
PollFeedResponseValue, | ||
TicketPreviewResultValue | ||
} from "@pcd/passport-interface"; | ||
import { RollbarService } from "@pcd/server-shared"; | ||
import { Request } from "express"; | ||
|
@@ -345,4 +346,21 @@ export class GenericIssuanceService { | |
public async getEdgeCityBalances(): Promise<EdgeCityBalance[]> { | ||
return getEdgeCityBalances(this.context.dbPool); | ||
} | ||
|
||
public async handleGetTicketPreview( | ||
email: string, | ||
orderCode: string | ||
): Promise<TicketPreviewResultValue> { | ||
return { | ||
tickets: [ | ||
{ | ||
name: "Test", | ||
email: "[email protected]", | ||
ticketSecret: "test", | ||
eventName: "Test Event", | ||
productName: "Test Product" | ||
} | ||
] | ||
} satisfies TicketPreviewResultValue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/lib/passport-interface/src/api/requestGenericIssuanceTicketPreviews.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import urlJoin from "url-join"; | ||
import { TicketPreviewResultValue } from "../RequestTypes"; | ||
import { APIResult } from "./apiResult"; | ||
import { httpPostSimple } from "./makeRequest"; | ||
|
||
/** | ||
* Asks the server to fetch the pipeline definition corresponding to the | ||
* given pipeline ID. Requires cookies, as this is part of generic issuance | ||
* user authentication. | ||
*/ | ||
export async function requestGenericIssuanceTicketPreviews( | ||
zupassServerUrl: string, | ||
email: string, | ||
orderCode: string | ||
): Promise<GenericIssuanceTicketPreviewResponse> { | ||
return httpPostSimple( | ||
urlJoin( | ||
zupassServerUrl, | ||
`/generic-issuance/api/ticket-previews`, | ||
encodeURIComponent(email), | ||
encodeURIComponent(orderCode) | ||
), | ||
async (resText) => ({ | ||
value: JSON.parse(resText) as TicketPreviewResultValue, | ||
success: true | ||
}), | ||
{}, | ||
true | ||
); | ||
} | ||
|
||
export type GenericIssuanceTicketPreviewResponse = | ||
APIResult<TicketPreviewResultValue>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters