Mollie
This commit is contained in:
@@ -3,4 +3,4 @@ import { createMollieClient } from "@mollie/api-client";
|
|||||||
export const TEST_MOLLIE_API_TOKEN = "test_jenmp2Pq3j3N6HeQxwx7qbHasWMdnx";
|
export const TEST_MOLLIE_API_TOKEN = "test_jenmp2Pq3j3N6HeQxwx7qbHasWMdnx";
|
||||||
export const LIVE_MOLLIE_API_TOKEN = "live_C9qrCGR6fjJfFpbEngeFpfGFcW9Jwq";
|
export const LIVE_MOLLIE_API_TOKEN = "live_C9qrCGR6fjJfFpbEngeFpfGFcW9Jwq";
|
||||||
|
|
||||||
export const mollieClient = createMollieClient({ apiKey: TEST_MOLLIE_API_TOKEN })
|
export const mollieClient = createMollieClient({ apiKey: LIVE_MOLLIE_API_TOKEN })
|
||||||
@@ -216,9 +216,9 @@ export const PUT = defineApiRoute({
|
|||||||
},
|
},
|
||||||
method: input.bezahlmethode as PaymentMethod,
|
method: input.bezahlmethode as PaymentMethod,
|
||||||
description: "Verbrauchsausweis Wohnen 2016",
|
description: "Verbrauchsausweis Wohnen 2016",
|
||||||
redirectUrl: `https://ibcornelsen.de/payment/success?a=${ausweis.id}&r=${rechnung.id}`,
|
redirectUrl: `https://online-energieausweis.org/payment/success?a=${ausweis.id}&r=${rechnung.id}`,
|
||||||
webhookUrl: `https://ibcornelsen.de/api/webhooks/mollie?id=${rechnung.id}`,
|
webhookUrl: `https://online-energieausweis.org/api/webhooks/mollie`,
|
||||||
cancelUrl: `https://ibcornelsen.de/kundendaten?a=${ausweis.id}&r=${rechnung.id}`
|
cancelUrl: `https://online-energieausweis.org/kundendaten?a=${ausweis.id}&r=${rechnung.id}`
|
||||||
});
|
});
|
||||||
|
|
||||||
const checkoutUrl = payment.getCheckoutUrl();
|
const checkoutUrl = payment.getCheckoutUrl();
|
||||||
|
|||||||
@@ -21,9 +21,6 @@ export const POST = defineApiRoute({
|
|||||||
const payment = await mollieClient.payments.get(id);
|
const payment = await mollieClient.payments.get(id);
|
||||||
const metadata = payment.metadata as { rechnung_id: string }
|
const metadata = payment.metadata as { rechnung_id: string }
|
||||||
|
|
||||||
console.log(payment, metadata, id);
|
|
||||||
|
|
||||||
|
|
||||||
if (!payment) {
|
if (!payment) {
|
||||||
throw new APIError({
|
throw new APIError({
|
||||||
code: "NOT_FOUND",
|
code: "NOT_FOUND",
|
||||||
@@ -45,9 +42,6 @@ export const POST = defineApiRoute({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(rechnung);
|
|
||||||
|
|
||||||
|
|
||||||
if (!rechnung) {
|
if (!rechnung) {
|
||||||
throw new APIError({
|
throw new APIError({
|
||||||
code: "NOT_FOUND",
|
code: "NOT_FOUND",
|
||||||
|
|||||||
Reference in New Issue
Block a user