Add money order verification
parent
a1c176986d
commit
325099841a
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
$("#app").on("submit", "#moneyorderForm", function (e) {
|
||||
e.preventDefault();
|
||||
verifyMoneyOrder($('#moneyorderserial').val());
|
||||
return false;
|
||||
});
|
||||
|
||||
function verifyMoneyOrder(serial) {
|
||||
if (typeof serial != "string" || serial == "" || /^[0-9]{3,8}$/.test(serial) == false) {
|
||||
app.dialog.alert("Enter a valid Helena Express money order serial number.", "Whoops!");
|
||||
return;
|
||||
}
|
||||
app.dialog.preloader("Working...");
|
||||
apirequest(SETTINGS.apis.moneyorderverify, {
|
||||
serial: serial
|
||||
}, function (resp) {
|
||||
app.dialog.close();
|
||||
if (resp.status == "OK") {
|
||||
app.dialog.alert("Amount: $" + resp.amount
|
||||
+ "<br>Issued: " + resp.issued_date + " UTC"
|
||||
+ (resp.mo_status == "" ? "" : "<br>Status: " + resp.mo_status),
|
||||
"Money Order #" + resp.serial);
|
||||
} else {
|
||||
app.dialog.alert(resp.msg, "Error");
|
||||
}
|
||||
}, function (error) {
|
||||
app.dialog.close();
|
||||
app.dialog.alert("Connection or server error. Try again later.", "Whoops!");
|
||||
sendErrorReport("Money Order", "Verification");
|
||||
});
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<div class="page" data-name="money">
|
||||
|
||||
<div class="navbar">
|
||||
<div class="navbar-bg"></div>
|
||||
<div class="navbar-inner">
|
||||
<div class="left">
|
||||
<a class="link back hapticbtn" href="#">
|
||||
<i class="icon icon-back"></i>
|
||||
<span class="if-not-md">Back</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="title">Money</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content noselect">
|
||||
<div class="row justify-content-center margin-top">
|
||||
<div class="col-100 medium-90 xlarge-75 margin-horizontal">
|
||||
<div class="row justify-content-center">
|
||||
{{#each pages}}
|
||||
<div class="col-100 small-50 large-33 no-margin-vertical">
|
||||
<div class="card hapticbtn pointercursor" onclick="router.navigate('{{href}}');">
|
||||
<div class="card-content text-align-center padding">
|
||||
<h1 class="no-margin"><i class="{{icon}}"></i></h1>
|
||||
<br />
|
||||
<span style="font-weight: 700;">{{title}}</span>
|
||||
<br />
|
||||
<span>{{text}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,48 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<div class="page" data-name="moneyorder">
|
||||
|
||||
<div class="navbar">
|
||||
<div class="navbar-bg"></div>
|
||||
<div class="navbar-inner">
|
||||
<div class="left">
|
||||
<a class="link back" href="#">
|
||||
<i class="icon icon-back"></i>
|
||||
<span class="if-not-md">Back</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="title">Verify Money Order</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-100 medium-90 xlarge-75 margin-horizontal">
|
||||
<div class="card margin">
|
||||
<form class="card-content padding-vertical" id="moneyorderForm">
|
||||
<div class="list media-list">
|
||||
<ul>
|
||||
<li class="item-content item-input item-input-outline">
|
||||
<div class="item-inner">
|
||||
<div class="item-title item-floating-label">Serial Number</div>
|
||||
<div class="item-input-wrap">
|
||||
<input type="text" id="moneyorderserial" placeholder="12345" />
|
||||
<span class="input-clear-button"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="padding">
|
||||
<div class="button hapticbtn button-fill" onclick="verifyMoneyOrder($('#moneyorderserial').val())"><i class="fa-solid fa-magnifying-glass-dollar"></i> Verify</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
Loading…
Reference in New Issue