7787 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Template, welches bei Bestellungen mit Amazon Pay nach der Bestellung angezeigt wird
|
|
|
5 |
*/
|
|
|
6 |
|
|
|
7 |
$view = $this->view['wpsg_mod_amazon_v2'];
|
|
|
8 |
|
|
|
9 |
// https://pay.amazon.de/help/JE5KSJW4SFH2UM8
|
|
|
10 |
// https://developer.amazon.com/de/docs/eu/amazon-pay-onetime/sca-upgrade.html?ld=NSGoogle
|
|
|
11 |
// https://sellercentral.amazon.com/forums/t/what-is-the-amazonorderreferenceid/286349/2
|
|
|
12 |
|
|
|
13 |
?>
|
|
|
14 |
|
|
|
15 |
<?php if ($view['state'] === 'Completed') { ?>
|
|
|
16 |
|
|
|
17 |
<p><?php echo __('Bestellung wurde mit Amazon Payment bezahlt.'); ?></p>
|
|
|
18 |
|
|
|
19 |
<?php } else if ($view['state'] === 'Unpayed') { ?>
|
|
|
20 |
|
|
|
21 |
<script src="https://static-eu.payments-amazon.com/checkout.js"></script>
|
|
|
22 |
|
|
|
23 |
<div id="AmazonPayButton"></div>
|
|
|
24 |
|
|
|
25 |
<script>
|
|
|
26 |
|
|
|
27 |
amazon.Pay.renderButton('#AmazonPayButton', {
|
|
|
28 |
merchantId: '<?php echo $this->get_option('wpsg_mod_amazon_v2_seller_id'); ?>',
|
|
|
29 |
ledgerCurrency: 'EUR',
|
|
|
30 |
sandbox: <?php echo (($this->get_option('wpsg_mod_amazon_v2_sandbox') === '1')?'true':'false'); ?>,
|
|
|
31 |
checkoutLanguage: 'de_DE',
|
|
|
32 |
productType: 'PayAndShip',
|
|
|
33 |
placement: 'Cart',
|
|
|
34 |
buttonColor: 'Gold',
|
|
|
35 |
createCheckoutSessionConfig: {
|
|
|
36 |
payloadJSON: '<?php echo $view['payload']; ?>',
|
|
|
37 |
signature: '<?php echo $view['signature']; ?>',
|
|
|
38 |
publicKeyId: '<?php echo $this->get_option('wpsg_mod_amazon_v2_public_key_id'); ?>'
|
|
|
39 |
}
|
|
|
40 |
});
|
|
|
41 |
|
|
|
42 |
</script>
|
|
|
43 |
|
|
|
44 |
<?php } else if ($view['state'] === 'Open') { ?>
|
|
|
45 |
|
|
|
46 |
<p><?php echo __('Zahlen Sie Ihre Bestellung jetzt mit AmazonPay, indem sie auf folgenden Button klicken.', 'wpsg'); ?></p>
|
|
|
47 |
|
|
|
48 |
<?php if ($this->get_option('wpsg_mod_paypal_autostart') == '1') { ?>
|
|
|
49 |
|
|
|
50 |
<script>
|
|
|
51 |
|
|
|
52 |
jQuery(document).ready(function() {
|
|
|
53 |
window.setTimeout(function() {
|
|
|
54 |
location.href = "<?php echo $this->view['payURL']; ?>";
|
|
|
55 |
}, 1000);
|
|
|
56 |
} );
|
|
|
57 |
|
|
|
58 |
</script>
|
|
|
59 |
|
|
|
60 |
<?php } else { ?>
|
|
|
61 |
|
|
|
62 |
<a href="<?php echo $view['payURL']; ?>" title="<?php echo __('Jetzt mit AmazonPay bezahlen', 'wpsg'); ?>">
|
|
|
63 |
<img src="<?php echo $this->getRessourceURL('mods/mod_amazon_v2/gfx/logo_100x25.png'); ?>" alt="<?php echo __('Jetzt mit AmazonPay bezahlen', 'wpsg'); ?>" />
|
|
|
64 |
</a>
|
|
|
65 |
|
|
|
66 |
<?php } ?>
|
|
|
67 |
|
|
|
68 |
<?php } ?>
|