Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APF-423 updates admin buy now strings #1225

Open
wants to merge 2 commits into
base: spc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Block/Adminhtml/System/Config/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
]);

Expand Down
14 changes: 9 additions & 5 deletions Block/Adminhtml/System/Config/SpcTokenSyncStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions Model/Spc/AuthTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand All @@ -313,7 +313,7 @@ public function createOrRenewAndSendTokens()

$this->saveLastSync($store->getId());

$this->saveStatus(__('Tokens synced successfully'), $store->getId());
$this->saveStatus('success', $store->getId());
}
}

Expand Down
4 changes: 2 additions & 2 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@
<comment><![CDATA[This feature is still in beta stage. For instructions on how to activate it, contact your account manager or <a target="_blank" href="https://sellercentral.amazon.com/cu/contact-us">Amazon Pay merchant support</a>.]]></comment>
</field>
<field id="spc_api_domain" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Buy Now Endpoint Domain Override</label>
<label>Buy Now Endpoint URL</label>
<config_path>payment/amazon_payment_v2/spc_api_domain</config_path>
<frontend_model>Amazon\Pay\Block\Adminhtml\System\Config\Form\SpcApiDomain</frontend_model>
<backend_model>Amazon\Pay\Model\Config\Form\SpcApiDomainBackend</backend_model>
<comment><![CDATA[This domain override will be used when syncing tokens with Amazon Pay. The field defaults to the admin domain. If your admin panel or API endpoint domain differs from this, please enter it here in the format &quot;https://&lt;override-domain&gt;/&quot;, including the slash at the end.]]></comment>
<comment><![CDATA[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:<br>https://www.example.com/]]></comment>
</field>
<field id="spc_tokens_sync" translate="label" type="button" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Buy Now Integration User Tokens</label>
Expand Down
2 changes: 2 additions & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
<sign_in_result_url>amazon_pay/login/authorize/</sign_in_result_url>
<can_use_internal>0</can_use_internal>
<spc_tokens_sync_status_no>No tokens have been synced yet.</spc_tokens_sync_status_no>
<spc_tokens_sync_status_success>Tokens synced successfully on</spc_tokens_sync_status_success>
<spc_tokens_sync_status_failed>Tokens failed to sync on</spc_tokens_sync_status_failed>
<can_authorize_vault>1</can_authorize_vault>
<can_capture_vault>1</can_capture_vault>
</amazon_payment_v2>
Expand Down
8 changes: 8 additions & 0 deletions i18n/de_AT.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a target=""_blank"" href=""https://sellercentral.amazon.com/cu/contact-us"">Amazon Pay merchant support</a>.","Diese Funktion befindet sich noch in der Beta-Phase. Um Anweisungen zur Aktivierung zu erhalten, kontaktieren Sie Ihren Account Manager oder den <a target=""_blank"" href=""https://sellercentral-europe.amazon.com/cu/contact-us?ld=ELUKLPA-sim.amazon.com"">Amazon Pay Händlersupport.</a>"
"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:<br>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:<br>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"
8 changes: 8 additions & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a target=""_blank"" href=""https://sellercentral.amazon.com/cu/contact-us"">Amazon Pay merchant support</a>.","This feature is still in beta stage. For instructions on how to activate it, contact your account manager or <a target=""_blank"" href=""https://sellercentral.amazon.com/cu/contact-us"">Amazon Pay merchant support</a>."
"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:<br>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:<br>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"
8 changes: 8 additions & 0 deletions i18n/es_AR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a target=""_blank"" href=""https://sellercentral.amazon.com/cu/contact-us"">Amazon Pay merchant support</a>.","É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 <a target=""_blank"" href=""https://sellercentral.amazon.com/cu/contact-us"">servicio de asistencia para vendedores de Amazon Pay</a>."
"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:<br>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:<br>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"
8 changes: 8 additions & 0 deletions i18n/fr_CA.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a target=""_blank"" href=""https://sellercentral.amazon.com/cu/contact-us"">Amazon Pay merchant support</a>.","Cette fonctionnalité est toujours en phase bêta. Pour savoir comment l'activer, contactez votre responsable de compte ou le service de <a target=""_blank"" href=""https://sellercentral.amazon.com/cu/contact-us"">support marchands Amazon Pay</a>."
"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:<br>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 :<br>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"
8 changes: 8 additions & 0 deletions i18n/it_CH.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a target=""_blank"" href=""https://sellercentral.amazon.com/cu/contact-us"">Amazon Pay merchant support</a>.","Questa funzionalità è ancora in fase beta. Per istruzioni su come attivarla, contatta il tuo account manager o l'<a target=""_blank"" href=""https://sellercentral-europe.amazon.com/cu/contact-us?ld=ELUKLPA-sim.amazon.com"">assistenza al venditore di Amazon Pay</a>."
"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:<br>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:<br>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"
8 changes: 8 additions & 0 deletions i18n/ja_JP.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a target=""_blank"" href=""https://sellercentral.amazon.com/cu/contact-us"">Amazon Pay merchant support</a>.","この機能はベータ版です。有効化したい場合は、担当のアカウントマネージャーか<a target=""_blank"" href=""https://sellercentral-japan.amazon.com/gp/contact-us/contact-amazon-form.html?communicationDeliveryId=fb75439f-d48b-4f3d-ba73-b102f20d17bc"">テクニカルサポート</a>までご連絡ください。"
"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:<br>https://www.example.com/","このドメイン上書きはAmazon Payとトークンを同期する際に使用されます。このフィールドのデフォルトは管理ドメインです。管理パネルまたはAPIエンドポイントドメインがこれと異なる場合は末尾のスラッシュを含め、「"<br>>https://<override-domain>/"」の形式でここに入力してください。"
"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","トークンの同期に失敗しました"