summaryrefslogtreecommitdiff
path: root/views/mods/mod_girocheckout/order_view_afterpayment.phtml
blob: 237e82ed9fc16922360b146fd3886893b59162f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php

	/**
	 * GiroCheckout-Daten in der Bestellansicht
	 * @version 4.6.1
	 */

	if (!defined('ABSPATH')) exit;

	$arView = $this->view['wpsg_mod_girocheckout'];
	$oOrder = $arView['oOrder'];
	$oMod = $this->arModule['wpsg_mod_girocheckout'];

	$strPaid = (string)$oOrder->getMeta(wpsg_mod_girocheckout::META_PAID);
	$strReference = (($strPaid !== '')?$strPaid:(string)$oOrder->getMeta(wpsg_mod_girocheckout::META_REFERENCE));
	$strResult = (string)$oOrder->getMeta(wpsg_mod_girocheckout::META_RESULT);
	$nAmount = intval($oOrder->getMeta(wpsg_mod_girocheckout::META_AMOUNT));
	$nRefunded = intval($oOrder->getMeta(wpsg_mod_girocheckout::META_REFUNDED));
	$nRefundable = intval($arView['nRefundable']);

	if ($strPaid !== '') {

		$strState = '<span class="label label-success" style="font-size:12px;">'.esc_html($oMod->getResultLabel(4000)).'</span>';

	} else if ($strResult !== '') {

		$strState = '<span class="label label-warning" style="font-size:12px;">'.esc_html($oMod->getResultLabel(intval($strResult))).'</span>';

	} else {

		$strState = '<span class="label label-default" style="font-size:12px;">'.esc_html__('noch nicht bezahlt', 'wpsg').'</span>';

	}

?>

<?php if ($strReference !== '') { ?>

	<?php echo wpsg_drawForm_Text(__('GiroCheckout Status', 'wpsg'), $strState.' &nbsp;<a class="btn btn-default btn-xs" href="'.esc_url($arView['refreshURL']).'"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> '.esc_html__('Status aktualisieren', 'wpsg').'</a>'); ?>
	<?php echo wpsg_drawForm_Text(__('GiroCheckout Referenz', 'wpsg'), '<code>'.esc_html($strReference).'</code>'); ?>

	<?php if ((string)$oOrder->getMeta(wpsg_mod_girocheckout::META_BACKEND_ID) !== '') { ?>

		<?php echo wpsg_drawForm_Text(__('Transaktions-ID', 'wpsg'), '<code>'.esc_html($oOrder->getMeta(wpsg_mod_girocheckout::META_BACKEND_ID)).'</code>'); ?>

	<?php } ?>

	<?php if ($nAmount > 0) { ?>

		<?php echo wpsg_drawForm_Text(__('Bezahlt', 'wpsg'), esc_html(wpsg_ff($nAmount / 100, wpsg_mod_girocheckout::CURRENCY))); ?>

	<?php } ?>

	<?php if ($nRefunded > 0) { ?>

		<?php echo wpsg_drawForm_Text(__('Erstattet', 'wpsg'), esc_html(wpsg_ff($nRefunded / 100, wpsg_mod_girocheckout::CURRENCY))); ?>

	<?php } ?>

	<?php if ($nRefundable > 0) { ?>

		<form method="post" action="<?php echo esc_url($arView['refundURL']); ?>" onsubmit="return confirm(<?php echo esc_attr(wp_json_encode(__('Den Betrag über GiroCheckout erstatten?', 'wpsg'))); ?>);">

			<?php echo wpsg_drawForm_Input('wpsg_mod_girocheckout_refund_amount', __('Erstattungsbetrag', 'wpsg'), wpsg_ff($nRefundable / 100), ['hint' => esc_html(wpsg_translate(__('Höchstens #1#', 'wpsg'), wpsg_ff($nRefundable / 100, wpsg_mod_girocheckout::CURRENCY)))]); ?>

			<p><button type="submit" class="button"><?php echo esc_html__('Betrag erstatten', 'wpsg'); ?></button></p>

		</form>

	<?php } ?>

<?php } ?>