Skip to content

Commit

Permalink
CET-537/fix: Update wording
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkwr committed Dec 7, 2024
1 parent 1c3dac1 commit 185790b
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 15 deletions.
13 changes: 7 additions & 6 deletions Controller/Payment/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,16 @@ public function execute()
$this->orderService->processOrder($order, $twoOrder['id']);
return $this->getResponse()->setRedirect($this->_url->getUrl('checkout/onepage/success'));
} else {
$comment = __(
'Unable to confirm %1 order with %2 state.',
$this->configRepository::PROVIDER,
$twoOrder['state'] ?? 'undefined'
);
$this->orderService->addOrderComment($order, $comment);
$message = __(
'Unable to retrieve payment information for your invoice purchase with %1. ' .
'The cart will be restored.',
'Your invoice purchase with %1 could not be processed. The cart will be restored.',
$this->configRepository::PROVIDER
);
if (!empty($twoOrder['decline_reason'])) {
$message = __('%1 Decline reason: %2', $message, $twoOrder['decline_reason']);
}
$this->orderService->addOrderComment($order, $message);
throw new LocalizedException($message);
}
} catch (Exception $exception) {
Expand Down
6 changes: 3 additions & 3 deletions Model/Ui/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getConfig(): array
$provider = $this->configRepository::PROVIDER;
$tryAgainLater = __('Please try again later.');
$soleTraderaccountCouldNotBeVerified = __('Your sole trader account could not be verified.');
$paymentTerms = __("Payment Terms");
$paymentTerms = __("%1 terms and conditions", $this->configRepository::PROVIDER);
$paymentTermsLink = $this->configRepository->getCheckoutPageUrl() . '/terms';

return [
Expand Down Expand Up @@ -116,10 +116,10 @@ public function getConfig(): array
$tryAgainLater
),
'paymentTermsMessage' => __(
'By checking this box, I confirm that I have read and agree to the %1.',
'By checking this box, I confirm that I have read and agree to %1.',
sprintf('<a href="%s" target="_blank">%s</a>', $paymentTermsLink, $paymentTerms)
),
'termsNotAcceptedMessage' => __('You must first accept the payment terms.'),
'termsNotAcceptedMessage' => __('You must accept %1 to place order.', $paymentTerms),
'soleTraderErrorMessage' => __(
'Something went wrong with your request to %1. %2',
$provider,
Expand Down
10 changes: 4 additions & 6 deletions Service/Payment/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,11 @@ public function processOrder(Order $order, string $transactionId)
if ($invoice->getGrandTotal() > 0) {
$invoice->setRequestedCaptureCase(Invoice::CAPTURE_ONLINE);
$invoice->register();
$this->addOrderComment(
$order,
sprintf(
'%s order payment has been verified',
$this->configRepository::PROVIDER
)
$message = __(
'%1 payment has been verified by the customer.',
$this->configRepository::PROVIDER
);
$this->addOrderComment($order, $message);
$transactionSave = $this->transaction
->addObject(
$payment
Expand Down
8 changes: 8 additions & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"%1 Decline reason: %2","%1 Decline reason: %2"
"%1 Details","%1 Details"
"%1 [Trace ID: %2]","%1 [Trace ID: %2]"
"%1 customer address updated.","%1 customer address updated."
"%1 order has been marked as cancelled","%1 order has been marked as cancelled"
"%1 order invoice has not been issued yet.","%1 order invoice has not been issued yet."
"%1 order marked as completed.","%1 order marked as completed."
"%1 order marked as partially completed.","%1 order marked as partially completed."
"%1 payment has been verified by the customer.","%1 payment has been verified by the customer."
"%1 payment terms","%1 payment terms"
"%1 requires whole order to be shipped before it can be fulfilled.","%1 requires whole order to be shipped before it can be fulfilled."
"%1 terms and conditions","%1 terms and conditions"
"* Required Fields","* Required Fields"
"API key","API key"
"API key is missing","API key is missing"
Expand All @@ -20,6 +24,7 @@
"Amount is missing","Amount is missing"
Branding,Branding
"Buy now, receive your goods, pay your invoice later.","Buy now, receive your goods, pay your invoice later."
"By checking this box, I confirm that I have read and agree to %1.","By checking this box, I confirm that I have read and agree to %1."
"By checking this box, I confirm that I have read and agree to the %1.","By checking this box, I confirm that I have read and agree to the %1."
"Check last 100 debug log records","Check last 100 debug log records"
"Check last 100 error log records","Check last 100 error log records"
Expand Down Expand Up @@ -93,11 +98,14 @@ TWO,TWO
"The capture action is not available.","The capture action is not available."
Title,Title
"Two is a payment solution for B2B purchases online, allowing you to buy from your favourite merchants and suppliers on trade credit. Using Two, you can access flexible trade credit instantly to make purchasing simple.","Two is a payment solution for B2B purchases online, allowing you to buy from your favourite merchants and suppliers on trade credit. Using Two, you can access flexible trade credit instantly to make purchasing simple."
"Unable to confirm %1 order with %2 state.","Unable to confirm %1 order with %2 state."
"Unable to find the requested %1 order","Unable to find the requested %1 order"
"Unable to retrieve payment information for your invoice purchase with %1. The cart will be restored.","Unable to retrieve payment information for your invoice purchase with %1. The cart will be restored."
Version,Version
"You must accept %1 to place order.","You must accept %1 to place order."
"You must first accept the payment terms.","You must first accept the payment terms."
"You will be redirected to %1 when you place order.","You will be redirected to %1 when you place order."
"Your invoice purchase with %1 could not be processed. The cart will be restored.","Your invoice purchase with %1 could not be processed. The cart will be restored."
"Your invoice purchase with %1 failed verification. The cart will be restored.","Your invoice purchase with %1 failed verification. The cart will be restored."
"Your invoice purchase with %1 has been cancelled. The cart will be restored.","Your invoice purchase with %1 has been cancelled. The cart will be restored."
"Your invoice purchase with %1 has been declined.","Your invoice purchase with %1 has been declined."
Expand Down
8 changes: 8 additions & 0 deletions i18n/nb_NO.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"%1 Decline reason: %2","%1 Årsak til avvisning: %2"
"%1 Details","%1 Detaljer"
"%1 [Trace ID: %2]","%1 [Sporings-ID: %2]"
"%1 customer address updated.","%1 kundeadresse oppdatert."
"%1 order has been marked as cancelled","%1 ordre er merket som kansellert"
"%1 order invoice has not been issued yet.","%1 ordrefaktura er ikke utstedt ennå."
"%1 order marked as completed.","%1 bestilling merket som fullført."
"%1 order marked as partially completed.","%1 bestilling merket som delvis fullført."
"%1 payment has been verified by the customer.","%1 betaling er bekreftet av kunden."
"%1 payment terms","%1 betalingsbetingelser"
"%1 requires whole order to be shipped before it can be fulfilled.","%1 krever at hele bestillingen sendes før den kan oppfylles."
"%1 terms and conditions","%1 vilkår og betingelser"
"* Required Fields","* Obligatoriske felter"
"API key",API-nøkkel
"API key is missing","API-nøkkel mangler"
Expand All @@ -20,6 +24,7 @@
"Amount is missing","Beløp mangler"
Branding,Merkevarebygging
"Buy now, receive your goods, pay your invoice later.","Kjøp nå, motta varene dine, betal fakturaen senere."
"By checking this box, I confirm that I have read and agree to %1.","Ved å merke av i denne boksen, bekrefter jeg at jeg har lest og godtar %1."
"By checking this box, I confirm that I have read and agree to the %1.","Ved å krysse av denne boksen bekrefter jeg at jeg har lest og godtar %1."
"Check last 100 debug log records","Sjekk siste 100 feilsøkingsloggposter"
"Check last 100 error log records","Sjekk siste 100 feilloggposter"
Expand Down Expand Up @@ -93,11 +98,14 @@ TWO,TWO
"The capture action is not available.","Opptakshandlingen er ikke tilgjengelig."
Title,Tittel
"Two is a payment solution for B2B purchases online, allowing you to buy from your favourite merchants and suppliers on trade credit. Using Two, you can access flexible trade credit instantly to make purchasing simple.","Two er en betalingsløsning for B2B-kjøp på nettet, som lar deg kjøpe fra dine favorittforhandlere og leverandører på handelskreditt. Med Two kan du få tilgang til fleksibel handelskreditt umiddelbart for å gjøre innkjøp enkelt."
"Unable to confirm %1 order with %2 state.","Kan ikke bekrefte %1 bestilling med %2 status."
"Unable to find the requested %1 order","Kan ikke finne den forespurte bestillingen %1"
"Unable to retrieve payment information for your invoice purchase with %1. The cart will be restored.","Kan ikke hente betalingsinformasjon for fakturakjøpet med %1. Vognen vil bli restaurert."
Version,Versjon
"You must accept %1 to place order.","Du må akseptere %1 for å legge inn bestillingen."
"You must first accept the payment terms.","Du må først godta betalingsvilkårene."
"You will be redirected to %1 when you place order.","Du vil bli omdirigert til %1 når du legger inn bestilling."
"Your invoice purchase with %1 could not be processed. The cart will be restored.","Fakturaen din med %1 kunne ikke behandles. Handlevognen vil bli gjenopprettet."
"Your invoice purchase with %1 failed verification. The cart will be restored.","Fakturakjøpet med %1 mislyktes i bekreftelsen. Vognen vil bli restaurert."
"Your invoice purchase with %1 has been cancelled. The cart will be restored.","Ditt fakturakjøp med %1 er kansellert. Vognen vil bli restaurert."
"Your invoice purchase with %1 has been declined.","Ditt fakturakjøp med %1 har blitt avvist."
Expand Down
8 changes: 8 additions & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"%1 Decline reason: %2","%1 Reden voor afwijzing: %2"
"%1 Details","%1 Gegevens"
"%1 [Trace ID: %2]","%1 [Trace-ID: %2]"
"%1 customer address updated.","%1 klantadres bijgewerkt."
"%1 order has been marked as cancelled","%1 bestelling is gemarkeerd als geannuleerd"
"%1 order invoice has not been issued yet.","%1 bestelfactuur is nog niet verzonden."
"%1 order marked as completed.","%1 bestelling gemarkeerd als voltooid."
"%1 order marked as partially completed.","%1 bestilling merket som delvis fullført."
"%1 payment has been verified by the customer.","%1 betaling is door de klant geverifieerd."
"%1 payment terms","%1 betalingsvoorwaarden"
"%1 requires whole order to be shipped before it can be fulfilled.","%1 vereist dat de gehele bestelling wordt verzonden voordat deze kan worden uitgevoerd."
"%1 terms and conditions","%1 voorwaarden en condities"
"* Required Fields","* Verplichte velden"
"API key",API-sleutel
"API key is missing","API-sleutel ontbreekt"
Expand All @@ -20,6 +24,7 @@
"Amount is missing","Bedrag ontbreekt"
Branding,Merknaam
"Buy now, receive your goods, pay your invoice later.","Koop nu, ontvang uw goederen, betaal uw factuur later."
"By checking this box, I confirm that I have read and agree to %1.","Door dit vakje aan te vinken, bevestig ik dat ik de %1 heb gelezen en ermee akkoord ga."
"By checking this box, I confirm that I have read and agree to the %1.","Door dit vakje aan te vinken bevestig ik dat ik de %1 heb gelezen en ermee akkoord ga."
"Check last 100 debug log records","Controleer de laatste 100 debug-logboek records"
"Check last 100 error log records","Controleer de laatste 100 foutenlogboek records"
Expand Down Expand Up @@ -93,11 +98,14 @@ TWO,TWO
"The capture action is not available.","De vastleg actie is niet beschikbaar."
Title,Titel
"Two is a payment solution for B2B purchases online, allowing you to buy from your favourite merchants and suppliers on trade credit. Using Two, you can access flexible trade credit instantly to make purchasing simple.","Two is een betalingsoplossing voor online B2B-aankopen, waarmee u op handelskrediet kunt kopen bij uw favoriete handelaren en leveranciers. Met Two heeft u direct toegang tot flexibel handelskrediet om het aankopen eenvoudig te maken."
"Unable to confirm %1 order with %2 state.","Kan %1 bestelling met %2 status niet bevestigen."
"Unable to find the requested %1 order","Kan de gevraagde %1 bestelling niet vinden"
"Unable to retrieve payment information for your invoice purchase with %1. The cart will be restored.","Betalingsgegevens voor uw aankoop op factuur met %1 kunnen niet worden opgehaald. De winkelwagen wordt hersteld."
Version,Versie
"You must accept %1 to place order.","U moet %1 accepteren om de bestelling te plaatsen."
"You must first accept the payment terms.","U moet eerst de betaalvoorwaarden accepteren."
"You will be redirected to %1 when you place order.","U wordt doorgestuurd naar %1 wanneer u een bestelling plaatst."
"Your invoice purchase with %1 could not be processed. The cart will be restored.","Uw factuuraankoop met %1 kon niet worden verwerkt. De winkelwagen wordt hersteld."
"Your invoice purchase with %1 failed verification. The cart will be restored.","Uw aankoop op factuur met %1 is niet geverifieerd. De winkelwagen wordt hersteld."
"Your invoice purchase with %1 has been cancelled. The cart will be restored.","Uw aankoop op factuur met %1 is geannuleerd. De winkelwagen wordt hersteld."
"Your invoice purchase with %1 has been declined.","Uw aankoop op factuur met %1 is geweigerd."
Expand Down
8 changes: 8 additions & 0 deletions i18n/sv_SE.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"%1 Decline reason: %2","%1 Orsak till avslag: %2"
"%1 Details","%1 Detaljer"
"%1 [Trace ID: %2]","%1 [Spår-ID: %2]"
"%1 customer address updated.","%1 kundadress uppdaterad."
"%1 order has been marked as cancelled","%1 beställning har markerats som avbruten"
"%1 order invoice has not been issued yet.","%1 orderfaktura har inte utfärdats ännu."
"%1 order marked as completed.","%1 order markerad som slutförd."
"%1 order marked as partially completed.","%1 order markerad som delvis slutförd."
"%1 payment has been verified by the customer.","%1 betalning har verifierats av kunden."
"%1 payment terms","%1 betalningsvillkor"
"%1 requires whole order to be shipped before it can be fulfilled.","%1 kräver att hela beställningen skickas innan den kan uppfyllas."
"%1 terms and conditions","%1 villkor och bestämmelser"
"* Required Fields","* Obligatoriska fält"
"API key",API-nyckel
"API key is missing","API-nyckel saknas"
Expand All @@ -20,6 +24,7 @@
"Amount is missing","Belopp saknas"
Branding,Branding
"Buy now, receive your goods, pay your invoice later.","Köp nu, få dina varor, betala din faktura senare."
"By checking this box, I confirm that I have read and agree to %1.","Genom att kryssa i denna ruta bekräftar jag att jag har läst och godkänner %1."
"By checking this box, I confirm that I have read and agree to the %1.","Genom att markera denna ruta bekräftar jag att jag har läst och godkänner %1."
"Check last 100 debug log records","Kontrollera de senaste 100 felsökningsloggposterna"
"Check last 100 error log records","Kontrollera de senaste 100 felloggposterna"
Expand Down Expand Up @@ -93,11 +98,14 @@ TWO,TWO
"The capture action is not available.","Infångningsåtgärden är inte tillgänglig."
Title,Titel
"Two is a payment solution for B2B purchases online, allowing you to buy from your favourite merchants and suppliers on trade credit. Using Two, you can access flexible trade credit instantly to make purchasing simple.","Two är en betalningslösning för B2B-köp online, som låter dig köpa från dina favorithandlare och leverantörer på handelskredit. Med Two får du omedelbar tillgång till flexibel handelskredit för att göra inköp enkelt."
"Unable to confirm %1 order with %2 state.","Kan inte bekräfta %1 beställning med %2 status."
"Unable to find the requested %1 order","Det gick inte att hitta den begärda beställningen %1"
"Unable to retrieve payment information for your invoice purchase with %1. The cart will be restored.","Det gick inte att hämta betalningsinformation för ditt fakturaköp med %1. Vagnen kommer att återställas."
Version,Version
"You must accept %1 to place order.","Du måste acceptera %1 för att göra en beställning."
"You must first accept the payment terms.","Du måste först acceptera betalningsvillkoren."
"You will be redirected to %1 when you place order.","Du kommer att omdirigeras till %1 när du beställer."
"Your invoice purchase with %1 could not be processed. The cart will be restored.","Ditt fakturaköp med %1 kunde inte behandlas. Varukorgen kommer att återställas."
"Your invoice purchase with %1 failed verification. The cart will be restored.","Ditt fakturaköp med %1 misslyckades med verifiering. Vagnen kommer att återställas."
"Your invoice purchase with %1 has been cancelled. The cart will be restored.","Ditt fakturaköp med %1 har annullerats. Vagnen kommer att återställas."
"Your invoice purchase with %1 has been declined.","Ditt fakturaköp med %1 har avvisats."
Expand Down

0 comments on commit 185790b

Please sign in to comment.