public
imalexnord
read
Slot
Calendar-first scheduling powered by Cloudflare Workers and Google Calendar.
Languages
Repository composition by tracked source files.
TypeScript
79%
CSS
19%
SQL
2%
HTML
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/user/imalexnord/slot.git
ssh://[email protected]:2222/user/imalexnord/slot.git
Trace
worker/stripe.ts
Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.
stripe.ts
on main
Author
Date
Commit
Line
Code
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 1
import type { Env } from './types';
import type { Env } from './types';
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 2
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 3
export class StripeError extends Error {
export class StripeError extends Error {
Alex Nord
1 day ago
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 4
constructor(
constructor(
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 5
message: string,
message: string,
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 6
public readonly status = 502,
public readonly status = 502,
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 7
public readonly code?: string,
public readonly code?: string,
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 8
) {
) {
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 9
super(message);
super(message);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 10
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 11
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 12
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 13
export type StripeCheckoutSession = {
export type StripeCheckoutSession = {
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 14
id: string;
id: string;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 15
object: 'checkout.session';
object: 'checkout.session';
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 16
url?: string | null;
url?: string | null;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 17
status?: 'open' | 'complete' | 'expired' | null;
status?: 'open' | 'complete' | 'expired' | null;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 18
payment_status?: 'paid' | 'unpaid' | 'no_payment_required';
payment_status?: 'paid' | 'unpaid' | 'no_payment_required';
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 19
amount_total?: number | null;
amount_total?: number | null;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 20
currency?: string | null;
currency?: string | null;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 21
client_reference_id?: string | null;
client_reference_id?: string | null;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 22
payment_intent?: string | { id?: string } | null;
payment_intent?: string | { id?: string } | null;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 23
metadata?: Record<string, string> | null;
metadata?: Record<string, string> | null;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 24
};
};
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 25
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 26
Alex Nord
1 day ago
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 27
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 28
export type StripeRefund = {
export type StripeRefund = {
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 29
id: string;
id: string;
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 30
object: 'refund';
object: 'refund';
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 31
amount: number;
amount: number;
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 32
currency?: string | null;
currency?: string | null;
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 33
payment_intent?: string | null;
payment_intent?: string | null;
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 34
status?: 'pending' | 'requires_action' | 'succeeded' | 'failed' | 'canceled' | null;
status?: 'pending' | 'requires_action' | 'succeeded' | 'failed' | 'canceled' | null;
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 35
metadata?: Record<string, string> | null;
metadata?: Record<string, string> | null;
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 36
failure_reason?: string | null;
failure_reason?: string | null;
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 37
};
};
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 38
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 39
type StripePaymentIntent = {
type StripePaymentIntent = {
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 40
id: string;
id: string;
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 41
object: 'payment_intent';
object: 'payment_intent';
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 42
latest_charge?: string | { id?: string; receipt_url?: string | null } | null;
latest_charge?: string | { id?: string; receipt_url?: string | null } | null;
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 43
};
};
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 44
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 45
type StripeCharge = {
type StripeCharge = {
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 46
id: string;
id: string;
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 47
object: 'charge';
object: 'charge';
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 48
receipt_url?: string | null;
receipt_url?: string | null;
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 49
};
};
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 50
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 51
type StripeEvent = {
type StripeEvent = {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 52
id: string;
id: string;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 53
type: string;
type: string;
Alex Nord
1 day ago
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 54
data?: { object?: StripeCheckoutSession | StripeRefund };
data?: { object?: StripeCheckoutSession | StripeRefund };
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 55
};
};
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 56
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 57
function stripeSecret(env: Env): string {
function stripeSecret(env: Env): string {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 58
const key = env.STRIPE_SECRET_KEY?.trim();
const key = env.STRIPE_SECRET_KEY?.trim();
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 59
if (!key) throw new StripeError('Stripe is not configured for this deployment.', 503);
if (!key) throw new StripeError('Stripe is not configured for this deployment.', 503);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 60
return key;
return key;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 61
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 62
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 63
async function stripeRequest<T>(env: Env, path: string, init: RequestInit = {}): Promise<T> {
async function stripeRequest<T>(env: Env, path: string, init: RequestInit = {}): Promise<T> {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 64
let response: Response;
let response: Response;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 65
try {
try {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 66
response = await fetch(`https://api.stripe.com${path}`, {
response = await fetch(`https://api.stripe.com${path}`, {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 67
...init,
...init,
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 68
headers: {
headers: {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 69
Authorization: `Bearer ${stripeSecret(env)}`,
Authorization: `Bearer ${stripeSecret(env)}`,
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 70
...(init.body ? { 'Content-Type': 'application/x-www-form-urlencoded' } : {}),
...(init.body ? { 'Content-Type': 'application/x-www-form-urlencoded' } : {}),
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 71
...(init.headers ?? {}),
...(init.headers ?? {}),
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 72
},
},
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 73
});
});
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 74
} catch {
} catch {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 75
throw new StripeError('Could not reach Stripe. Try again in a moment.', 502);
throw new StripeError('Could not reach Stripe. Try again in a moment.', 502);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 76
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 77
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 78
const data = (await response.json().catch(() => ({}))) as T & {
const data = (await response.json().catch(() => ({}))) as T & {
Alex Nord
1 day ago
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 79
error?: { message?: string; code?: string };
error?: { message?: string; code?: string };
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 80
};
};
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 81
if (!response.ok) {
if (!response.ok) {
Alex Nord
1 day ago
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 82
throw new StripeError(
throw new StripeError(
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 83
data.error?.message || `Stripe request failed (${response.status}).`,
data.error?.message || `Stripe request failed (${response.status}).`,
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 84
response.status >= 500 ? 502 : response.status,
response.status >= 500 ? 502 : response.status,
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 85
data.error?.code,
data.error?.code,
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 86
);
);
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 87
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 88
return data;
return data;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 89
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 90
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 91
export function stripeConfigured(env: Env): boolean {
export function stripeConfigured(env: Env): boolean {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 92
return Boolean(env.STRIPE_SECRET_KEY?.trim() && env.STRIPE_WEBHOOK_SECRET?.trim());
return Boolean(env.STRIPE_SECRET_KEY?.trim() && env.STRIPE_WEBHOOK_SECRET?.trim());
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 93
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 94
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 95
export type StripeMode = 'test' | 'live' | 'unknown';
export type StripeMode = 'test' | 'live' | 'unknown';
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 96
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 97
export function stripeMode(env: Env): StripeMode {
export function stripeMode(env: Env): StripeMode {
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 98
const key = env.STRIPE_SECRET_KEY?.trim() ?? '';
const key = env.STRIPE_SECRET_KEY?.trim() ?? '';
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 99
if (key.startsWith('sk_test_')) return 'test';
if (key.startsWith('sk_test_')) return 'test';
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 100
if (key.startsWith('sk_live_')) return 'live';
if (key.startsWith('sk_live_')) return 'live';
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 101
return 'unknown';
return 'unknown';
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 102
}
}
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 103
Alex Nord
1 day ago
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 104
export function stripeCheckoutSessionMode(sessionId: string | null | undefined): StripeMode {
export function stripeCheckoutSessionMode(sessionId: string | null | undefined): StripeMode {
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 105
const id = sessionId?.trim() ?? '';
const id = sessionId?.trim() ?? '';
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 106
if (id.startsWith('cs_test_')) return 'test';
if (id.startsWith('cs_test_')) return 'test';
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 107
if (id.startsWith('cs_live_')) return 'live';
if (id.startsWith('cs_live_')) return 'live';
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 108
return 'unknown';
return 'unknown';
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 109
}
}
same change
f1dbf89
fix: clarify availability limits and document Stripe as optional
- Full commit hash
f1dbf89ac73246b1bdab27a2d40d1f2ab4374bf8- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 110
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 111
export async function createStripeCheckoutSession(
export async function createStripeCheckoutSession(
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 112
env: Env,
env: Env,
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 113
booking: {
booking: {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 114
id: string;
id: string;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 115
email: string;
email: string;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 116
durationMinutes: number;
durationMinutes: number;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 117
amountMinor: number;
amountMinor: number;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 118
currency: string;
currency: string;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 119
label: string;
label: string;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 120
},
},
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 121
): Promise<StripeCheckoutSession> {
): Promise<StripeCheckoutSession> {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 122
const params = new URLSearchParams();
const params = new URLSearchParams();
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 123
params.set('mode', 'payment');
params.set('mode', 'payment');
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 124
const appUrl = env.APP_URL.replace(/\/+$/, '');
const appUrl = env.APP_URL.replace(/\/+$/, '');
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 125
params.set('success_url', `${appUrl}/?payment=success&session_id={CHECKOUT_SESSION_ID}`);
params.set('success_url', `${appUrl}/?payment=success&session_id={CHECKOUT_SESSION_ID}`);
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 126
params.set('cancel_url', `${appUrl}/api/payments/cancel-return?booking_id=${encodeURIComponent(booking.id)}`);
params.set('cancel_url', `${appUrl}/api/payments/cancel-return?booking_id=${encodeURIComponent(booking.id)}`);
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 127
params.set('client_reference_id', booking.id);
params.set('client_reference_id', booking.id);
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 128
// A time-slot reservation cannot safely wait days for a delayed bank payment.
// A time-slot reservation cannot safely wait days for a delayed bank payment.
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 129
// Card Checkout still supports 3DS and wallets backed by cards, while giving us
// Card Checkout still supports 3DS and wallets backed by cards, while giving us
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 130
// a definitive paid/unpaid result before the calendar invitation is sent.
// a definitive paid/unpaid result before the calendar invitation is sent.
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 131
params.set('payment_method_types[0]', 'card');
params.set('payment_method_types[0]', 'card');
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 132
params.set('expires_at', String(Math.floor(Date.now() / 1000) + 30 * 60));
params.set('expires_at', String(Math.floor(Date.now() / 1000) + 30 * 60));
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 133
params.set('customer_email', booking.email);
params.set('customer_email', booking.email);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 134
params.set('metadata[booking_id]', booking.id);
params.set('metadata[booking_id]', booking.id);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 135
params.set('payment_intent_data[metadata][booking_id]', booking.id);
params.set('payment_intent_data[metadata][booking_id]', booking.id);
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 136
// Explicitly attach the booking email to the PaymentIntent receipt. This makes
// Explicitly attach the booking email to the PaymentIntent receipt. This makes
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 137
// live-mode receipts independent of the account's automatic-email toggle.
// live-mode receipts independent of the account's automatic-email toggle.
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 138
params.set('payment_intent_data[receipt_email]', booking.email);
params.set('payment_intent_data[receipt_email]', booking.email);
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 139
params.set('line_items[0][price_data][currency]', booking.currency.toLowerCase());
params.set('line_items[0][price_data][currency]', booking.currency.toLowerCase());
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 140
params.set('line_items[0][price_data][unit_amount]', String(booking.amountMinor));
params.set('line_items[0][price_data][unit_amount]', String(booking.amountMinor));
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 141
params.set('line_items[0][price_data][product_data][name]', booking.label);
params.set('line_items[0][price_data][product_data][name]', booking.label);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 142
params.set(
params.set(
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 143
'line_items[0][price_data][product_data][description]',
'line_items[0][price_data][product_data][description]',
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 144
`${booking.durationMinutes}-minute booking`,
`${booking.durationMinutes}-minute booking`,
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 145
);
);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 146
params.set('line_items[0][quantity]', '1');
params.set('line_items[0][quantity]', '1');
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 147
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 148
return stripeRequest<StripeCheckoutSession>(env, '/v1/checkout/sessions', {
return stripeRequest<StripeCheckoutSession>(env, '/v1/checkout/sessions', {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 149
method: 'POST',
method: 'POST',
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 150
body: params.toString(),
body: params.toString(),
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 151
});
});
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 152
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 153
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 154
export async function retrieveStripeCheckoutSession(env: Env, sessionId: string): Promise<StripeCheckoutSession> {
export async function retrieveStripeCheckoutSession(env: Env, sessionId: string): Promise<StripeCheckoutSession> {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 155
if (!/^cs_(test_|live_)?[A-Za-z0-9_]+$/.test(sessionId)) {
if (!/^cs_(test_|live_)?[A-Za-z0-9_]+$/.test(sessionId)) {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 156
throw new StripeError('Invalid Stripe Checkout session id.', 400);
throw new StripeError('Invalid Stripe Checkout session id.', 400);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 157
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 158
return stripeRequest<StripeCheckoutSession>(env, `/v1/checkout/sessions/${encodeURIComponent(sessionId)}`);
return stripeRequest<StripeCheckoutSession>(env, `/v1/checkout/sessions/${encodeURIComponent(sessionId)}`);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 159
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 160
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 161
export async function expireStripeCheckoutSession(env: Env, sessionId: string): Promise<StripeCheckoutSession> {
export async function expireStripeCheckoutSession(env: Env, sessionId: string): Promise<StripeCheckoutSession> {
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 162
if (!/^cs_(test_|live_)?[A-Za-z0-9_]+$/.test(sessionId)) {
if (!/^cs_(test_|live_)?[A-Za-z0-9_]+$/.test(sessionId)) {
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 163
throw new StripeError('Invalid Stripe Checkout session id.', 400);
throw new StripeError('Invalid Stripe Checkout session id.', 400);
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 164
}
}
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 165
return stripeRequest<StripeCheckoutSession>(
return stripeRequest<StripeCheckoutSession>(
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 166
env,
env,
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 167
`/v1/checkout/sessions/${encodeURIComponent(sessionId)}/expire`,
`/v1/checkout/sessions/${encodeURIComponent(sessionId)}/expire`,
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 168
{ method: 'POST' },
{ method: 'POST' },
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 169
);
);
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 170
}
}
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 171
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 172
function constantTimeEqual(left: string, right: string): boolean {
function constantTimeEqual(left: string, right: string): boolean {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 173
if (left.length !== right.length) return false;
if (left.length !== right.length) return false;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 174
let result = 0;
let result = 0;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 175
for (let index = 0; index < left.length; index += 1) {
for (let index = 0; index < left.length; index += 1) {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 176
result |= left.charCodeAt(index) ^ right.charCodeAt(index);
result |= left.charCodeAt(index) ^ right.charCodeAt(index);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 177
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 178
return result === 0;
return result === 0;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 179
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 180
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 181
function bytesToHex(bytes: Uint8Array): string {
function bytesToHex(bytes: Uint8Array): string {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 182
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join('');
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join('');
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 183
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 184
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 185
async function hmacSha256Hex(secret: string, message: string): Promise<string> {
async function hmacSha256Hex(secret: string, message: string): Promise<string> {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 186
const encoder = new TextEncoder();
const encoder = new TextEncoder();
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 187
const key = await crypto.subtle.importKey(
const key = await crypto.subtle.importKey(
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 188
'raw',
'raw',
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 189
encoder.encode(secret),
encoder.encode(secret),
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 190
{ name: 'HMAC', hash: 'SHA-256' },
{ name: 'HMAC', hash: 'SHA-256' },
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 191
false,
false,
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 192
['sign'],
['sign'],
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 193
);
);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 194
const signature = await crypto.subtle.sign('HMAC', key, encoder.encode(message));
const signature = await crypto.subtle.sign('HMAC', key, encoder.encode(message));
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 195
return bytesToHex(new Uint8Array(signature));
return bytesToHex(new Uint8Array(signature));
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 196
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 197
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 198
export async function verifyStripeWebhook(
export async function verifyStripeWebhook(
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 199
env: Env,
env: Env,
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 200
rawBody: string,
rawBody: string,
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 201
signatureHeader: string | null,
signatureHeader: string | null,
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 202
toleranceSeconds = 300,
toleranceSeconds = 300,
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 203
): Promise<StripeEvent> {
): Promise<StripeEvent> {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 204
const secret = env.STRIPE_WEBHOOK_SECRET?.trim();
const secret = env.STRIPE_WEBHOOK_SECRET?.trim();
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 205
if (!secret) throw new StripeError('Stripe webhook secret is not configured.', 503);
if (!secret) throw new StripeError('Stripe webhook secret is not configured.', 503);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 206
if (!signatureHeader) throw new StripeError('Missing Stripe-Signature header.', 400);
if (!signatureHeader) throw new StripeError('Missing Stripe-Signature header.', 400);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 207
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 208
const parts = signatureHeader.split(',').map((part) => part.trim());
const parts = signatureHeader.split(',').map((part) => part.trim());
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 209
const timestamp = parts.find((part) => part.startsWith('t='))?.slice(2);
const timestamp = parts.find((part) => part.startsWith('t='))?.slice(2);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 210
const signatures = parts.filter((part) => part.startsWith('v1=')).map((part) => part.slice(3));
const signatures = parts.filter((part) => part.startsWith('v1=')).map((part) => part.slice(3));
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 211
const timestampNumber = Number(timestamp);
const timestampNumber = Number(timestamp);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 212
if (!timestamp || !Number.isFinite(timestampNumber) || signatures.length === 0) {
if (!timestamp || !Number.isFinite(timestampNumber) || signatures.length === 0) {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 213
throw new StripeError('Invalid Stripe webhook signature.', 400);
throw new StripeError('Invalid Stripe webhook signature.', 400);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 214
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 215
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 216
const ageSeconds = Math.abs(Date.now() / 1000 - timestampNumber);
const ageSeconds = Math.abs(Date.now() / 1000 - timestampNumber);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 217
if (ageSeconds > toleranceSeconds) throw new StripeError('Expired Stripe webhook signature.', 400);
if (ageSeconds > toleranceSeconds) throw new StripeError('Expired Stripe webhook signature.', 400);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 218
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 219
const expected = await hmacSha256Hex(secret, `${timestamp}.${rawBody}`);
const expected = await hmacSha256Hex(secret, `${timestamp}.${rawBody}`);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 220
if (!signatures.some((signature) => constantTimeEqual(signature, expected))) {
if (!signatures.some((signature) => constantTimeEqual(signature, expected))) {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 221
throw new StripeError('Invalid Stripe webhook signature.', 400);
throw new StripeError('Invalid Stripe webhook signature.', 400);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 222
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 223
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 224
try {
try {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 225
return JSON.parse(rawBody) as StripeEvent;
return JSON.parse(rawBody) as StripeEvent;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 226
} catch {
} catch {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 227
throw new StripeError('Invalid Stripe webhook payload.', 400);
throw new StripeError('Invalid Stripe webhook payload.', 400);
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 228
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 229
}
}
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 230
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 231
Alex Nord
1 day ago
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 232
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 233
export async function createStripeRefund(
export async function createStripeRefund(
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 234
env: Env,
env: Env,
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 235
paymentIntentId: string,
paymentIntentId: string,
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 236
bookingId: string,
bookingId: string,
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 237
): Promise<StripeRefund> {
): Promise<StripeRefund> {
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 238
if (!/^pi_[A-Za-z0-9_]+$/.test(paymentIntentId)) {
if (!/^pi_[A-Za-z0-9_]+$/.test(paymentIntentId)) {
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 239
throw new StripeError('Invalid Stripe PaymentIntent id.', 400);
throw new StripeError('Invalid Stripe PaymentIntent id.', 400);
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 240
}
}
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 241
const params = new URLSearchParams();
const params = new URLSearchParams();
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 242
params.set('payment_intent', paymentIntentId);
params.set('payment_intent', paymentIntentId);
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 243
params.set('metadata[booking_id]', bookingId);
params.set('metadata[booking_id]', bookingId);
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 244
params.set('metadata[source]', 'slot_booking_cancellation');
params.set('metadata[source]', 'slot_booking_cancellation');
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 245
return stripeRequest<StripeRefund>(env, '/v1/refunds', {
return stripeRequest<StripeRefund>(env, '/v1/refunds', {
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 246
method: 'POST',
method: 'POST',
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 247
body: params.toString(),
body: params.toString(),
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 248
headers: { 'Idempotency-Key': `slot-refund-${bookingId}` },
headers: { 'Idempotency-Key': `slot-refund-${bookingId}` },
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 249
});
});
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 250
}
}
same change
9aa588b
feat: add rescheduling, time proposals and Stripe cancellation refunds
- Full commit hash
9aa588b368f7c46ba3d287199a3d95506867c927- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 251
Alex Nord
1 day ago
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 252
export async function stripeReceiptUrl(env: Env, session: StripeCheckoutSession): Promise<string | null> {
export async function stripeReceiptUrl(env: Env, session: StripeCheckoutSession): Promise<string | null> {
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 253
const paymentIntentId = stripePaymentIntentId(session);
const paymentIntentId = stripePaymentIntentId(session);
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 254
if (!paymentIntentId || !/^pi_[A-Za-z0-9_]+$/.test(paymentIntentId)) return null;
if (!paymentIntentId || !/^pi_[A-Za-z0-9_]+$/.test(paymentIntentId)) return null;
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 255
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 256
const intent = await stripeRequest<StripePaymentIntent>(
const intent = await stripeRequest<StripePaymentIntent>(
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 257
env,
env,
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 258
`/v1/payment_intents/${encodeURIComponent(paymentIntentId)}?expand%5B%5D=latest_charge`,
`/v1/payment_intents/${encodeURIComponent(paymentIntentId)}?expand%5B%5D=latest_charge`,
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 259
);
);
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 260
if (intent.latest_charge && typeof intent.latest_charge !== 'string') {
if (intent.latest_charge && typeof intent.latest_charge !== 'string') {
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 261
return intent.latest_charge.receipt_url ?? null;
return intent.latest_charge.receipt_url ?? null;
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 262
}
}
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 263
if (typeof intent.latest_charge === 'string' && /^ch_[A-Za-z0-9_]+$/.test(intent.latest_charge)) {
if (typeof intent.latest_charge === 'string' && /^ch_[A-Za-z0-9_]+$/.test(intent.latest_charge)) {
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 264
const charge = await stripeRequest<StripeCharge>(env, `/v1/charges/${encodeURIComponent(intent.latest_charge)}`);
const charge = await stripeRequest<StripeCharge>(env, `/v1/charges/${encodeURIComponent(intent.latest_charge)}`);
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 265
return charge.receipt_url ?? null;
return charge.receipt_url ?? null;
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 266
}
}
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 267
return null;
return null;
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 268
}
}
same change
110f91e
Adding indication for test/live key
- Full commit hash
110f91e747192b16de709ea11c5eea17eaeadd48- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 269
Alex Nord
1 day ago
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 270
export function stripePaymentIntentId(session: StripeCheckoutSession): string | null {
export function stripePaymentIntentId(session: StripeCheckoutSession): string | null {
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 271
if (typeof session.payment_intent === 'string') return session.payment_intent;
if (typeof session.payment_intent === 'string') return session.payment_intent;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 272
return session.payment_intent?.id ?? null;
return session.payment_intent?.id ?? null;
same change
9abcc27
Added Stripe payments
- Full commit hash
9abcc271f095921a2c76e260009e53cda98d817a- Author
- Alex Nord <[email protected]>
- Date
- 1 day ago
- Selected line
- 273
}
}