Starting Foundation automation
This commit is contained in:
95
roles/Foundation/files/web-snippets/pay/index
Normal file
95
roles/Foundation/files/web-snippets/pay/index
Normal file
@@ -0,0 +1,95 @@
|
||||
<div class="ui stackable middle very relaxed page grid">
|
||||
<script src="https://js.stripe.com/v3"></script>
|
||||
<div class="sixteen wide center aligned centered column">
|
||||
<h1 class="ui icon header title">
|
||||
AniNIX
|
||||
</h1>
|
||||
<h2>Our Storefront</h2>
|
||||
<p>We have limited service offerings available. Please contact an admin on IRC first to arrange the contract, then use the item below to pay the invoice.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui stackable middle very relaxed page grid">
|
||||
<div class="sixteen wide center column" >
|
||||
<h1 class="hero ui icon header">
|
||||
<img width=20px height=20px src='/img/icons/CoreIcon.png'/>
|
||||
Cybersecurity Consulting
|
||||
</h1>
|
||||
<p class="large">The AniNIX offers cybersecurity consulting and advice services on a limited basis. We bill at $20 an hour -- please select your need below after negotiating with an admin.</p>
|
||||
<p class="large">
|
||||
<form action="./storefront.html" id="hours">
|
||||
<label for="hourcount">Hours required</label>
|
||||
<select name="hourcount" id="hourscount">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
<option value="9">9</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
</select>
|
||||
<br/>
|
||||
</form>
|
||||
<!-- START STRIPE CODE -->
|
||||
|
||||
<!-- Create a button that your customers click to complete their purchase. Customize the styling to suit your branding. -->
|
||||
<button
|
||||
style="background-color:#6772E5;color:#FFF;padding:8px 12px;border:0;border-radius:4px;font-size:1em"
|
||||
id="checkout-button-price_1HTuehI49P1uFPoXCW9pJg5E"
|
||||
role="link"
|
||||
type="button"
|
||||
>
|
||||
Checkout
|
||||
</button>
|
||||
|
||||
<div id="error-message"></div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
var stripe = Stripe('pk_live_51HThYnI49P1uFPoX5ARnHSpT9D08Gbfux6O25waFLpPBsnZoLDuqopFAZeLfu0CbbICxEnPZOOLkDLTlcNjkazs100ElKcF2QX');
|
||||
|
||||
var checkoutButton = document.getElementById('checkout-button-price_1HTuehI49P1uFPoXCW9pJg5E');
|
||||
checkoutButton.addEventListener('click', function () {
|
||||
// When the customer clicks on the button, redirect
|
||||
// them to Checkout.
|
||||
stripe.redirectToCheckout({
|
||||
lineItems: [{price: 'price_1HTuehI49P1uFPoXCW9pJg5E', quantity: parseInt(document.getElementById('hourscount').value)}],
|
||||
mode: 'payment',
|
||||
// Do not rely on the redirect to the successUrl for fulfilling
|
||||
// purchases, customers may not always reach the success_url after
|
||||
// a successful payment.
|
||||
// Instead use one of the strategies described in
|
||||
// https://stripe.com/docs/payments/checkout/fulfill-orders
|
||||
successUrl: window.location.protocol + '//aninix.net/pay/thank-you.html',
|
||||
cancelUrl: window.location.protocol + '//aninix.net/pay/storefront.html',
|
||||
})
|
||||
.then(function (result) {
|
||||
if (result.error) {
|
||||
// If `redirectToCheckout` fails due to a browser or network
|
||||
// error, display the localized error message to your customer.
|
||||
var displayError = document.getElementById('error-message');
|
||||
displayError.textContent = result.error.message;
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<! -- END STRIPE CODE -->
|
||||
</p>
|
||||
</div>
|
||||
<hr style="margin-top: 50px;" />
|
||||
</div>
|
12
roles/Foundation/files/web-snippets/pay/thank-you
Normal file
12
roles/Foundation/files/web-snippets/pay/thank-you
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="ui stackable middle very relaxed page grid">
|
||||
<div class="sixteen wide center aligned centered column">
|
||||
<div>
|
||||
<img class="logo" src="/img/icons/CoreIcon.png" />
|
||||
</div>
|
||||
<div class="hero">
|
||||
<h2 class="ui icon header title">
|
||||
Thank you for your purchase!
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user