<?php
// Include the configuration file
require_once 'config.php';
header('Access-Control-Allow-Origin: *'); //for al
//header( 'Access-Control-Allow-Headers: Accept, Accept-Encoding, Accept-Language, Authorization, Cache-Control, Pragma, Content-Type, Origin, Referer, Sec-Fetch-Dest, Sec-Fetch-Mode, Sec-Fetch-Site, User-Agent, X-Requested-With');
?>


		<style>
			body, html {
				font-family: Montserrat,Helvetica,Verdana,sans-serif;
			}
			a, a:active, a:visited, a:link {
				text-decoration: none;
			}
			h1, h2, h3, h4, h5, h6 {
				font-family: Montserrat,Helvetica,Verdana,sans-serif;
			}
			#btn-appl {
				display: inline-block;
				width: var(--apple-pay-button-width, auto);
				/*min-width: 320px;*/
				min-height: 45px;
				height: 45px !important;
			}
			apple-pay-button {
				--apple-pay-button-width: 340px;
				--apple-pay-button-height: 35px;
				--apple-pay-button-border-radius: 5px;
				--apple-pay-button-padding: 5px 0px;
			}
			button, apple-pay-button {
			}
			button.apple-pay-btn.black {
				height: 45px !important;
			}

			.apple-pay-btn-wrapper.buy.en-US, .apple-pay-btn-wrapper {
				min-height: 45px !important;
				height: 45px !important;
			}

			.apple-pay-btn-wrapper .apple-pay-btn {
				background-color: black;
				border-top-style: none;
				border-right-style: none;
				border-bottom-style: none;
				border-left-style: none;
				color: white;
				cursor: pointer;
				font-synthesis-small-caps: none;
				font-synthesis-style: none;
				font-synthesis-weight: none;
				justify-content: center;
				position: relative;
				margin-top: 0px;
				box-sizing: var(--apple-pay-button-box-sizing, content-box);
				/*min-height: 45px !important;
				height:45px !important;*/
				height: calc(var(--apple-pay-button-height, 45px)) !important;
				min-width: var(--apple-pay-button-width-default, 320px) !important;
				width: 100% !important;
				border-top-left-radius: ;
				border-top-right-radius: ;
				border-bottom-right-radius: ;
				border-bottom-left-radius: ;
				padding-top: ;
				padding-right: ;
				padding-bottom: ;
				padding-left: ;
				-webkit-font-smoothing: antialiased;
			}

			.apple-pay-button {
				display: inline-block;
				-webkit-appearance: -apple-pay-button;
				-apple-pay-button-type: donate; /* Use any supported button type. */
				height: 45px !important;
				min-height: 45px !important;
			}
			.apple-pay-button-black {
				-apple-pay-button-style: black;
				height: 45px !important;
				min-height: 45px !important;
			}

			#applepay-container {
				flex-grow: 1;
				/*width:320px !important;
				min-width:320px !important;*/
				max-width: 305px !important;
				height: 45px !important;
				min-height: 45px !important;
				margin-bottom: 15px;
			}

			/* ################################### */
			/*            MOBILE STYLES            */
			/* ################################### */

			/* Portrait tablet to landscape and desktop */
			@media (min-width: 980px) and (max-width: 1024px) {
			}

			/* Portrait tablet to landscape and desktop */
			@media (min-width: 768px) and (max-width: 979px) {
			}

			/* Landscape phone to portrait tablet */
			@media (max-width: 767px) {
			}

			/* Landscape phones and down */
			@media (max-width: 586px) {
			}

			/* Landscape phones and down */
			@media (max-width: 480px) {
			}

			/* Older phones with super small screens, iPhone SE */
			@media (max-width: 375px) {
				#applepay-container {
					flex-grow: 1;
					/*width:320px !important;
					min-width:320px !important;*/
					max-width: 305px !important;
					height: 45px !important;
					min-height: 45px !important;
					margin-bottom: 15px;
				}
				apple-pay-button {
					--apple-pay-button-width: 330px;
					--apple-pay-button-height: 37px;
					--apple-pay-button-border-radius: 5px;
					--apple-pay-button-padding: 5px 0px;
				}
				#btn-appl {
					display: inline-block;
					width: var(--apple-pay-button-width, auto);
					/*min-width: 320px;*/
					min-height: 40px;
					height: 40px !important;
				}

				button.apple-pay-btn.black {
					height: 40px !important;
				}

				.apple-pay-btn-wrapper.buy.en-US, .apple-pay-btn-wrapper {
					min-height: 40px !important;
					height: 40px !important;
				}

				.apple-pay-btn-wrapper .apple-pay-btn {
					height: calc(var(--apple-pay-button-height, 40px)) !important;
				}

				.apple-pay-button {
					height: 40px !important;
					min-height: 40px !important;
				}
				.apple-pay-button-black {
					-apple-pay-button-style: black;
					height: 40px !important;
					min-height: 40px !important;
				}
			}
		</style>

		<!-- THIS IS THE OFFICIAL SCRIPT THAT WORKS -->
		<script src="https://www.paypal.com/sdk/js?client-id=AZsMPHqx0TlbCyV_8AY5LlNzzmilpaP8lbfQQQ4iPRpk_WC8hOWFWdvnGMgln4RJAAO2oWd7g1PhhMtu&currency=USD&merchant-id=H6MLL7DW7SMQ6&components=buttons,applepay&enable-funding=venmo" data-partner-attribution-id="APPLEPAY"> </script>
	
		<script src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js"> </script>
		<script src="app.js"> </script>

		<input type="hiddenx" id="t_amount" value="0.50" style="width:40px;">

		<input type="hiddenx" id="mem_ID" value="sillystats@gmail.com" style="float:right;">

		<!-- Display status message -->
		<div id="paymentResponse" class="hidden"></div>

		<p id="result-message" class="hidden"
		style="background:#00c808; color:#fff; padding:7px; text-align:center;
		-webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;
		line-height:22px;">
			<!--Thank you! Your ApplePay payment was successful.-->
		</p>

		<div id="applepay-container"></div>