diff --git a/Block/Adminhtml/System/Config/Button.php b/Block/Adminhtml/System/Config/Button.php index c09e7bf0..6e7bc079 100644 --- a/Block/Adminhtml/System/Config/Button.php +++ b/Block/Adminhtml/System/Config/Button.php @@ -46,7 +46,7 @@ public function getButtonHtml() $button = $this->getLayout()->createBlock('Magento\Backend\Block\Widget\Button') ->setData([ 'id' => 'sync_tokens', - 'label' => __('Manually Generate & Sync Tokens'), + 'label' => __('Generate & sync tokens'), 'on_click' => sprintf("location.href = '%s';", $this->getCustomUrl()), ]); diff --git a/Block/Adminhtml/System/Config/SpcTokenSyncStatus.php b/Block/Adminhtml/System/Config/SpcTokenSyncStatus.php index bb11e7cd..89e73384 100644 --- a/Block/Adminhtml/System/Config/SpcTokenSyncStatus.php +++ b/Block/Adminhtml/System/Config/SpcTokenSyncStatus.php @@ -55,17 +55,21 @@ protected function _getElementHtml(AbstractElement $element) public function getConfigForAllStores() { $storeValues = []; - $noSyncMessage = $this->_scopeConfig->getValue('payment/amazon_payment_v2/spc_tokens_sync_status_no'); + $noSyncMessage = __($this->_scopeConfig->getValue('payment/amazon_payment_v2/spc_tokens_sync_status_no')); + $successSyncMessage = __($this->_scopeConfig->getValue('payment/amazon_payment_v2/spc_tokens_sync_status_success')); + $failedSyncMessage = __($this->_scopeConfig->getValue('payment/amazon_payment_v2/spc_tokens_sync_status_failed')); foreach ($this->storeRepository->getList() as $store) { if ($store->getId() == 0) { continue; } - $value = $this->_scopeConfig->getValue( - 'payment/amazon_pay/spc_tokens_sync_status', - 'store', - $store->getId()) ?? $noSyncMessage; + $syncTime = $this->_scopeConfig->getValue('payment/amazon_pay/spc_tokens_last_sync', 'store', $store->getId()); + $syncStatus = $this->_scopeConfig->getValue('payment/amazon_pay/spc_tokens_sync_status', 'store', $store->getId()); + + $value = $syncTime + ? (strpos($syncStatus, 'failed') !== false ? $failedSyncMessage : $successSyncMessage) .' '. $syncTime + : $noSyncMessage; $storeValues[] = [ 'store_name' => $store->getName(), diff --git a/Model/Spc/AuthTokens.php b/Model/Spc/AuthTokens.php index f4164d0a..1009a180 100644 --- a/Model/Spc/AuthTokens.php +++ b/Model/Spc/AuthTokens.php @@ -304,7 +304,7 @@ public function createOrRenewAndSendTokens() $responseCode = $response['status'] ?? '404'; if (!preg_match('/^2\d\d$/', $responseCode)) { - $this->saveStatus(__('Tokens failed to sync'), $store->getId()); + $this->saveStatus('failed', $store->getId()); $errorResponses[] = $response['message']; @@ -313,7 +313,7 @@ public function createOrRenewAndSendTokens() $this->saveLastSync($store->getId()); - $this->saveStatus(__('Tokens synced successfully'), $store->getId()); + $this->saveStatus('success', $store->getId()); } } diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 3c74a7c0..54e53a10 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -216,11 +216,11 @@ Amazon Pay merchant support.]]> - + payment/amazon_payment_v2/spc_api_domain Amazon\Pay\Block\Adminhtml\System\Config\Form\SpcApiDomain Amazon\Pay\Model\Config\Form\SpcApiDomainBackend - + https://www.example.com/]]> diff --git a/etc/config.xml b/etc/config.xml index 7295213f..a5c3646a 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -55,6 +55,8 @@ amazon_pay/login/authorize/ 0 No tokens have been synced yet. + Tokens synced successfully on + Tokens failed to sync on 1 1 diff --git a/i18n/de_AT.csv b/i18n/de_AT.csv index 3288c8b1..3ec8ebb8 100644 --- a/i18n/de_AT.csv +++ b/i18n/de_AT.csv @@ -197,3 +197,11 @@ "Upgrade your legacy Amazon Pay credentials","Aktualisieren Sie Ihre alten Amazon Pay-Anmeldeinformationen" "Updating your config with new keys, please wait...","Aktualisieren Ihrer Konfiguration mit neuen Schlüsseln, bitte warten..." "This feature is still in beta stage. For instructions on how to activate it, contact your account manager or Amazon Pay merchant support.","Diese Funktion befindet sich noch in der Beta-Phase. Um Anweisungen zur Aktivierung zu erhalten, kontaktieren Sie Ihren Account Manager oder den Amazon Pay Händlersupport." +"Buy Now Endpoint URL","Endpunkt-URL für Jetzt kaufen" +"This URL is used to synchronize tokens with Amazon Pay. Your admin panel's URL is set by default. If your admin panel or API endpoint URL differs from this, enter the corresponding URL—including the slash at the end—in the following format:
https://www.example.com/","Diese URL wird zur Synchronisierung von Tokens mit Amazon Pay verwendet. Die URL Ihres Admin-Bereichs ist standardmäßig hinterlegt. Wenn Ihr Admin-Bereich oder Ihre API-Endpunkt-URL hiervon abweicht, geben Sie die entsprechende URL, einschließlich des Schrägstrichs am Ende, im folgenden Format ein:
https://www.example.com/" +"Buy Now Integration User Tokens","User Tokens für die Jetzt kaufen-Integration" +"Generate & sync tokens","Tokens generieren und synchronisieren" +"Buy Now Token Sync Status","Synchronisierungsstatus der Jetzt kaufen-Tokens" +"Tokens not synced yet","Tokens not synced yet" +"Tokens synced successfully on","Tokens erfolgreich synchronisiert am" +"Tokens failed to sync on","Synchronisierung der Tokens fehlgeschlagen am" diff --git a/i18n/en_US.csv b/i18n/en_US.csv index aa436ea2..4512092d 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -140,3 +140,11 @@ "Upgrade your legacy Amazon Pay credentials","Upgrade your legacy Amazon Pay credentials" "Updating your config with new keys, please wait...","Updating your config with new keys, please wait..." "This feature is still in beta stage. For instructions on how to activate it, contact your account manager or Amazon Pay merchant support.","This feature is still in beta stage. For instructions on how to activate it, contact your account manager or Amazon Pay merchant support." +"Buy Now Endpoint URL","Buy Now Endpoint URL" +"This URL is used to synchronize tokens with Amazon Pay. Your admin panel's URL is set by default. If your admin panel or API endpoint URL differs from this, enter the corresponding URL—including the slash at the end—in the following format:
https://www.example.com/","This URL is used to synchronize tokens with Amazon Pay. Your admin panel's URL is set by default. If your admin panel or API endpoint URL differs from this, enter the corresponding URL—including the slash at the end—in the following format:
https://www.example.com/" +"Buy Now Integration User Tokens","Buy Now Integration User Tokens" +"Generate & sync tokens","Generate & sync tokens" +"Buy Now Token Sync Status","Buy Now Token Sync Status" +"Tokens not synced yet","Tokens not synced yet" +"Tokens synced successfully on","Tokens synced successfully on" +"Tokens failed to sync on","Tokens failed to sync on" diff --git a/i18n/es_AR.csv b/i18n/es_AR.csv index cd7c47ff..272d6def 100644 --- a/i18n/es_AR.csv +++ b/i18n/es_AR.csv @@ -202,3 +202,11 @@ Nota: El botón de Amazon Pay solo podrán verlo los clientes con las direccione "Upgrade your legacy Amazon Pay credentials","Actualice sus credenciales heredadas de Amazon Pay" "Updating your config with new keys, please wait...","Actualizando su configuración con claves nuevas, por favor espere..." "This feature is still in beta stage. For instructions on how to activate it, contact your account manager or Amazon Pay merchant support.","Ésta función aún se encuentra en fase beta. Para obtener instrucciones sobre cómo activarla, ponte en contacto con el administrador de tu cuenta o con el servicio de asistencia para vendedores de Amazon Pay." +"Buy Now Endpoint URL","Endpoint URL de «Comprar ahora»" +"This URL is used to synchronize tokens with Amazon Pay. Your admin panel's URL is set by default. If your admin panel or API endpoint URL differs from this, enter the corresponding URL—including the slash at the end—in the following format:
https://www.example.com/","Esta URL se utiliza para sincronizar tokens con Amazon Pay. La URL del panel de administración está configurada de forma predeterminada. Si la URL del panel de administración o del endpoint de la API es distinta a esta, introduce la URL correspondiente (incluida la barra al final) con el siguiente formato:
https://www.ejemplo.com/" +"Buy Now Integration User Tokens","Tokens de usuario de integración para «Comprar ahora»" +"Generate & sync tokens","Genera y sincroniza tokens" +"Buy Now Token Sync Status","Estado de la sincronización de los tokens de «Comprar ahora»" +"Tokens not synced yet","Tokens not synced yet" +"Tokens synced successfully on","Los tokens se han sincronizaron correctamente en" +"Tokens failed to sync on","Error al sincronizar los tokens en" diff --git a/i18n/fr_CA.csv b/i18n/fr_CA.csv index 7b610fa7..2404efd9 100644 --- a/i18n/fr_CA.csv +++ b/i18n/fr_CA.csv @@ -199,3 +199,11 @@ "Upgrade your legacy Amazon Pay credentials","Mettez à niveau vos anciennes informations d'identification Amazon Pay" "Updating your config with new keys, please wait...","Mise à jour de votre configuration avec de nouvelles clés, veuillez patienter..." "This feature is still in beta stage. For instructions on how to activate it, contact your account manager or Amazon Pay merchant support.","Cette fonctionnalité est toujours en phase bêta. Pour savoir comment l'activer, contactez votre responsable de compte ou le service de support marchands Amazon Pay." +"Buy Now Endpoint URL","URL de notification IPN Acheter maintenant" +"This URL is used to synchronize tokens with Amazon Pay. Your admin panel's URL is set by default. If your admin panel or API endpoint URL differs from this, enter the corresponding URL—including the slash at the end—in the following format:
https://www.example.com/","Cette URL est utilisée pour synchroniser les jetons avec Amazon Pay. L'URL de votre panneau d'administration est définie par défaut. Si l'URL de votre panneau d'administration ou de votre URL de notification IPN est différente de celle-ci, entrez l'URL correspondante, comprenant le slash à la fin, au format suivant :
https://www.example.com/" +"Buy Now Integration User Tokens","Jetons utilisateur d'intégration Acheter maintenant" +"Generate & sync tokens","Générez et synchronisez des jetons" +"Buy Now Token Sync Status","Statut de synchronisation des jetons Acheter maintenant" +"Tokens not synced yet","Tokens not synced yet" +"Tokens synced successfully on","Les jetons ont été synchronisés avec succès le" +"Tokens failed to sync on","Échec de la synchronisation des jetons le" diff --git a/i18n/it_CH.csv b/i18n/it_CH.csv index 32eb2198..528f8c9e 100644 --- a/i18n/it_CH.csv +++ b/i18n/it_CH.csv @@ -198,3 +198,11 @@ "Upgrade your legacy Amazon Pay credentials","Aggiorna le tue credenziali Amazon Pay legacy" "Updating your config with new keys, please wait...","Aggiornamento della configurazione con nuove chiavi, attendere..." "This feature is still in beta stage. For instructions on how to activate it, contact your account manager or Amazon Pay merchant support.","Questa funzionalità è ancora in fase beta. Per istruzioni su come attivarla, contatta il tuo account manager o l'assistenza al venditore di Amazon Pay." +"Buy Now Endpoint URL","URL endpoint Acquista ora" +"This URL is used to synchronize tokens with Amazon Pay. Your admin panel's URL is set by default. If your admin panel or API endpoint URL differs from this, enter the corresponding URL—including the slash at the end—in the following format:
https://www.example.com/","Questo URL viene utilizzato per sincronizzare i token con Amazon Pay. L'URL del tuo pannello di amministrazione è impostato in modo predefinito. Se l'URL del tuo pannello di amministrazione o dell'endpoint dell'API è diverso da questo, inserisci l'URL corrispondente, inclusa la barra alla fine, nel seguente formato:
https://www.example.com/" +"Buy Now Integration User Tokens","Token utente per integrazione Acquista ora" +"Generate & sync tokens","Genera e sincronizza token" +"Buy Now Token Sync Status","Stato di sincronizzazione dei token Acquista ora" +"Tokens not synced yet","Tokens not synced yet" +"Tokens synced successfully on","Token sincronizzati correttamente" +"Tokens failed to sync on","Impossibile sincronizzare i token" diff --git a/i18n/ja_JP.csv b/i18n/ja_JP.csv index 5efb9477..1af61523 100644 --- a/i18n/ja_JP.csv +++ b/i18n/ja_JP.csv @@ -15,3 +15,11 @@ "With Amazon Pay and Amazon Sign-in, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Amazon Payをご利用いただくと、Amazonアカウントに登録されている住所情報とお支払い方法を使ってかんたんに当ショップで注文を行うことができます。" "or","または" "This feature is still in beta stage. For instructions on how to activate it, contact your account manager or Amazon Pay merchant support.","この機能はベータ版です。有効化したい場合は、担当のアカウントマネージャーかテクニカルサポートまでご連絡ください。" +"Buy Now Endpoint URL","Buy Now エンドポイントドメインの上書き" +"This URL is used to synchronize tokens with Amazon Pay. Your admin panel's URL is set by default. If your admin panel or API endpoint URL differs from this, enter the corresponding URL—including the slash at the end—in the following format:
https://www.example.com/","このドメイン上書きはAmazon Payとトークンを同期する際に使用されます。このフィールドのデフォルトは管理ドメインです。管理パネルまたはAPIエンドポイントドメインがこれと異なる場合は末尾のスラッシュを含め、「"
>https:///"」の形式でここに入力してください。" +"Buy Now Integration User Tokens","Buy Now インテグレーションユーザートークン" +"Generate & sync tokens","トークンの手動生成と同期" +"Buy Now Token Sync Status","Buy Now トークンの同期ステータス" +"Tokens not synced yet","Tokens not synced yet" +"Tokens synced successfully on","トークンが正常に同期されました" +"Tokens failed to sync on","トークンの同期に失敗しました"