Subversion Repositories wpShopGermany4

Rev

Rev 5485 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5485 Rev 7735
Line 1... Line 1...
1
<?php 
1
<?php
2
 
2
 
3
	/**
3
    /**
4
	 * Template für die Integration von "Bezahlen mit Amazon" in den Warenkorb
4
     * Template für die Integration von "Bezahlen mit Amazon" in den Warenkorb
5
	 */
5
     */
6
 
6
 
7
?>
7
?>
8
 
8
 
9
<div id="LoginWithAmazon"></div>
9
<div id="LoginWithAmazon"></div>
10
 
10
 
11
<div class="wpsg_amazonhandler" id="addressBookWidgetDiv"></div>
11
<div class="wpsg_amazonhandler" id="addressBookWidgetDiv"></div>
12
<div class="wpsg_amazonhandler" id="walletWidgetDiv"></div>
12
<div class="wpsg_amazonhandler" id="walletWidgetDiv"></div>
13
 
13
 
-
 
14
<style type="text/css">
-
 
15
 
-
 
16
    #addressBookWidgetDiv{ width:auto; height:228px; margin:15px 0; }
-
 
17
    #walletWidgetDiv { width:100%; height:228px; margin:15px 0; }
-
 
18
    #walletWidgetDiv iframe,
-
 
19
    #addressBookWidgetDiv iframe { max-width:100%; border:0px !important; }
-
 
20
    #LoginWithAmazon { float:right; }
-
 
21
    .wpsg_mod_paypalapi_button_wrap { float:left; }
-
 
22
 
-
 
23
</style>
-
 
24
 
14
<input type="hidden" name="amazon[OrderReference]" id="wpsg_mod_amazon_OrderReference" value="" />
25
<input type="hidden" name="amazon[OrderReference]" id="wpsg_mod_amazon_OrderReference" value="" />
15
 
26
 
16
<div class="wpsg_clear"></div>
27
<div class="wpsg_clear"></div>
17
 
-
 
18
<script type="text/javascript">/* <![CDATA[ */
-
 
19
 
-
 
20
	var authRequest; 
-
 
21
 
-
 
