Subversion Repositories wpShopGermany4

Rev

Rev 7317 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4993 daniel 1
<?php
2
 
3
	/**
4
	 * JS Teil für den PayPal PLUS Teil
5
	 */
5010 daniel 6
 
7
	// https://www.paypalobjects.com/webstatic/de_DE/downloads/PayPal-PLUS-IntegrationGuide.pdf
5233 daniel 8
 
4993 daniel 9
?>
7214 daniel 10
 
4993 daniel 11
	var ppp = PAYPAL.apps.PPP({
12
		"approvalUrl": "<?php echo $this->view['wpsg_mod_paypalapi']['approval_url']; ?>",
13
		"language": "de_DE",
5233 daniel 14
		"preselection": "<?php echo (($_SESSION['wpsg']['checkout']['payment'] == '10')?'paypal':'none')?>",
5382 daniel 15
		"country": "DE",
6619 daniel 16
		<?php if ($this->hasMod('wpsg_mod_onepagecheckout') && wpsg_get_the_id() == $this->get_option('wpsg_mod_onepagecheckout_page')) { ?>
5382 daniel 17
		"onContinue": function(event) {
18
 
19
			jQuery('#wpsg_basket_form').attr('target', 'wpsg_hiddenTarget');
20
			jQuery('#wpsg_basket_form').append('<input name="wpsg_checkout" value="ppp" id="wpsg_hidden_action" />');
21
			jQuery('#wpsg_basket_form').append('<input name="wpsg[checkout][payment]" value="ppp" id="wpsg_hidden_payment" />');
8040 karl 22
			jQuery('#wpsg_basket_form').trigger('submit');
5382 daniel 23
			jQuery('#wpsg_basket_form').removeAttr('target');
24
			jQuery('#wpsg_hidden_action').remove();
25
			jQuery('#wpsg_hidden_payment').remove();
26
 
27
			//PAYPAL.apps.PPP.doCheckout();
28
 
29
		},
30
		<?php } ?>
7317 daniel 31
		<?php if (@$this->view['wpsg_order_done'] !== true) { ?>
4993 daniel 32
		"onLoad": function() { if (typeof wpsg_mod_paypalapi_load == 'function') wpsg_mod_paypalapi_load(); },
33
		"buttonLocation": "outside",
7214 daniel 34
		"disableContinue": "<?php echo $this->view['wpsg_mod_paypalapi']['disableContinue']; ?>",
35
		"enableContinue": "<?php echo $this->view['wpsg_mod_paypalapi']['enableContinue']; ?>",
4993 daniel 36
		<?php if (wpsg_isSizedArray($this->view['wpsg_mod_paypalapi']['ThirdPartyPayment'])) { ?>
37
		"thirdPartyPaymentMethods": <?php echo json_encode($this->view['wpsg_mod_paypalapi']['ThirdPartyPayment']); ?>,
38
		<?php } ?>
5020 daniel 39
		<?php } ?>
4993 daniel 40
		"placeholder": "wpsg_ppplus",
41
		"mode": "<?php echo $this->view['wpsg_mod_paypalapi']['mode']; ?>",
42
	} );
43
 
44