Added option to change UPI ID for cashier
This commit is contained in:
parent
afebd5672c
commit
3b538ac947
15
new.html
15
new.html
@ -20,7 +20,7 @@
|
||||
|
||||
//Required for blockchain API operators
|
||||
apiURL: {
|
||||
FLO: ['https://livenet.flocha.in/', 'https://flosight.duckdns.org/'],
|
||||
FLO: ['https://flosight.duckdns.org/', 'https://livenet.flocha.in/'],
|
||||
FLO_TEST: ['https://testnet-flosight.duckdns.org/', 'https://testnet.flocha.in/']
|
||||
},
|
||||
adminID: "FKAEdnPfjXLHSYwrXQu377ugN4tXU7VGdf",
|
||||
@ -203,7 +203,7 @@
|
||||
</section>
|
||||
</tab-panels>
|
||||
</section>
|
||||
<section id="settings" class="page hide gap-1-5">
|
||||
<section id="settings" class="page hide gap-2">
|
||||
<h4>Settings</h4>
|
||||
<section class="grid gap-1">
|
||||
<div class="grid">
|
||||
@ -212,6 +212,17 @@
|
||||
</div>
|
||||
<sm-button class="danger justify-self-start" onclick="signOut()">Sign out</sm-button>
|
||||
</section>
|
||||
<section class="admin-element grid gap-1">
|
||||
<h4>Change UPI ID</h4>
|
||||
<sm-form style="width: min(100%,24rem);">
|
||||
<sm-input id="upi_id" placeholder="UPI ID" pattern="[a-zA-Z0-9_]{3,}@[a-zA-Z]{3,}"
|
||||
error-text="Invalid UPI ID" animate required></sm-input>
|
||||
<button class="button button--primary cta justify-self-start" type="submit"
|
||||
onclick="changeUpi()">
|
||||
Change
|
||||
</button>
|
||||
</sm-form>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
<nav id="main_navbar">
|
||||
|
||||
@ -285,6 +285,15 @@ function executeUserAction() {
|
||||
}
|
||||
}
|
||||
|
||||
function changeUpi() {
|
||||
const upiID = getRef('upi_id').value.trim()
|
||||
Cashier.updateUPI(upiID).then(() => {
|
||||
notify('UPI ID updated successfully', 'success')
|
||||
}).catch(err => {
|
||||
notify(err, 'error')
|
||||
})
|
||||
}
|
||||
|
||||
function signOut() {
|
||||
getConfirmation('Sign out?', 'You are about to sign out of the app, continue?', 'Stay', 'Leave')
|
||||
.then(async (res) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user