-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix pixel type + pwa * start init stripe checkout + pay * fix stripe test * add preserveSymLinks + undo stripe mobile issue react native version * delete nostr afk package atm * delete preserveSimLink * add global png + change resources to public * add resources pixel in pwa * add resource in pixel src too * fix pwa + package * clean assets * add argent mobile connection * add GA pwa and landing * fix lint * check window + global ts * lint fix * fix typo
- Loading branch information
Showing
100 changed files
with
1,955 additions
and
1,294 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ APP_URL_WEB="http://localhost:8081" | |
|
||
FUNKIT_API_KEY= | ||
|
||
JWT_SECRET= | ||
JWT_SECRET= | ||
STRIPE_SERVER_API_KEY= |
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
1 change: 0 additions & 1 deletion
1
apps/data-backend/src/routes/funkit/get_funkit_stripe_checkout_quote.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
56 changes: 56 additions & 0 deletions
56
apps/data-backend/src/routes/stripe/createPaymentIntent.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,56 @@ | ||
import type { FastifyInstance } from "fastify"; | ||
import { prisma } from "@prisma/client"; | ||
import dotenv from "dotenv" | ||
dotenv.config() | ||
const stripe = require('stripe')(process.env.STRIPE_SERVER_API_KEY); | ||
|
||
interface CreatePaymentIntent { | ||
currency: string; | ||
amount:number; | ||
} | ||
|
||
async function createPaymentIntent( | ||
fastify: FastifyInstance, | ||
) { | ||
fastify.post<{ Body: CreatePaymentIntent }>( | ||
"/create-payment-intent", | ||
|
||
{ | ||
schema: { | ||
body: { | ||
type: "object", | ||
required: ["currency", "amount"], | ||
properties: { | ||
currency: { type: "string", pattern: "^\\+[1-9]\\d{1,14}$" }, | ||
amount:{type:"number"} | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
async (request, reply) => { | ||
|
||
|
||
try { | ||
const { currency } = request.body; | ||
|
||
const paymentIntent = await stripe.paymentIntents.create({ | ||
amount: 1000, // Example amount in smallest currency unit (cents) | ||
currency: currency, | ||
payment_method_types: ['card'], | ||
}); | ||
|
||
reply.send({ | ||
clientSecret: paymentIntent.client_secret, | ||
}); | ||
|
||
return reply.code(200).send({ ok: true }); | ||
} catch (error) { | ||
fastify.log.error(error); | ||
return reply.code(500).send({ message: "Internal Server Error" }); | ||
} | ||
} | ||
); | ||
} | ||
|
||
export default createPaymentIntent; |
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,73 @@ | ||
import type { FastifyInstance } from "fastify"; | ||
import { prisma } from "@prisma/client"; | ||
import dotenv from "dotenv" | ||
dotenv.config() | ||
const stripe = require('stripe')(process.env.STRIPE_SERVER_API_KEY); | ||
|
||
interface CreatePaymentSheet { | ||
currency: string; | ||
amount: number; | ||
} | ||
|
||
async function paymentSheet( | ||
fastify: FastifyInstance, | ||
) { | ||
fastify.post<{ Body: CreatePaymentSheet }>( | ||
"/payment-sheet", | ||
|
||
{ | ||
schema: { | ||
body: { | ||
type: "object", | ||
required: ["currency", "amount"], | ||
properties: { | ||
currency: { type: "string", pattern: "^\\+[1-9]\\d{1,14}$" }, | ||
amount: { type: "number" } | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
async (request, reply) => { | ||
|
||
|
||
try { | ||
const { currency } = request.body; | ||
|
||
|
||
// Create a customer | ||
const customer = await stripe.customers.create(); | ||
|
||
// Create an ephemeral key for the customer | ||
const ephemeralKey = await stripe.ephemeralKeys.create( | ||
{ customer: customer.id }, | ||
{ apiVersion: '2022-11-15' } // Ensure to use the latest API version | ||
); | ||
|
||
|
||
const paymentIntent = await stripe.paymentIntents.create({ | ||
amount: 1000, // Example amount in smallest currency unit (cents) | ||
currency: currency, | ||
payment_method_types: ['card'], | ||
}); | ||
|
||
// reply.send({ | ||
// clientSecret: paymentIntent.client_secret, | ||
// }); | ||
|
||
return reply.code(200).send({ | ||
paymentIntent: paymentIntent.client_secret, | ||
ephemeralKey: ephemeralKey.secret, | ||
customer: customer.id, | ||
}); | ||
|
||
// return reply.code(200).send({ ok: true }); | ||
} catch (error) { | ||
fastify.log.error(error); | ||
return reply.code(500).send({ message: "Internal Server Error" }); | ||
} | ||
} | ||
); | ||
} | ||
|
||
export default paymentSheet; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} | ||
{"name":"AFK Aligned Fam Kernel","short_name":"AFK","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} |
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
Oops, something went wrong.