22
	OffAmazonPayments.Button('LoginWithAmazon', '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>', {
-
 
23
		
-
 
24
		type:  "PwA", 
-
 
25
		color: "Gold", 
-
 
26
		size:  "small", 
-
 
27
		language: "de-DE",
-
 
28
 
-
 
29
		authorization: function() { 
-
 
30
 
-
 
31
			loginOptions = {
-
 
32
				scope: "profile payments:widget payments:shipping_address payments:billing_address", 
-
 
33
				popup: true
-
 
34
			}; 
-
 
35
			
-
 
36
			authRequest = amazon.Login.authorize(loginOptions, "<?php echo $this->view['wpsg_mod_amazon']['redirectURL']; ?>");
-
 
37
				 
-
 
38
		},
-
 
39
 
-
 
40
		onError: function(error) { 
-
 
41
		    
-
 
42
			//console.log("Login: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
 
43
			alert("Login: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
 
44
				
-
 
45
		} 
-
 
46
	        
-
 
47
	} );
-
 
48
 
-
 
49
	<?php if (wpsg_isSizedString($this->view['wpsg_mod_amazon']['amazon_last_authorization_reference_id']) && $this->view['basket']['checkout']['payment'] == 3140) { ?>
-
 
50
 
-
 
51
	jQuery('.wpsg_checkoutbutton').hide();
-
 
52
	jQuery('.wpsg_amazonhandler').show();
-
 
53
	
-
 
54
	new OffAmazonPayments.Widgets.AddressBook( {
-
 
55
		
-
 
56
	    sellerId: '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>',
-
 
57
 
-
 
58
	    onOrderReferenceCreate: function(orderReference) {
-
 
59
 
-
 
60
	    	var oID = orderReference.getAmazonOrderReferenceId();
-
 
61
	    	
-
 
62
			jQuery('#wpsg_mod_amazon_OrderReference').val(oID);
-
 
63
			jQuery('.wpsg_checkoutbutton').show();
-
 
64
	    			     
-
 
65
	    },
-
 
66
	    
-
 
67
	    onAddressSelect: function(orderReference) {
-
 
68
 
-
 
69
		    // Replace the following code with the action that you want to perform
-
 
70
		    // after the address is selected.
-
 
71
		    // The amazonOrderReferenceId can be used to retrieve
-
 
72
	    	// the address details by calling the GetOrderReferenceDetails
-
 
73
		    // operation. If rendering the AddressBook and Wallet widgets on the
-
 
74
		    // same page, you should wait for this event before you render the
-
 
75
	    	// Wallet widget for the first time.
-
 
76
		    // The Wallet widget will re-render itself on all subsequent
-
 
77
		    // onAddressSelect events, without any action from you. It is not
-
 
78
	    	// recommended that you explicitly refresh it.
-
 
79
 
-
 
80
			new OffAmazonPayments.Widgets.Wallet({
-
 
81
 
-
 
82
	    	    sellerId: '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>',
-
 
83
 
-
 
84
	    	    onPaymentSelect: function(orderReference) {
-
 
85
 
-
 
86
	    			// Replace this code with the action that you want to perform
-
 
87
	    	      	// after the payment method is selected.
-
 
88
	    		      
-
 
89
	    	    },
-
 
90
	    	    
-
 
91
	    	    design: {
-
 
92
		    	    
-
 
93
	    	      	designMode: 'responsive'
-
 
94
		    	      	
-
 
95
	    	    },
-
 
96
	    	    
-
 
97
	    	    onError: function(error) {
-
 
98
 
-
 
99
	    	    	alert("Wallet: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
 
100
		    	     
-
 
101
	    	    }
-
 
102
	    	    
-
 
103
	    	}).bind("walletWidgetDiv");
-
 
104
	    	  
-
 
105
	    },
-
 
106
	    
-
 
107
	    design: {
-
 
108
		    
-
 
109
	      designMode: 'responsive'
-
 
110
		      
-
 
111
	    },
-
 
112
	    
-
 
113
	    onError: function(error) {
-
 
114
 
-
 
115
	    	alert("Payment: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
 
116
		       
-
 
117
	    }
-
 
118
	    
-
 
119
	} ).bind("addressBookWidgetDiv");
-
 
120
 
-
 
121
	<?php } ?>
-
 
122
	
-
 
123
/* ]]> */</script>
-
 
124
28
 
-
 
29
<script>
-
 
30
 
-
 
31
    var authRequest;
-
 
32
 
-
 
33
    OffAmazonPayments.Button('LoginWithAmazon', '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>', {
-
 
34
 
-
 
35
        type:  "PwA",
-
 
36
        color: "Gold",
-
 
37
        size:  "small",
-
 
38
        language: "de-DE",
-
 
39
 
-
 
40
        authorization: function() {
-
 
41
 
-
 
42
            loginOptions = {
-
 
43
                scope: "profile payments:widget payments:shipping_address payments:billing_address",
-
 
44
                popup: true
-
 
45
            };
-
 
46
 
-
 
47
            authRequest = amazon.Login.authorize(loginOptions, "<?php echo $this->view['wpsg_mod_amazon']['redirectURL']; ?>");
-
 
48
 
-
 
49
        },
-
 
50
 
-
 
51
        onError: function(error) {
-
 
52
 
-
 
53
            //console.log("Login: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
 
54
            alert("Login: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
 
55
 
-
 
56
        }
-
 
57
 
-
 
58
    } );
-
 
59
 
-
 
60
    <?php if (wpsg_isSizedString($this->view['wpsg_mod_amazon']['amazon_last_authorization_reference_id']) && $this->view['basket']['checkout']['payment'] == 3140) { ?>
-
 
61
 
-
 
62
    jQuery(document).ready(function() {
-
 
63
 
-
 
64
        jQuery('.wpsg_checkoutbutton').hide();
-
 
65
        jQuery('.wpsg_amazonhandler').show();
-
 
66
        jQuery('#LoginWithAmazon').hide();
-
 
67
 
-
 
68
        new OffAmazonPayments.Widgets.AddressBook( {
-
 
69
 
-
 
70
            sellerId: '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>',
-
 
71
 
-
 
72
            onOrderReferenceCreate: function(orderReference) {
-
 
73
 
-
 
74
                var oID = orderReference.getAmazonOrderReferenceId();
-
 
75
 
-
 
76
                jQuery('#wpsg_mod_amazon_OrderReference').val(oID);
-
 
77
                jQuery('.wpsg_checkoutbutton').show();
-
 
78
 
-
 
79
            },
-
 
80
 
-
 
81
            onAddressSelect: function(orderReference) {
-
 
82
 
-
 
83
                // Replace the following code with the action that you want to perform
-
 
84
                // after the address is selected.
-
 
85
                // The amazonOrderReferenceId can be used to retrieve
-
 
86
                // the address details by calling the GetOrderReferenceDetails
-
 
87
                // operation. If rendering the AddressBook and Wallet widgets on the
-
 
88
                // same page, you should wait for this event before you render the
-
 
89
                // Wallet widget for the first time.
-
 
90
                // The Wallet widget will re-render itself on all subsequent
-
 
91
                // onAddressSelect events, without any action from you. It is not
-
 
92
                // recommended that you explicitly refresh it.
-
 
93
 
-
 
94
                new OffAmazonPayments.Widgets.Wallet({
-
 
95
 
-
 
96
                    sellerId: '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>',
-
 
97
 
-
 
98
                    onPaymentSelect: function(orderReference) {
-
 
99
 
-
 
100
                        // Replace this code with the action that you want to perform
-
 
101
                        // after the payment method is selected.
-
 
102
 
-
 
103
                    },
-
 
104
 
-
 
105
                    design: {
-
 
106
 
-
 
107
                        designMode: 'responsive'
-
 
108
 
-
 
109
                    },
-
 
110
 
-
 
111
                    onError: function(error) {
-
 
112
 
-
 
113
                        alert("Wallet: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
 
114
 
-
 
115
                    }
-
 
116
 
-
 
117
                }).bind("walletWidgetDiv");
-
 
118
 
-
 
119
            },
-
 
120
 
-
 
121
            design: {
-
 
122
 
-
 
123
                designMode: 'responsive'
-
 
124
 
-
 
125
            },
-
 
126
 
-
 
127
            onError: function(error) {
-
 
128
 
-
 
129
                alert("Payment: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
 
130
 
-
 
131
            }
-
 
132
 
-
 
133
        } ).bind("addressBookWidgetDiv");
-
 
134
 
-
 
135
    });
-
 
136
 
-
 
137
    <?php } ?>
-
 
138
 
-
 
139
</script>
-
 
140
125
141