Skip to content

Commit

Permalink
pay docs: webhook
Browse files Browse the repository at this point in the history
(cherry picked from commit 6a48eb0)
  • Loading branch information
nalinbhardwaj committed Oct 7, 2024
1 parent 0448377 commit 8f72325
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/daimo-common/src/daimoPay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function writeDaimoPayOrderID(id: bigint): string {
return base58.encode(numberToBytes(id));
}

const zUUID = z.string().uuid();
export const zUUID = z.string().uuid();

export type UUID = z.infer<typeof zUUID>;

Expand All @@ -151,8 +151,8 @@ export type PaymentStartedEvent = {
txHash: Hex;
};

export type PaymentFinishedEvent = {
type: "payment_finished";
export type PaymentCompletedEvent = {
type: "payment_completed";
paymentId: DaimoPayOrderID;
chainId: number;
txHash: Hex;
Expand All @@ -167,7 +167,7 @@ export type PaymentBouncedEvent = {

export type WebhookEventBody =
| PaymentStartedEvent
| PaymentFinishedEvent
| PaymentCompletedEvent
| PaymentBouncedEvent;

export interface WebhookEndpoint {
Expand All @@ -176,6 +176,7 @@ export interface WebhookEndpoint {
url: string;
token: string;
createdAt: Date;
deletedAt: Date | null;
}

// Lifecycle: Pending (just created) -> (if failing) Retrying (exponential backoff) -> Successful or Failed
Expand Down

0 comments on commit 8f72325

Please sign in to comment.