summaryrefslogtreecommitdiff
path: root/payments.php
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2021-09-12 17:26:24 -0400
committer53hornet <atc@53hor.net>2021-09-12 17:26:24 -0400
commit9da420c624521d54ff9d4d8bd944bcd7a3a03b7e (patch)
tree67f820c5b4eab772b8479dc17c52e06525abbee3 /payments.php
parent2901cf43bf45ff322fb62286c3bf1594b55c20ee (diff)
download53hor-9da420c624521d54ff9d4d8bd944bcd7a3a03b7e.tar.xz
53hor-9da420c624521d54ff9d4d8bd944bcd7a3a03b7e.zip
feat: update hire, updated css, tweaked payments
Diffstat (limited to 'payments.php')
-rw-r--r--payments.php49
1 files changed, 35 insertions, 14 deletions
diff --git a/payments.php b/payments.php
index 2fb35c3..9a7d037 100644
--- a/payments.php
+++ b/payments.php
@@ -1,13 +1,29 @@
-<div id="smart-button-container">
- <div style="text-align: center"><label for="description">Description of services </label><input type="text" name="descriptionInput" id="description" maxlength="127" value=""></div>
- <p id="descriptionError" style="visibility: hidden; color:red; text-align: center;">Please enter a description</p>
- <div style="text-align: center"><label for="amount">Amount to be paid </label><input name="amountInput" type="number" id="amount" value=""><span> USD</span></div>
- <p id="priceLabelError" style="visibility: hidden; color:red; text-align: center;">Please enter a price</p>
- <div id="invoiceidDiv" style="text-align: center; display: none;"><label for="invoiceid">Invoice ID (if applicable) </label><input name="invoiceid" maxlength="127" type="text" id="invoiceid" value=""></div>
- <p id="invoiceidError" style="visibility: hidden; color:red; text-align: center;">Please enter an Invoice ID</p>
+<?php
+$title = "Payments";
+include('./includes/head.php');
+?>
+
+<!--PAYPAL-->
+<div id="smart-button-container" class="form">
+ <p id="invoiceidError" class="description">Please enter an Invoice ID</p>
+ <p id="descriptionError" class="description">Please enter a description</p>
+ <p id="priceLabelError" class="description">Please enter a price</p>
+
+ <div id="invoiceidDiv"><label for="invoiceid">Invoice ID</label>
+ <input name="invoiceid" maxlength="127" type="text" id="invoiceid" value="<?php echo $_GET['invoice'] ?? ''; ?> ">
+ </div>
+
+ <div><label for="description">Description of services </label>
+ <input type="text" name="descriptionInput" id="description" maxlength="127" value="<?php echo $_GET['desc'] ?? ''; ?> ">
+ </div>
+ <div><label for="amount">Amount (USD)</label>
+ <input name="amountInput" type="number" id="amount" value="<?php echo $_GET['amount'] ?? ''; ?>">
+ </div>
<div style="text-align: center; margin-top: 0.625rem;" id="paypal-button-container"></div>
</div>
+
<script src="https://www.paypal.com/sdk/js?client-id=sb&enable-funding=venmo&currency=USD" data-sdk-integration-source="button-factory"></script>
+
<script>
function initPayPalButton() {
var description = document.querySelector('#smart-button-container #description');
@@ -32,12 +48,17 @@
return event.value.length > 0;
}
+ // var result = elArr.every(validate);
+ // if (result) {
+ // actions.enable();
+ // }
+
paypal.Buttons({
style: {
color: 'white',
shape: 'pill',
label: 'pay',
- layout: 'vertical',
+ layout: 'horizontal',
},
@@ -62,21 +83,21 @@
onClick: function() {
if (description.value.length < 1) {
- descriptionError.style.visibility = "visible";
+ descriptionError.style.display = "block";
} else {
- descriptionError.style.visibility = "hidden";
+ descriptionError.style.display = "none";
}
if (amount.value.length < 1) {
- priceError.style.visibility = "visible";
+ priceError.style.display = "block";
} else {
- priceError.style.visibility = "hidden";
+ priceError.style.display = "none";
}
if (invoiceid.value.length < 1 && invoiceidDiv.style.display === "block") {
- invoiceidError.style.visibility = "visible";
+ invoiceidError.style.display = "block";
} else {
- invoiceidError.style.visibility = "hidden";
+ invoiceidError.style.display = "none";
}
purchase_units[0].description = description.value;