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 |
?>
|
|
|
10 |
|
|
|
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",
|
|
|
16 |
<?php if ($this->hasMod('wpsg_mod_onepagecheckout') && get_the_id() == $this->get_option('wpsg_mod_onepagecheckout_page')) { ?>
|
|
|
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" />');
|
|
|
22 |
jQuery('#wpsg_basket_form').submit();
|
|
|
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 } ?>
|
5020 |
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",
|
5010 |
daniel |
34 |
"disableContinue": "wpsg_checkout2button",
|
|
|
35 |
"enableContinue": "wpsg_checkout2button",
|
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 |
|