Hi! Yes here you go. thanks! So basically i created a new page, put in the text, pasted the code, and then published it. However, even when it shows up, and the process of purchasing something works, i don't see any withdrawal from my bank account or any thing new in my paypal. https://www.cmscva.org/ <div id="smart-button-container"> <div style="text-align: center;"> <div style="margin-bottom: 1.25rem;"> <p></p> <select id="item-options"><option value="5 Dollars" price="5">5 Dollars - 5 USD</option><option value="15 Dollars" price="15">15 Dollars - 15 USD</option><option value="30 Dollars" price="30">30 Dollars - 30 USD</option><option value="60 Dollars" price="60">60 Dollars - 60 USD</option><option value="Custom" price="">Custom - USD</option></select> <select style="visibility: hidden" id="quantitySelect"><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></select> </div> <div id="paypal-button-container"></div> </div> </div> <script src="https://www.paypal.com/sdk/js?client-id=sb¤cy=USD" data-sdk-integration-source="button-factory"></script> <script> function initPayPalButton() { var shipping = 0; var itemOptions = document.querySelector("#smart-button-container #item-options"); var quantity = parseInt(10); var quantitySelect = document.querySelector("#smart-button-container #quantitySelect"); if (!isNaN(quantity)) { quantitySelect.style.visibility = "visible"; } var orderDescription = ''; if(orderDescription === '') { orderDescription = 'Item'; } paypal.Buttons({ style: { shape: 'pill', color: 'silver', layout: 'vertical', label: 'checkout', }, createOrder: function(data, actions) { var selectedItemDescription = itemOptions.options[itemOptions.selectedIndex].value; var selectedItemPrice = parseFloat(itemOptions.options[itemOptions.selectedIndex].getAttribute("price")); var tax = (0 === 0) ? 0 : (selectedItemPrice * (parseFloat(0)/100)); if(quantitySelect.options.length > 0) { quantity = parseInt(quantitySelect.options[quantitySelect.selectedIndex].value); } else { quantity = 1; } tax *= quantity; tax = Math.round(tax * 100) / 100; var priceTotal = quantity * selectedItemPrice + parseFloat(shipping) + tax; priceTotal = Math.round(priceTotal * 100) / 100; var itemTotalValue = Math.round((selectedItemPrice * quantity) * 100) / 100; return actions.order.create({ purchase_units: [{ description: orderDescription, amount: { currency_code: 'USD', value: priceTotal, breakdown: { item_total: { currency_code: 'USD', value: itemTotalValue, }, shipping: { currency_code: 'USD', value: shipping, }, tax_total: { currency_code: 'USD', value: tax, } } }, items: [{ name: selectedItemDescription, unit_amount: { currency_code: 'USD', value: selectedItemPrice, }, quantity: quantity }] }] }); }, onApprove: function(data, actions) { return actions.order.capture().then(function(details) { alert('Transaction completed by ' + details.payer.name.given_name + '!'); }); }, onError: function(err) { console.log(err); }, }).render('#paypal-button-container'); } initPayPalButton(); </script>
... View more