summaryrefslogtreecommitdiff
path: root/views/mods/mod_micropayment/order_done.phtml
blob: 33bc32bc6b91b901bc60717da2a9fa334302c91c (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php

	/**
	 * Template welches den Zahlungsdienstleister nach Bestellabschluß einbindet
	 */

?>
<?php if (wpsg_isSizedString($this->view['wpsg_mod_micropayment']['payLink'])) { ?>
<?php echo __('Klicken Sie auf das folgende Logo um ihre Bestellung zu bezahlen.', 'wpsg'); ?>
<br /><br />

<a href="<?php echo $this->view['wpsg_mod_micropayment']['payLink']; ?>"><img src="<?php echo $this->view['wpsg_mod_micropayment']['logo']; ?>" alt="<?php echo $this->view['wpsg_mod_micropayment']['title']; ?>" /></a>

	<?php if ($this->get_option('wpsg_mod_micropayment_paystart') == '1') { ?>
	<script type="text/javascript">
	 
		jQuery(document).ready(function() { 
			window.setTimeout(function() {
	    	location.href = "<?php echo $this->view['wpsg_mod_micropayment']['payLink']; ?>";
			}, 1000);
		} );
		
	</script>
	<?php } ?>

<?php } else { ?>

<p><?php echo __('Bitte geben Sie ihre Kreditkarteninformationen (Kartennummer, Gültigkeitsdatum und Prüfnummer) in folgende Felder ein. Die Daten werden an Micropayment übermittelt und nicht durch uns gespeichert oder ausgewertet.', 'wpsg'); ?></p>

<form method="post" id="wpsg_mod_micropayment_creditcard">

	<div class="micropayment_card">
		<div class="front card">
			<div class="chip"></div>
			<div class="number"><input placeholder="<?php echo __('Kreditkartennummer', 'wpsg'); ?>" type="text" name="number" /></div>
			<div class="bankname"><?php echo __('Kreditkarte - Vorderseite', 'wpsg'); ?></div>
			<div class="name"><?php echo __('Max Mustermann', 'wpsg'); ?></div>
			<div class="validthrough"><?php echo __('Gültig bis', 'wpsg'); ?>:</div>
			<div class="valid">
				<select name="expiryMonth">
					<?php for ($i = 1; $i <= 12; $i ++) { ?>
					<option value="<?php echo $i; ?>"><?php echo str_pad($i, 2, '0', STR_PAD_LEFT); ?>
					<?php } ?>		
				</select>
				<span>/</span>
				<select name="expiryYear">
					<?php for ($i = date('Y'); $i <= date('Y') + 10; $i ++) { ?>
					<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
					<?php } ?>
				</select>						
			</div>			
		</div>	
		
		<div class="back card">
			<div class="bankname"><?php echo __('Kreditkarte - Rückseite', 'wpsg'); ?></div>
			<div class="blackmagnetic"></div>
			<div class="number"><?php echo __('HC600214C', 'wpsg'); ?></div>
			<div class="signature"><?php echo __('Unterschrift Max Mustermann', 'wpsg'); ?></div>
			<div class="sign"><input type="text" name="cvc2" value="" placeholder="<?php echo __('Prüfnummer', 'wpsg'); ?>" /></div>
		</div>
		
		<input type="button" id="wpsg_mod_micropayment_pay_button" class="wpsg_button" value="<?php echo __('Zahlung starten', 'wpsg'); ?>" />
		
	</div>

</form>

<script type="text/javascript">/* <![CDATA[ */

	jQuery(document).ready(function() {

		jQuery('#wpsg_mod_micropayment_pay_button').bind('click', function() {
			
			var form_data = jQuery('#wpsg_mod_micropayment_creditcard').serialize();
			
			jQuery('.micropayment_card input, .micropayment_card select').prop('disabled', true);
			
			jQuery.ajax( {
				url: wpsg_ajax.ajaxurl,
				data: {
					action: 'ajax',
					wpsg_plugin: 'wpsg_mod_micropayment',
					module_action: 'pay', 
					form_data: form_data,
					order_id: <?php echo $this->view['o_id']; ?>
				},
				success: function(data) {

					if (data === "1")
					{

						alert('<?php echo __('Vielen Dank für Ihre Zahlungsreservierung.', 'wpsg'); ?>');
						location.href = '<?php echo get_permalink($this->get_option('wpsg_mod_micropayment_successPage')); ?>';
						
					}
					else
					{

						alert(data);

					}

					jQuery('.micropayment_card input, .micropayment_card select').prop('disabled', false);
						
				},
				error: function(rdata, data)
				{
					
					alert("<?php echo __('Unerwarteter Serverfehler!', 'wpsg'); ?>");
					
				}
			} );
			
			return false;
			
		} );
		
	} );

/* ]]> */</script>

<?php } ?>