86 lines
2.9 KiB
HTML
86 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
<title>ShopOnline.Web</title>
|
|
<base href="/" />
|
|
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
|
|
<link href="css/app.css" rel="stylesheet" />
|
|
<link href="ShopOnline.Web.styles.css" rel="stylesheet" />
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app">Loading...</div>
|
|
|
|
<div id="blazor-error-ui">
|
|
An unhandled error has occurred.
|
|
<a href="" class="reload">Reload</a>
|
|
<a class="dismiss">🗙</a>
|
|
</div>
|
|
<script src="js/ShoppingCartFunctions.js"></script>
|
|
<script src="https://kit.fontawesome.com/fd1b12afc1.js" crossorigin="anonymous"></script>
|
|
<script src="_framework/blazor.webassembly.js"></script>
|
|
|
|
<!-- Paypal Below -->
|
|
|
|
<script src="https://www.paypal.com/sdk/js?client-id=ARuSdR5rsG6Ulu4ly4QP5LoUtJVX-9wGD_4c_eZHWfR2xCynai_iUZN_MnfpUZaDIXTbaqbJRlUI_-Kc¤cy=USD" data-sdk-integration-source="button-factory"></script>
|
|
<script>
|
|
function initPayPalButton() {
|
|
var description = document.querySelector('#smart-button-container #description');
|
|
var amount = document.querySelector('#smart-button-container #amount');
|
|
|
|
var purchase_units = [];
|
|
purchase_units[0] = {};
|
|
purchase_units[0].amount = {};
|
|
|
|
paypal.Buttons({
|
|
style: {
|
|
color: 'gold',
|
|
shape: 'rect',
|
|
label: 'paypal',
|
|
layout: 'vertical',
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
createOrder: function (data, actions) {
|
|
purchase_units[0].description = description.value;
|
|
purchase_units[0].amount.value = amount.value;
|
|
|
|
return actions.order.create({
|
|
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');
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|