PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.20
VikAppointments Services Booking Calendar v1.2.20
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / site / layouts / blocks / payment / pending.php
vikappointments / site / layouts / blocks / payment Last commit date
approved.php 1 month ago index.html 1 month ago pending.php 1 month ago
pending.php
93 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 /**
15 * Layout variables
16 * -----------------
17 * @var array $data An associative array containing the transaction details.
18 * @var mixed $order An object containing the order details.
19 * @var string $scope The caller of this layout (e.g. appointments, packages).
20 */
21 extract($displayData);
22
23 // get payment details
24 $payment = $data['payment_info'];
25
26 $vik = VAPApplication::getInstance();
27
28 ?>
29
30 <a name="payment" style="display: none;"></a>
31
32 <?php
33 /**
34 * Instantiate the payment using the platform handler.
35 *
36 * @since 1.6.3
37 */
38 $obj = $vik->getPaymentInstance($payment->file, $data, $payment->params);
39 ?>
40
41 <div id="vap-pay-box" class="<?php echo $payment->position; ?>">
42
43 <?php
44 // display notes before purchase
45 if (!empty($order->payment->notes->beforePurchase))
46 {
47 ?>
48 <div class="vappaymentouternotes">
49 <div class="vappaymentnotes">
50 <?php
51 /**
52 * Render HTML description to interpret attached plugins.
53 *
54 * @since 1.6.3
55 */
56 echo VikAppointments::renderHtmlDescription($order->payment->notes->beforePurchase, 'paymentorder');
57 ?>
58 </div>
59 </div>
60 <?php
61 }
62
63 if (!empty($scope) && $scope == 'appointments')
64 {
65 // check whether the deposit to leave is optional
66 if (VAPFactory::getConfig()->getUint('usedeposit') == 1)
67 {
68 $value = ($order->skip_deposit + 1) % 2;
69 ?>
70 <div class="vap-deposit-choice">
71 <input type="checkbox" value="<?php echo $value; ?>" id="deposit-checkbox" />
72 <label for="deposit-checkbox"><?php echo JText::translate('VAPORDERPAYFULLDEPOSIT' . ($value ? '' : 'BACK')); ?></label>
73 </div>
74
75 <script>
76 jQuery(function($) {
77 $('#deposit-checkbox').on('change', function() {
78 $('.vap-deposit-choice').hide();
79 $('#orderform').append('<input type="hidden" name="payfull" value="' + $(this).val() + '" />');
80 $('#orderform').submit();
81 });
82 });
83 </script>
84 <?php
85 }
86 }
87
88 // display payment form
89 $obj->showPayment();
90 ?>
91
92 </div>
93