File indexing completed on 2024-12-29 05:24:49

0001 <?php
0002 /**
0003  *  ocs-webserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-webserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 
0023 if ($this->error) {
0024     echo $this->error_text;
0025 } else {
0026     ?>
0027     <div style="text-align: center;">
0028         <h3>Please wait. We will redirect you to PayPal. </h3>
0029         <p>Or press the Subscribe button:</p>
0030         
0031         <form action="<?= $this->form_endpoint ?>" method="post" target="_top" id="payform">
0032             <input type="hidden" name="cmd" value="_xclick-subscriptions">
0033             <input type="hidden" name="business" value="<?= $this->form_merchant ?>">
0034             <input type="hidden" name="lc" value="US">
0035             <input type="hidden" name="item_name" value="Thank you for supporting pling.com">
0036             <input type="hidden" name="item_number" value="S1">
0037             <input type="hidden" name="no_note" value="1">
0038             <input type="hidden" name="no_shipping" value="1">
0039             <input type="hidden" name="rm" value="1">
0040             <input type="hidden" name="return" value="<?= $this->form_return_url_ok ?>">
0041             <input type="hidden" name="cancel_return" value="<?= $this->form_return_url_cancel ?>">
0042             <input type="hidden" name="notify_url" value="<?= $this->form_ipn_endpoint ?>">
0043             <input type="hidden" name="src" value="1">
0044             <input type="hidden" name="currency_code" value="USD">
0045             <input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHosted">
0046             <input type="hidden" name="custom" value="<?= $this->transaction_id ?>">
0047             
0048             <?php 
0049                 $amount = $this->amount;
0050             ?>
0051             
0052             <input type="hidden" name="a3" value="<?= $amount ?>">
0053             <input type="hidden" name="p3" value="1">
0054             <input type="hidden" name="t3" value="<?= $this->paymentFrequenz ?>">
0055             
0056             <?php 
0057                 if($this->paymentFrequenz == 'Y') {
0058             ?>
0059             <p>You choose: $<?= $amount ?> per Year</p>
0060             <?php
0061                 } else {
0062             ?>
0063             <p>You choose: $<?= $amount ?> per Month</p>
0064             <?php
0065                 }
0066             ?>
0067             
0068             <p>
0069                 <?php 
0070                     if($this->paymentFrequenz == 'M') {
0071                 ?>
0072                         <span class="extrasmall"><?=$this->calcDonationText($this->amountTier)?></span>
0073                 <?php 
0074                     } else if($this->paymentFrequenz == 'Y') {
0075                 ?>
0076                         <span class="extrasmall"><?=$this->calcDonationYearlyText($this->amountTier)?></span>
0077                 <?php 
0078                     }
0079                 ?>
0080             </p>
0081             
0082             <input type="hidden" name="option_index" value="0">
0083             <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
0084             <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
0085         </form>
0086 
0087         
0088         
0089     </div>
0090     <script>
0091         
0092         setTimeout(function () {
0093             document.getElementById("payform").submit();
0094         }, 5000);
0095         
0096         
0097     </script>
0098 <?php } ?>