From ea77830018e15ab662fb0cfb2958857e3b3de532 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 30 Sep 2026 13:12:16 +0200 Subject: - Amazon Modul vereinheitlicht und moderniesiert --- views/mods/mod_amazon/basket_inner_prebutton.phtml | 145 ++----------------- .../mod_amazon/gfx/black/logo_black_100x25.png | Bin 792 -> 0 bytes .../mod_amazon/gfx/black/logo_black_130x45.png | Bin 3236 -> 0 bytes .../mod_amazon/gfx/black/logo_black_296x60.png | Bin 7003 -> 0 bytes .../mods/mod_amazon/gfx/gold/logo_gold_100x25.png | Bin 810 -> 0 bytes .../mods/mod_amazon/gfx/gold/logo_gold_130x45.png | Bin 3240 -> 0 bytes .../mods/mod_amazon/gfx/gold/logo_gold_296x60.png | Bin 7044 -> 0 bytes .../mods/mod_amazon/gfx/grey/logo_grey_100x25.png | Bin 794 -> 0 bytes .../mods/mod_amazon/gfx/grey/logo_grey_130x45.png | Bin 2490 -> 0 bytes .../mods/mod_amazon/gfx/grey/logo_grey_296x60.png | Bin 5565 -> 0 bytes views/mods/mod_amazon/order_done.phtml | 149 +++++++------------- .../mods/mod_amazon/order_view_afterpayment.phtml | 88 ++++++++++-- views/mods/mod_amazon/settings_edit.phtml | 155 ++++++++++++++++++--- 13 files changed, 275 insertions(+), 262 deletions(-) delete mode 100644 views/mods/mod_amazon/gfx/black/logo_black_100x25.png delete mode 100644 views/mods/mod_amazon/gfx/black/logo_black_130x45.png delete mode 100644 views/mods/mod_amazon/gfx/black/logo_black_296x60.png delete mode 100644 views/mods/mod_amazon/gfx/gold/logo_gold_100x25.png delete mode 100644 views/mods/mod_amazon/gfx/gold/logo_gold_130x45.png delete mode 100644 views/mods/mod_amazon/gfx/gold/logo_gold_296x60.png delete mode 100644 views/mods/mod_amazon/gfx/grey/logo_grey_100x25.png delete mode 100644 views/mods/mod_amazon/gfx/grey/logo_grey_130x45.png delete mode 100644 views/mods/mod_amazon/gfx/grey/logo_grey_296x60.png (limited to 'views/mods/mod_amazon') diff --git a/views/mods/mod_amazon/basket_inner_prebutton.phtml b/views/mods/mod_amazon/basket_inner_prebutton.phtml index 5a1afcf..6b01b78 100644 --- a/views/mods/mod_amazon/basket_inner_prebutton.phtml +++ b/views/mods/mod_amazon/basket_inner_prebutton.phtml @@ -1,139 +1,16 @@ - -
- -
-
- - - - - -
- - \ No newline at end of file +
+
+
diff --git a/views/mods/mod_amazon/gfx/black/logo_black_100x25.png b/views/mods/mod_amazon/gfx/black/logo_black_100x25.png deleted file mode 100644 index 47b9f60..0000000 Binary files a/views/mods/mod_amazon/gfx/black/logo_black_100x25.png and /dev/null differ diff --git a/views/mods/mod_amazon/gfx/black/logo_black_130x45.png b/views/mods/mod_amazon/gfx/black/logo_black_130x45.png deleted file mode 100644 index ae6a6c8..0000000 Binary files a/views/mods/mod_amazon/gfx/black/logo_black_130x45.png and /dev/null differ diff --git a/views/mods/mod_amazon/gfx/black/logo_black_296x60.png b/views/mods/mod_amazon/gfx/black/logo_black_296x60.png deleted file mode 100644 index 6e31c55..0000000 Binary files a/views/mods/mod_amazon/gfx/black/logo_black_296x60.png and /dev/null differ diff --git a/views/mods/mod_amazon/gfx/gold/logo_gold_100x25.png b/views/mods/mod_amazon/gfx/gold/logo_gold_100x25.png deleted file mode 100644 index bb16b5b..0000000 Binary files a/views/mods/mod_amazon/gfx/gold/logo_gold_100x25.png and /dev/null differ diff --git a/views/mods/mod_amazon/gfx/gold/logo_gold_130x45.png b/views/mods/mod_amazon/gfx/gold/logo_gold_130x45.png deleted file mode 100644 index 3634935..0000000 Binary files a/views/mods/mod_amazon/gfx/gold/logo_gold_130x45.png and /dev/null differ diff --git a/views/mods/mod_amazon/gfx/gold/logo_gold_296x60.png b/views/mods/mod_amazon/gfx/gold/logo_gold_296x60.png deleted file mode 100644 index b9a2987..0000000 Binary files a/views/mods/mod_amazon/gfx/gold/logo_gold_296x60.png and /dev/null differ diff --git a/views/mods/mod_amazon/gfx/grey/logo_grey_100x25.png b/views/mods/mod_amazon/gfx/grey/logo_grey_100x25.png deleted file mode 100644 index 8f751d6..0000000 Binary files a/views/mods/mod_amazon/gfx/grey/logo_grey_100x25.png and /dev/null differ diff --git a/views/mods/mod_amazon/gfx/grey/logo_grey_130x45.png b/views/mods/mod_amazon/gfx/grey/logo_grey_130x45.png deleted file mode 100644 index 8a34705..0000000 Binary files a/views/mods/mod_amazon/gfx/grey/logo_grey_130x45.png and /dev/null differ diff --git a/views/mods/mod_amazon/gfx/grey/logo_grey_296x60.png b/views/mods/mod_amazon/gfx/grey/logo_grey_296x60.png deleted file mode 100644 index edd225d..0000000 Binary files a/views/mods/mod_amazon/gfx/grey/logo_grey_296x60.png and /dev/null differ diff --git a/views/mods/mod_amazon/order_done.phtml b/views/mods/mod_amazon/order_done.phtml index 80665c9..69aed24 100644 --- a/views/mods/mod_amazon/order_done.phtml +++ b/views/mods/mod_amazon/order_done.phtml @@ -1,122 +1,73 @@ view['wpsg_mod_amazon']; + $state = (string)($arView['state']??''); + $bAutostart = (($arView['autostart']??false) === true); + ?> -view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE) { ?> + -

+

-view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE_PAST) { ?> +

+ +

-

+ -view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE_START || $this->view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE_GO) { ?> + - authorization: function() { - - loginOptions = { - scope: "profile payments:widget payments:shipping_address payments:billing_address", - popup: true - }; - - authRequest = amazon.Login.authorize(loginOptions, "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); +

- - - + + +
+ + + +

-view['wpsg_mod_amazon']['state'] === wpsg_mod_amazon::ORDER_DONE_GO) { ?> - -
- - - - - -

- - -
- -
- - - \ No newline at end of file + + +

+ + + +

+ + diff --git a/views/mods/mod_amazon/order_view_afterpayment.phtml b/views/mods/mod_amazon/order_view_afterpayment.phtml index 5033df6..617dda0 100644 --- a/views/mods/mod_amazon/order_view_afterpayment.phtml +++ b/views/mods/mod_amazon/order_view_afterpayment.phtml @@ -1,24 +1,92 @@ view['oOrder']; + if (!defined('ABSPATH')) exit; - $amazon_capture_id = $oOrder->getMeta('amazon_capture_id'); - $amazon_refund_id = $oOrder->getMeta('amazon_refund_id'); + $arView = $this->view['wpsg_mod_amazon']; + $oOrder = $arView['oOrder']; + + $strState = (string)$oOrder->getMeta(wpsg_mod_amazon::META_STATE); + $strChargeId = (string)$oOrder->getMeta(wpsg_mod_amazon::META_CHARGE); + $strRefundId = (string)$oOrder->getMeta(wpsg_mod_amazon::META_REFUND); + $strRefundState = (string)$oOrder->getMeta(wpsg_mod_amazon::META_REFUND_STATE); + + // Farbe des Status: eingezogen bzw. erstattet grün, offen gelb, abgelehnt rot + $arStateClass = [ + 'Captured' => 'success', + 'Completed' => 'success', + 'Refunded' => 'success', + 'AuthorizationInitiated' => 'warning', + 'Authorized' => 'warning', + 'CaptureInitiated' => 'warning', + 'RefundInitiated' => 'warning', + 'Open' => 'warning', + 'Declined' => 'danger', + 'Canceled' => 'danger' + ]; + + $strBadge = '%s'; + + $strRefreshURL = wpsg_admin_url('Order', 'view', ['action' => 'ajax', 'edit_id' => $oOrder->getId(), 'do' => 'refresh', 'mod' => 'wpsg_mod_amazon'], ['noheader' => '1']); + $strRefundURL = wpsg_admin_url('Order', 'view', ['action' => 'ajax', 'edit_id' => $oOrder->getId(), 'do' => 'refund', 'mod' => 'wpsg_mod_amazon'], ['noheader' => '1']); ?> - + + + + + __('Amazon-Referenznummer', 'wpsg'), 'amazon_capture_id' => __('Capture ID', 'wpsg'), 'amazon_refund_id' => __('Refund ID', 'wpsg')] as $meta_key => $meta_label) { ?> + + getMeta($meta_key) !== '') { ?> + + '.esc_html($oOrder->getMeta($meta_key)).''); ?> + + + + + +getMeta(wpsg_mod_amazon::META_SESSION) !== '') { ?> + + '.esc_html__('Status Aktualisieren', 'wpsg').''; + + if ($arView['bRefundable']) { + + $strStateHTML .= '   '.esc_html__('Erstatten', 'wpsg').''; + + } + + ?> + + + + getMeta(wpsg_mod_amazon::META_ENV) === wpsg_mod_amazon::ENV_SANDBOX) { ?> + + + + + + __('Amazon-Referenznummer', 'wpsg'), wpsg_mod_amazon::META_CHARGE => __('Charge ID', 'wpsg'), wpsg_mod_amazon::META_SESSION => __('Checkout Session ID', 'wpsg')] as $meta_key => $meta_label) { ?> + + getMeta($meta_key) !== '') { ?> + + '.esc_html($oOrder->getMeta($meta_key)).''); ?> + + - true]); ?> + - + - true]); ?> + '.esc_html($strRefundId).''); ?> + - + diff --git a/views/mods/mod_amazon/settings_edit.phtml b/views/mods/mod_amazon/settings_edit.phtml index 827c68f..35020eb 100644 --- a/views/mods/mod_amazon/settings_edit.phtml +++ b/views/mods/mod_amazon/settings_edit.phtml @@ -1,32 +1,149 @@ view['wpsg_mod_amazon']; + $bSandbox = (bool)$arView['bSandbox']; + + $arStornoStatus = (array)$this->get_option('wpsg_mod_amazon_stornostate'); + + // Anmeldung für Amazon-Pay-Händler, führt direkt in den Amazon-Pay-Bereich der Seller Central + $strSellerCentralURL = 'https://pay.amazon.de/signin'; + + $strBadge = '%s'; + + $arEnvLabel = [ + wpsg_mod_amazon::ENV_LIVE => __('Zugangsdaten Live-System', 'wpsg'), + wpsg_mod_amazon::ENV_SANDBOX => __('Zugangsdaten Sandbox (Testbetrieb)', 'wpsg') + ]; + + if ($bSandbox) { + + $strMode = sprintf($strBadge, 'warning', esc_html__('Sandbox (Testbetrieb)', 'wpsg')); + + } else { + + $strMode = sprintf($strBadge, 'success', esc_html__('Live', 'wpsg')); + + } + ?> -get_option('wpsg_mod_amazon_seller_id'), array('help' => 'wpsg_mod_amazon_seller_id')); ?> -get_option('wpsg_mod_amazon_mws_access_key_id'), array('help' => 'wpsg_mod_amazon_mws_access_key_id')); ?> -get_option('wpsg_mod_amazon_mws_access_key'), array('help' => 'wpsg_mod_amazon_mws_access_key')); ?> -get_option('wpsg_mod_amazon_lwa_client_id'), array('help' => 'wpsg_mod_amazon_lwa_client_id')); ?> -get_option('wpsg_mod_amazon_lwa_client_secret'), array('help' => 'wpsg_mod_amazon_lwa_client_secret')); ?> -get_option('wpsg_mod_amazon_sandbox'), array('help' => 'wpsg_mod_amazon_sandbox')); ?> + + +
+ +
+ + + + + + __('Live-System', 'wpsg'), '1' => __('Sandbox (Testbetrieb)', 'wpsg')], (($bSandbox)?'1':'0'), ['help' => 'wpsg_mod_amazon_sandbox', 'hint' => esc_html__('Neue Zahlungen laufen über die Zugangsdaten der aktiven Umgebung. In der Sandbox werden keine echten Zahlungen ausgeführt. Bestehende Zahlungen fragt der Shop weiterhin in der Umgebung ab, in der sie angelegt wurden.', 'wpsg')]); ?> + + + + + $arEnv) { ?> + + '.esc_html($arStatus['message']).''; + + } + + if ($bActive) $strConnection .= ' '.sprintf($strBadge, 'info', esc_html__('aktiv', 'wpsg')); + + $strKey = sprintf($strBadge, (($arEnv['bKey'])?'success':'danger'), (($arEnv['bKey'])?esc_html__('Hinterlegt', 'wpsg'):esc_html__('Fehlt', 'wpsg'))); + + ?> + + + + + + + + + + + + + + +
+ + + + 'wpsg_mod_amazon_seller_id']); ?> + 'wpsg_mod_amazon_store_id', 'hint' => esc_html__('Beginnt mit "amzn1.application-oa2-client.". Das "Client Secret" daneben wird nicht benötigt.', 'wpsg')]); ?> + 'wpsg_mod_amazon_public_key_id', 'hint' => wpsg_translate(__('Händler-ID, Client-ID/Store-ID und API-Schlüssel finden bzw. erzeugen Sie in der Seller Central unter "Integration → Integration Central".', 'wpsg'), esc_url($strSellerCentralURL))]); ?> + '.pem', 'help' => 'wpsg_mod_amazon_private_key']); ?> + + + + + + + + get_option('wpsg_mod_amazon_aktiv'), ['help' => 'wpsg_shippay_activ']); ?> + get_option('wpsg_mod_amazon_name'), ['help' => 'wpsg_mod_amazon_name']); ?> + get_option('wpsg_mod_amazon_hint'), ['help' => 'wpsg_shippay_hint']); ?> + get_option('wpsg_mod_amazon_gebuehr'), true), ['help' => 'wpsg_shippay_gebuehr', 'unit' => $this->get_option('wpsg_currency').' / %']); ?> + get_option('wpsg_mod_amazon_mwst'), ['help' => 'wpsg_mod_amazon_mwst']); ?> + + + + + + get_option('wpsg_mod_amazon_basket'), ['help' => 'wpsg_mod_amazon_basket']); ?> + get_option('wpsg_mod_amazon_autostart'), ['help' => 'wpsg_mod_amazon_autostart']); ?> + get_option('wpsg_mod_amazon_buttoncolor'), ['help' => 'wpsg_mod_amazon_buttoncolor']); ?> + get_option('wpsg_mod_amazon_subject'), ['help' => 'wpsg_mod_amazon_subject']); ?> + + + + + + true, 'help' => 'wpsg_mod_amazon_ipn_url', 'hint' => esc_html__('Tragen Sie diese URL in der Seller Central unter "Integration → Integration Central → IPN-Einstellungen" ein. Amazon meldet darüber Zahlungen, die erst später eingezogen werden, und den Stand von Erstattungen. Die URL muss per HTTPS von außen erreichbar sein.', 'wpsg')]); ?> + + -
+ -get_option('wpsg_mod_amazon_aktiv')); ?> -get_option('wpsg_mod_amazon_name'), array('help' => 'wpsg_mod_amazon_name')); ?> -get_option('wpsg_mod_amazon_hint'), array('help' => 'wpsg_shippay_hint')); ?> -get_option('wpsg_mod_amazon_subject'), array('help' => 'wpsg_mod_amazon_subject')); ?> -get_option('wpsg_mod_amazon_basket'), array('help' => 'wpsg_mod_amazon_basket')); ?> +

-
+ arStatus as $status_id => $status_label) { ?> -get_option('wpsg_mod_amazon_gebuehr'), true), array('unit' => $this->get_option('wpsg_currency').' / %', 'help' => 'wpsg_shippay_gebuehr')); ?> -get_option('wpsg_mod_amazon_mwst'), array('help' => 'wpsg_mod_amazon_mwst')); ?> + -
+ -view['ipnURL'], array('readonly' => true)); ?> -view['jsOrigin'], array('readonly' => true)); ?> \ No newline at end of file + -- cgit v1.2.3