#41 fix naming problem, added creator-id prop for the payment. Redirect and message for paymentCompleted changed to generic for now

This commit is contained in:
Dominic Villemure
2024-05-09 22:38:44 -04:00
parent 97f03abb93
commit 26845f5aff
9 changed files with 14 additions and 24 deletions

View File

@@ -7,7 +7,6 @@
</v-text-field>
</v-row>
<v-row>
<v-text-field label="Montant ($)" v-model="price"
style="border-radius: 10px; margin-bottom: 10px; color: #a30e79; background-color: #f4f4f4">
@@ -24,7 +23,6 @@
</v-btn>
</v-row>
<v-dialog v-model="isPaymentDialogActive" max-width="720" persistent>
<template v-slot:default>
<v-card>
@@ -40,10 +38,6 @@
</v-dialog>
</v-container>
</template>
<script setup>
@@ -51,6 +45,8 @@ import { useClient } from '@/plugins/api.js';
import { loadStripe } from '@stripe/stripe-js';
import { onMounted, ref } from "vue";
const props = defineProps(['creatorId'])
let stripe = null;
const client = useClient();
const price = ref(0);
@@ -72,7 +68,7 @@ async function createCheckoutSession() {
let clientSecret = await client.post('/api/Stripe', {
amount: (price.value * 100),
tipMessage: tipMessage.value,
creatorId: "5b122430-442a-4967-98b6-6c7787c70c91"
creatorId: props.creatorId
});
let secret = clientSecret["data"];