mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-12 18:43:50 +00:00
Merge branch '14-add-ability-to-record-that-a-user-has-gained-access-to-a-software-product-after-purchase-1' of https://github.com/jcreek/SvelteKitSaasBoilerplate into 14-add-ability-to-record-that-a-user-has-gained-access-to-a-software-product-after-purchase-1
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
import stripe from 'stripe';
|
||||
import type { Database, Tables, TablesInsert } from '$types/supabase';
|
||||
import {
|
||||
PUBLIC_SUPABASE_URL,
|
||||
SUPABASE_SERVICE_ROLE_KEY,
|
||||
PUBLIC_STRIPE_SECRET_KEY
|
||||
} from '$env/static/public';
|
||||
import { PUBLIC_SUPABASE_URL, PUBLIC_STRIPE_SECRET_KEY } from '$env/static/public';
|
||||
import { SUPABASE_SERVICE_ROLE_KEY } from '$env/static/private';
|
||||
|
||||
const toDateTime = (secs: number) => {
|
||||
const t = new Date(+0); // Unix epoch start.
|
||||
|
||||
@@ -82,10 +82,9 @@ export const POST: RequestHandler = async ({ request }) => {
|
||||
}
|
||||
|
||||
// Return a response to acknowledge receipt of the event
|
||||
return {
|
||||
status: 200,
|
||||
body: { received: true }
|
||||
};
|
||||
return new Response(JSON.stringify({ received: true }), {
|
||||
status: 200
|
||||
});
|
||||
} catch (err) {
|
||||
console.log(`Webhook Error: ${err.message}`);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user