diff options
| author | thomas <noreply@maennchen1.de> | 2016-05-09 14:56:08 +0000 |
|---|---|---|
| committer | thomas <noreply@maennchen1.de> | 2016-05-09 14:56:08 +0000 |
| commit | f7eb12e8cd86e542225df8244aa7e7df6d28c19a (patch) | |
| tree | 1d3a50c6798bb4cf23c112595f37a2b306542e1d /views | |
| parent | 793c2f71f30e8bd74b2a1c0b9f3d3122dc98a04b (diff) | |
- Amazon-Payment
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5485 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views')
| -rw-r--r-- | views/mods/mod_amazon/basket_inner_prebutton.phtml | 123 | ||||
| -rw-r--r-- | views/mods/mod_amazon/order_done.phtml | 119 | ||||
| -rw-r--r-- | views/mods/mod_amazon/settings_edit.phtml | 33 | ||||
| -rw-r--r-- | views/mods/mod_keygen/settings_edit.phtml | 4 |
4 files changed, 279 insertions, 0 deletions
diff --git a/views/mods/mod_amazon/basket_inner_prebutton.phtml b/views/mods/mod_amazon/basket_inner_prebutton.phtml new file mode 100644 index 0000000..628ec68 --- /dev/null +++ b/views/mods/mod_amazon/basket_inner_prebutton.phtml @@ -0,0 +1,123 @@ +<?php
+
+ /**
+ * Template für die Integration von "Bezahlen mit Amazon" in den Warenkorb
+ */
+
+?>
+
+<div id="LoginWithAmazon"></div>
+
+<div class="wpsg_amazonhandler" id="addressBookWidgetDiv"></div>
+<div class="wpsg_amazonhandler" id="walletWidgetDiv"></div>
+
+<input type="hidden" name="amazon[OrderReference]" id="wpsg_mod_amazon_OrderReference" value="" />
+
+<div class="wpsg_clear"></div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ var authRequest;
+
+ OffAmazonPayments.Button('LoginWithAmazon', '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>', {
+
+ type: "PwA",
+ color: "Gold",
+ size: "small",
+ language: "de-DE",
+
+ authorization: function() {
+
+ loginOptions = {
+ scope: "profile payments:widget payments:shipping_address payments:billing_address",
+ popup: true
+ };
+
+ authRequest = amazon.Login.authorize(loginOptions, "<?php echo $this->view['wpsg_mod_amazon']['redirectURL']; ?>");
+
+ },
+
+ onError: function(error) {
+
+ //console.log("Login: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
+ alert("Login: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
+
+ }
+
+ } );
+
+ <?php if (wpsg_isSizedString($this->view['wpsg_mod_amazon']['amazon_last_authorization_reference_id']) && $this->view['basket']['checkout']['payment'] == 3140) { ?>
+
+ jQuery('.wpsg_checkoutbutton').hide();
+ jQuery('.wpsg_amazonhandler').show();
+
+ new OffAmazonPayments.Widgets.AddressBook( {
+
+ sellerId: '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>',
+
+ onOrderReferenceCreate: function(orderReference) {
+
+ var oID = orderReference.getAmazonOrderReferenceId();
+
+ jQuery('#wpsg_mod_amazon_OrderReference').val(oID);
+ jQuery('.wpsg_checkoutbutton').show();
+
+ },
+
+ onAddressSelect: function(orderReference) {
+
+ // Replace the following code with the action that you want to perform
+ // after the address is selected.
+ // The amazonOrderReferenceId can be used to retrieve
+ // the address details by calling the GetOrderReferenceDetails
+ // operation. If rendering the AddressBook and Wallet widgets on the
+ // same page, you should wait for this event before you render the
+ // Wallet widget for the first time.
+ // The Wallet widget will re-render itself on all subsequent
+ // onAddressSelect events, without any action from you. It is not
+ // recommended that you explicitly refresh it.
+
+ new OffAmazonPayments.Widgets.Wallet({
+
+ sellerId: '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>',
+
+ onPaymentSelect: function(orderReference) {
+
+ // Replace this code with the action that you want to perform
+ // after the payment method is selected.
+
+ },
+
+ design: {
+
+ designMode: 'responsive'
+
+ },
+
+ onError: function(error) {
+
+ alert("Wallet: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
+
+ }
+
+ }).bind("walletWidgetDiv");
+
+ },
+
+ design: {
+
+ designMode: 'responsive'
+
+ },
+
+ onError: function(error) {
+
+ alert("Payment: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
+
+ }
+
+ } ).bind("addressBookWidgetDiv");
+
+ <?php } ?>
+
+/* ]]> */</script>
\ No newline at end of file diff --git a/views/mods/mod_amazon/order_done.phtml b/views/mods/mod_amazon/order_done.phtml new file mode 100644 index 0000000..216c437 --- /dev/null +++ b/views/mods/mod_amazon/order_done.phtml @@ -0,0 +1,119 @@ +<?php
+
+ /**
+ * Integration der Zahlung über Amazon in den Bestellabschluß
+ */
+
+?>
+
+<?php if ($this->view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE) { ?>
+
+<p><?php echo __('Zahlung wurde erfolgreich mit Amazon Payment abgewickelt.', 'wpsg'); ?></p>
+
+<?php } else if ($this->view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE_PAST) { ?>
+
+<p><?php echo __('Zahlung wurde bereits erfolgreich mit Amazon Payment abgewickelt.', 'wpsg'); ?></p>
+
+<?php } else if ($this->view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE_START || $this->view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE_GO) { ?>
+
+<div id="PayWithAmazon" style="<?php echo (($this->view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE_GO)?'display:none':''); ?>"></div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ var authRequest;
+
+ OffAmazonPayments.Button('PayWithAmazon', '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>', {
+
+ type: "PwA",
+ color: "Gold",
+ size: "small",
+ language: "de-DE",
+
+ authorization: function() {
+
+ loginOptions = {
+ scope: "profile payments:widget payments:shipping_address payments:billing_address",
+ popup: true
+ };
+
+ authRequest = amazon.Login.authorize(loginOptions, "<?php echo $this->view['wpsg_mod_amazon']['redirectURL']; ?>");
+
+ },
+
+ onError: function(error) {
+
+ console.log("Login: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
+
+ }
+
+ } );
+
+ var autoRun = setInterval(function(){
+
+ if (jQuery('#PayWithAmazon img').length > 0)
+ {
+
+ //setTimeout(function(){ jQuery('#PayWithAmazon img').click(); }, 1000);
+ clearInterval(autoRun);
+
+ }
+
+ }, 100);
+
+/* ]]> */</script>
+
+<?php } ?>
+
+<?php if ($this->view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE_GO) { ?>
+
+<form id="wpsg_mod_amazon_paymentForm" method="POST" action="<?php echo $this->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_amazon', 'return'); ?>">
+
+ <input type="hidden" name="order_id" value="<?php echo $_REQUEST['order_id']; ?>" />
+ <input type="hidden" name="wpsg_done" value="<?php echo $_REQUEST['wpsg_done']; ?>" />
+ <input type="hidden" name="amazon[OrderReference]" id="wpsg_mod_amazon_OrderReference" value="" />
+
+ <div id="walletWidgetDiv"></div>
+
+ <input type="submit" class="wpsg_button" name="submit" value="<?php echo __('Zahlung durchführen', 'wpsg'); ?>" id="wpsg_mod_amazon_doPayment" style="display:none;" />
+ <div class="wpsg_clear"></div>
+
+</form>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ new OffAmazonPayments.Widgets.Wallet( {
+
+ sellerId: '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>',
+
+ onOrderReferenceCreate: function(orderReference) {
+
+ jQuery('#wpsg_mod_amazon_OrderReference').val(orderReference.getAmazonOrderReferenceId());
+ jQuery('#wpsg_mod_amazon_doPayment').show();
+
+ },
+
+ onPaymentSelect: function(orderReference) {
+
+ // Replace this code with the action that you want to perform
+ // after the payment method is selected.
+
+ },
+
+ design: {
+
+ designMode: 'responsive'
+
+ },
+
+ onError: function(error) {
+
+ jQuery('#wpsg_mod_amazon_paymentForm').hide();
+ jQuery('#PayWithAmazon').show();
+
+
+ }
+
+ } ).bind("walletWidgetDiv");
+
+/* ]]> */</script>
+<?php } ?>
\ No newline at end of file diff --git a/views/mods/mod_amazon/settings_edit.phtml b/views/mods/mod_amazon/settings_edit.phtml new file mode 100644 index 0000000..317d9da --- /dev/null +++ b/views/mods/mod_amazon/settings_edit.phtml @@ -0,0 +1,33 @@ +<?php
+
+ /**
+ * Einstellungen des Moduls "AmazonPayments"
+ */
+
+?>
+
+<?php echo wpsg_drawForm_Input('wpsg_mod_amazon_seller_id', __('Seller ID / Verkäufer-ID', 'wpsg'), $this->get_option('wpsg_mod_amazon_seller_id'), array('help' => 'wpsg_mod_amazon_seller_id')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_amazon_mws_access_key_id', __('Access Key ID', 'wpsg'), $this->get_option('wpsg_mod_amazon_mws_access_key_id'), array('help' => 'wpsg_mod_amazon_mws_access_key_id')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_amazon_mws_access_key', __('Secret Access Key', 'wpsg'), $this->get_option('wpsg_mod_amazon_mws_access_key'), array('help' => 'wpsg_mod_amazon_mws_access_key')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_amazon_lwa_client_id', __('Login with Amazon Client ID', 'wpsg'), $this->get_option('wpsg_mod_amazon_lwa_client_id'), array('help' => 'wpsg_mod_amazon_lwa_client_id')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_amazon_lwa_client_secret', __('Login with Amazon Client Secret', 'wpsg'), $this->get_option('wpsg_mod_amazon_lwa_client_secret'), array('help' => 'wpsg_mod_amazon_lwa_client_secret')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_amazon_sandbox', __('Sandbox Modus', 'wpsg'), $this->get_option('wpsg_mod_amazon_sandbox'), array('help' => 'wpsg_mod_amazon_sandbox')); ?>
+
+<br />
+
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_amazon_aktiv', __('Zahlungsart für neue Bestellungen aktiv', 'wpsg'), $this->get_option('wpsg_mod_amazon_aktiv')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_amazon_name', __('Name der Zahlungsart', 'wpsg'), $this->get_option('wpsg_mod_amazon_name'), array('help' => 'wpsg_mod_amazon_name')); ?>
+<?php echo wpsg_drawForm_Textarea('wpsg_mod_amazon_hint', __('Hinweistext', 'wpsg'), $this->get_option('wpsg_mod_amazon_hint'), array('help' => 'wpsg_shippay_hint')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_amazon_subject', __('Betreff (Auf Abrechnungen für Verkäufer sichtbar)', 'wpsg'), $this->get_option('wpsg_mod_amazon_subject'), array('help' => 'wpsg_mod_amazon_subject')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_amazon_basket', __('Button in Warenkorb integrieren', 'wpsg'), $this->get_option('wpsg_mod_amazon_basket'), array('help' => 'wpsg_mod_amazon_basket')); ?>
+
+<br />
+
+<?php echo wpsg_drawForm_Input('wpsg_mod_amazon_gebuehr', __('Gebühr/Rabatt', 'wpsg'), wpsg_ff($this->get_option('wpsg_mod_amazon_gebuehr'), true), array('unit' => $this->get_option('wpsg_currency').' / %', 'help' => 'wpsg_shippay_gebuehr')); ?>
+<?php echo wpsg_drawForm_Select('wpsg_mod_amazon_mwst', __('Mehrwertsteuersatz', 'wpsg'), wpsg_tax_groups(), $this->get_option('wpsg_mod_amazon_mwst'), array('help' => 'wpsg_mod_amazon_mwst')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_amazon_mwstland', __('Keine MwSt. wenn Land steuerfrei', 'wpsg'), $this->get_option('wpsg_mod_amazon_mwstland'), array('help' => 'wpsg_mod_amazon_mwstland')); ?>
+
+<br />
+
+<?php echo wpsg_drawForm_Input('', __('Händler URL', 'wpsg'), $this->view['ipnURL'], array('readonly' => true)); ?>
+<?php echo wpsg_drawForm_Input('', __('JavaScript Origin', 'wpsg'), $this->view['jsOrigin'], array('readonly' => true)); ?>
\ No newline at end of file diff --git a/views/mods/mod_keygen/settings_edit.phtml b/views/mods/mod_keygen/settings_edit.phtml index 46fc904..f4ada77 100644 --- a/views/mods/mod_keygen/settings_edit.phtml +++ b/views/mods/mod_keygen/settings_edit.phtml @@ -87,6 +87,10 @@ <input class="checkbox" type="checkbox" name="wpsg_mod_keygen[mods][]" <?php echo ((@$_SESSION['wpsg_mod_keygen']['mods']['wpsg_mod_paypalapi'] == '1')?'checked="checked"':''); ?> value="wpsg_mod_paypalapi" /> <?php echo __('PayPal PLUS', 'wpsg'); ?>
</label>
<div class="wpsg_clear"></div>
+ <label style="line-height:25px;">
+ <input class="checkbox" type="checkbox" name="wpsg_mod_keygen[mods][]" <?php echo ((@$_SESSION['wpsg_mod_keygen']['mods']['wpsg_mod_amazon'] == '1')?'checked="checked"':''); ?> value="wpsg_mod_amazon" /> <?php echo __('AmazonPayment', 'wpsg'); ?>
+ </label>
+ <div class="wpsg_clear"></div>
</div>
</div>
|
