payment intent test

This commit is contained in:
Elmo Kankkunen
2023-09-20 23:45:25 +03:00
parent 0db4837fe1
commit 77c9052d1b
+10 -7
View File
@@ -1,19 +1,20 @@
import React from "react"; import React from "react";
import { TextSection, Link } from "@components/index"; import { TextSection, Link } from "@components/index";
import Button from "@components/Button" import Button from "@components/Button";
import Stripe from "stripe" import Stripe from "stripe";
const stripe = new Stripe("", // <--- API AVAIN const stripe = new Stripe(
{apiVersion: "2023-08-16"} "", // <--- API AVAIN
{ apiVersion: "2023-08-16" },
); );
const paymentIntentTest = async () => { const paymentIntentTest = async () => {
const intent = await stripe.paymentIntents.create ({ const intent = await stripe.paymentIntents.create({
amount: 8, amount: 8,
currency: "eur", currency: "eur",
}); });
return intent; return intent;
} };
const JoinPageView: React.FC = () => ( const JoinPageView: React.FC = () => (
<> <>
@@ -22,8 +23,10 @@ const JoinPageView: React.FC = () => (
<p> <p>
Killan jäsenhakemuksen voi täyttää <Link to="https://api.sahkoinsinoorikilta.fi/members/application">täältä.</Link> Muistakaa Killan jäsenhakemuksen voi täyttää <Link to="https://api.sahkoinsinoorikilta.fi/members/application">täältä.</Link> Muistakaa
myös maksaa jäsenmaksu! myös maksaa jäsenmaksu!
<Button onClick={paymentIntentTest} buttonStyle={"hero"} >
Payment intent testi
</Button>
</p> </p>
<Button onClick={paymentIntentTest} buttonStyle={"hero"} >Payment intent testi</Button>
</TextSection> </TextSection>
</> </>
) )