Add PayPal checkout provider
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export type PendingCheckout = {
|
||||
packageId: number | null;
|
||||
checkoutSessionId?: string | null;
|
||||
orderId?: string | null;
|
||||
startedAt: number;
|
||||
};
|
||||
|
||||
@@ -36,12 +37,14 @@ export function loadPendingCheckout(
|
||||
? parsed.packageId
|
||||
: null;
|
||||
const checkoutSessionId = typeof parsed.checkoutSessionId === 'string' ? parsed.checkoutSessionId : null;
|
||||
const orderId = typeof parsed.orderId === 'string' ? parsed.orderId : null;
|
||||
if (now - parsed.startedAt > ttl) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
packageId,
|
||||
checkoutSessionId,
|
||||
orderId,
|
||||
startedAt: parsed.startedAt,
|
||||
};
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user