@@ -62,35 +62,77 @@
v-model.trim="checkoutDialog.data.username"
label="Name *optional"
>
+
+
+
+ It seems you haven't logged in. You can:
+
+ -
+ enter your public and private keys bellow (to sign the order
+ message)
+
+ - use a Nostr Signer Extension (NIP07)
+ -
+ fill out the required fields, without keys, and download the
+ order and send as a direct message to the merchant on any
+ Nostr client
+
+
+
+
+ Use a Nostr browser extension
+ Download the order and send manually
+
+
+
+
+
+
-
Download Order
+
Checkout
@@ -154,7 +208,7 @@
position="top"
@hide="closeQrCodeDialog"
>
-
+
diff --git a/static/components/customer-stall/customer-stall.js b/static/components/customer-stall/customer-stall.js
index 58ab910..b417c91 100644
--- a/static/components/customer-stall/customer-stall.js
+++ b/static/components/customer-stall/customer-stall.js
@@ -16,6 +16,7 @@ async function customerStall(path) {
data: function () {
return {
loading: false,
+ isPwd: true,
cart: {
total: 0,
size: 0,
@@ -113,6 +114,24 @@ async function customerStall(path) {
products: new Map()
}
},
+ async downloadOrder() {
+ return
+ },
+ async getFromExtension() {
+ this.customerPubkey = await window.nostr.getPublicKey()
+ this.customerUseExtension = true
+ this.checkoutDialog.data.pubkey = this.customerPubkey
+ },
+ openCheckout() {
+ // Check if user is logged in
+ if (this.customerPubkey) {
+ this.checkoutDialog.data.pubkey = this.customerPubkey
+ if (this.customerPrivkey && !useExtension) {
+ this.checkoutDialog.data.privkey = this.customerPrivkey
+ }
+ }
+ this.checkoutDialog.show = true
+ },
resetCheckout() {
this.checkoutDialog = {
show: false,
@@ -296,9 +315,9 @@ async function customerStall(path) {
}
},
created() {
- this.customerPubkey = this.account.pubkey
- this.customerPrivkey = this.account.privkey
- this.customerUseExtension = this.account.useExtension
+ this.customerPubkey = this.account?.pubkey
+ this.customerPrivkey = this.account?.privkey
+ this.customerUseExtension = this.account?.useExtension
setTimeout(() => {
if (window.nostr) {
this.hasNip07 = true