This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d8a0f6
commit 8992e63
Showing
12 changed files
with
238 additions
and
26 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { DataTypes, Sequelize } from 'sequelize'; | ||
import { Migration } from '../bin/migrate'; | ||
|
||
// ATTENTION à bien underscorer manuellement les noms de colonnes | ||
export const up: Migration = async ({ | ||
context: sequelize, | ||
}: { | ||
context: Sequelize; | ||
}) => { | ||
await sequelize.getQueryInterface().addColumn('orders', 'session_id', { | ||
type: DataTypes.TEXT('long'), | ||
allowNull: false, | ||
}); | ||
}; | ||
|
||
export const down: Migration = async ({ | ||
context: sequelize, | ||
}: { | ||
context: Sequelize; | ||
}) => { | ||
await sequelize.getQueryInterface().removeColumn('orders', 'session_id'); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<script setup lang="ts"> | ||
import BasePage from '@/components/BasePage.vue'; | ||
import { RouterLink, useRoute } from 'vue-router'; | ||
import { ref, onMounted } from 'vue'; | ||
const route = useRoute(); | ||
const reference = route.params.reference; | ||
const linkPaiement = ref(''); | ||
const error = ref(''); | ||
const BASE_URL = import.meta.env.VITE_API_URL | ||
onMounted(async () => { | ||
try { | ||
const response = await fetch(`${BASE_URL}/checkout/cancel/${reference}`, { | ||
method: 'GET', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
credentials: 'include' | ||
}); | ||
if (!response.ok) { | ||
throw new Error('Network response was not ok'); | ||
} | ||
const data = await response.json(); | ||
console.log(data); | ||
linkPaiement.value = data.url; | ||
} catch (err) { | ||
error.value = err.message; | ||
} | ||
}); | ||
</script> | ||
|
||
<template> | ||
<BasePage> | ||
<div class="text-center h-full w-full my-auto"> | ||
<h1 class="text-2xl font-semibold">Votre paiement a échoué</h1> | ||
|
||
<p class="mt-4">Votre paiement a échoué. Veuillez réessayer.</p> | ||
|
||
|
||
|
||
<button type="button" class="bg-black text-white p-3 px-5 my-4"> | ||
|
||
<a :href="linkPaiement">Retourner à la page de paiement</a> | ||
|
||
|
||
</button> | ||
</div> | ||
</BasePage> | ||
</template> | ||
|
||
<style scoped></style> |
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,39 @@ | ||
<script setup lang="ts"> | ||
import BasePage from '@/components/BasePage.vue'; | ||
import { RouterLink, useRoute } from 'vue-router'; | ||
import { ref, onMounted } from 'vue'; | ||
const reference = ref(''); | ||
onMounted(async () => { | ||
const route = useRoute(); | ||
reference.value = route.params.reference as string; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<BasePage> | ||
<div class="text-center h-full w-full my-auto"> | ||
<h1 class="text-2xl font-semibold">Merci pour votre commande</h1> | ||
|
||
<p class="mt-4">Votre commande a été traitée avec succès.</p> | ||
|
||
|
||
|
||
<button type="button" class="bg-black text-white p-3 px-5 my-4"> | ||
|
||
<RouterLink :to="'/order/' + reference"> | ||
Voir les détails de la commande | ||
</RouterLink> | ||
|
||
|
||
|
||
</button> | ||
</div> | ||
</BasePage> | ||
</template> | ||
|
||
<style scoped></style> |
Oops, something went wrong.