Server IP : 92.204.138.22 / Your IP : 3.140.196.3 Web Server : Apache System : Linux ns1009439.ip-92-204-138.us 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64 User : internationaljou ( 1019) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/internationaljou/public_html/ |
Upload File : |
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <style> div#smart-button-container div { text-align: left !important;} div#smart-button-container { float: left; text-align: left;} label { width: 97px; padding-top: 10px;} p#descriptionError, p#invoiceidError { display: flex;} p#invoiceidError { color: snow; height: 0; margin: 0;} div#buttons-container,.paypal-button-container { max-width: 350px!important;width: 350px!important;} .paypal-button-container,div#paypal-button-container { width: 350px !important; max-width: 350px !important;} </style> <body> <div id="smart-button-container"> <div style="text-align: left; float: left; display: flex;"><label for="description">Artical ID </label><input maxlength="127" name="descriptionInput" type="text" value="" id="description" style="text-align: left; float: left;" /></div> <p id="descriptionError" style="visibility: hidden; color: red; text-align: center;">Please enter a description</p> <div style="text-align: left; float: left; display: flex;"><label for="amount">APC </label><input name="amountInput" type="number" value="" id="amount" style="text-align: left; float: left;" /><span style="padding-left: 10px;"> 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: left; display: none;"><label for="invoiceid"> </label><input maxlength="127" name="invoiceid" type="text" value="" id="invoiceid" /></div> <p id="invoiceidError" style="visibility: hidden; color: red; text-align: center;">Please enter an Invoice ID</p> <div id="paypal-button-container" style="text-align: center; margin-top: 0.625rem;"> </div> </div> <!--<script src="https://www.paypal.com/sdk/js?client-id=sb&enable-funding=venmo¤cy=USD" data-sdk-integration-source="button-factory"></script>--> <script src="https://www.paypal.com/sdk/js?client-id=AYbDae3fILQSP-ZmhijGb1EbPD9rgM9FzlIh9JT9zJtbsq3nOpreLGqCqJ1mCO4cNsZ_fXGKxM9RtKn6&enable-funding=venmo¤cy=USD" data-sdk-integration-source="button-factory"></script> <script type="text/javascript"> function initPayPalButton() { var description = document.querySelector('#smart-button-container #description'); var amount = document.querySelector('#smart-button-container #amount'); var descriptionError = document.querySelector('#smart-button-container #descriptionError'); var priceError = document.querySelector('#smart-button-container #priceLabelError'); var invoiceid = document.querySelector('#smart-button-container #invoiceid'); var invoiceidError = document.querySelector('#smart-button-container #invoiceidError'); var invoiceidDiv = document.querySelector('#smart-button-container #invoiceidDiv'); var elArr = [description, amount]; if (invoiceidDiv.firstChild.innerHTML.length > 1) { invoiceidDiv.style.display = "block"; } var purchase_units = []; purchase_units[0] = {}; purchase_units[0].amount = {}; function validate(event) { return event.value.length > 0; } paypal.Buttons({ style: { color: 'gold', shape: 'rect', label: 'paypal', layout: 'vertical', }, onInit: function (data, actions) { actions.disable(); if(invoiceidDiv.style.display === "block") { elArr.push(invoiceid); } elArr.forEach(function (item) { item.addEventListener('keyup', function (event) { var result = elArr.every(validate); if (result) { actions.enable(); } else { actions.disable(); } }); }); }, onClick: function () { if (description.value.length < 1) { descriptionError.style.visibility = "visible"; } else { descriptionError.style.visibility = "hidden"; } if (amount.value.length < 1) { priceError.style.visibility = "visible"; } else { priceError.style.visibility = "hidden"; } if (invoiceid.value.length < 1 && invoiceidDiv.style.display === "block") { invoiceidError.style.visibility = "visible"; } else { invoiceidError.style.visibility = "hidden"; } purchase_units[0].description = description.value; purchase_units[0].amount.value = amount.value; if(invoiceid.value !== '') { purchase_units[0].invoice_id = invoiceid.value; } }, createOrder: function (data, actions) { return actions.order.create({ intent: "CAPTURE", application_context: { brand_name: "Kittle", user_action: "PAY_NOW", // Don't change this value. shipping_preference: "NO_SHIPPING", // Don't change this value. payment_method:{ payer_selected:"PAYPAL", // Don't change this value. payee_preferred:"IMMEDIATE_PAYMENT_REQUIRED" // Don't change this value. } }, purchase_units: purchase_units, }); }, onApprove: function (data, actions) { return actions.order.capture().then(function (orderData) { // Full available details console.log('Capture result', orderData, JSON.stringify(orderData, null, 2)); // Show a success message within this page, e.g. const element = document.getElementById('paypal-button-container'); element.innerHTML = ''; element.innerHTML = '<h3>Thank you for your payment!</h3>'; // Or go to another URL: actions.redirect('thank_you.html'); }); }, onError: function (err) { console.log(err); } }).render('#paypal-button-container'); } initPayPalButton(); </script> </body> </html>