summaryrefslogtreecommitdiff
path: root/views/mods/mod_paypalapi/checkout_handlePayment.phtml
blob: 4a871036d51e47f3cd29da174a2ab0edb3c4bd98 (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
<?php

	/**
	 * Template um die Zahlungsarten mittels PayPal PLUS im Checkout zu integrieren
	 */

?>

<?php if ($this->view['wpsg_mod_paypalapi']['show'] == 1) { ?>

	<div class="wpsg_payment">
		<h2><?php echo __('Zahlungsarten', 'wpsg'); ?></h2>
		<div class="wpsg_payment_textwrap">
			<p><?php echo __('Ihr PayPal Konto wird nach Bestellabschluß belastet.', 'wpsg'); ?></p>
		</div>
	</div>

<?php } else if ($this->view['wpsg_mod_paypalapi']['show'] == 2) { ?>

	<div class="wpsg_payment">
		<h2><?php echo __('Zahlung erneut authorisieren', 'wpsg'); ?></h2>
		<div class="wpsg_payment_textwrap">
		
			<p><?php echo __('Der Betrag der Bestellung hat sich verändert. Sie müssen die Zahlung mit PayPal erneut authorisieren.', 'wpsg'); ?></p>
			<p><?php echo __('Dies können Sie über folgenden Button erledigen oder nach Bestellabschluß. Alternativ können Sie unten auch eine andere Zahlungsart wählen.', 'wpsg'); ?>
	
			<div class="wrap_paypalapi_expressbutton">
				<a href="<?php echo $this->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'startPayPalExpress'); ?>" title="<?php echo __('Direkt mit PayPal bezahlen', 'wpsg'); ?>"><img src="<?php echo $this->getRessourceURL('mods/mod_paypalapi/gfx/checkout-logo-small-de.png'); ?>" alt="<?php echo __('Direkt zu PayPal', 'wpsg'); ?>" /></a>
			</div>
		</div>
	</div>

<?php } else { ?>

	<script src="https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js" type="text/javascript"></script>
	
	<div class="wpsg_payment">
	
		<h2><?php echo __('Zahlungsarten', 'wpsg'); ?></h2>
					
		<div id="wpsg_ppplus"></div>
		
		<?php if (wpsg_isSizedString($this->view['wpsg_mod_paypalapi']['error'])) { ?>
		<div id="wpsg_notice" class="published error">
			<p><?php echo $this->view['wpsg_mod_paypalapi']['error']; ?>
		</div>		
		<?php } ?>
	    
	</div>
	         
	<iframe name="wpsg_hiddenTarget" style="display:none; width:0px; height:0px;"></iframe>  
	<script type="application/javascript">/* <![CDATA[ */

		function wpsg_ppp_handleError()
		{
			
			location.href = '<?php echo $this->getUrl(wpsg_ShopController::URL_CHECKOUT); ?>';
			
		}

		function wpsg_ppp_run()
		{

			PAYPAL.apps.PPP.doCheckout();

		}
	
		var wpsg_mod_paypalapi_shipping_id = '<?php echo wpsg_getStr($this->view['basket']['checkout']['shipping']); ?>';
		
		jQuery(document).ready(function() {
		
			jQuery('input[name="wpsg_checkout2"], input[name="wpsg_checkout"]').hide();
	 
			jQuery('.wpsg_shipping input[type="radio"]').bind('change', function() {
	
				if (jQuery(this).val() != wpsg_mod_paypalapi_shipping_id)
				{
					
					jQuery('input[name="wpsg_checkout2"]').hide()
					jQuery('#wpsg_checkout_form').attr("action", "<?php echo $this->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'ShippingSelect'); ?>").submit();
					 
				}
				
			} );
			
		} );
	
		/**
		 * Wird vom PayPal PLUS IFrame aufgerufen wenn fertig geladen 
		 */                                                   	
		function wpsg_mod_paypalapi_load()
		{
	
			jQuery('input[name="wpsg_checkout2"], input[name="wpsg_checkout"]').show().bind('click', function() {
	
				PAYPAL.apps.PPP.doCheckout();
				return false;
				
			} );
		
		}	
	
		<?php echo $this->render(WPSG_PATH_VIEW.'/mods/mod_paypalapi/paypalplus.phtml')?>
	    		
	/* ]]> */</script>
	
<?php } ?>