From cf7c73c527000ced9c417d0c4adff605ef6caf86 Mon Sep 17 00:00:00 2001 From: silverpill Date: Sun, 18 Sep 2022 11:51:09 +0000 Subject: [PATCH] Preserve payment info if subscription page is reloaded --- src/api/subscriptions-monero.ts | 8 ++++++- src/components/SubscriptionMonero.vue | 31 ++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/api/subscriptions-monero.ts b/src/api/subscriptions-monero.ts index 747c2c0..07aa7e2 100644 --- a/src/api/subscriptions-monero.ts +++ b/src/api/subscriptions-monero.ts @@ -55,17 +55,23 @@ export interface Invoice { sender_id: string, recipient_id: string, payment_address: string, + amount: number, status: string, } export async function createInvoice( senderId: string, recipientId: string, + amount: number, ): Promise { const url = `${BACKEND_URL}/api/v1/subscriptions/invoices` const response = await http(url, { method: "POST", - json: { sender_id: senderId, recipient_id: recipientId }, + json: { + sender_id: senderId, + recipient_id: recipientId, + amount, + }, }) const data = await response.json() if (response.status !== 200) { diff --git a/src/components/SubscriptionMonero.vue b/src/components/SubscriptionMonero.vue index fba4299..0121a2a 100644 --- a/src/components/SubscriptionMonero.vue +++ b/src/components/SubscriptionMonero.vue @@ -78,13 +78,14 @@
-
Please send {{ formatXmrAmount(paymentAmount) }} XMR to this address:
+
Please send {{ formatXmrAmount(invoice.amount) }} XMR to this address:
{{ invoice.payment_address }}
- + +
- +
@@ -93,6 +94,7 @@