From d72285e9c9df1eebeda11029e9212d1eac2233ef Mon Sep 17 00:00:00 2001 From: Mauricio Antonio da Silva Date: Tue, 6 Jul 2021 16:24:51 -0300 Subject: [PATCH] Realizado correcao do instanciamento da template + criacao de template para traducao + insercao do idioma espanhol (traduzido) --- Model/PicpayInstructionsConfigProvider.php | 17 +++++--- i18n/en_US.csv | 7 ++- i18n/es_ES.csv | 43 +++++++++++++++++++ i18n/pt_BR.csv | 7 ++- view/frontend/templates/CustomForm.phtml | 8 ++++ .../templates/picpay/callback.iframe.phtml | 2 +- .../templates/picpay/form/picpay.phtml | 4 +- 7 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 i18n/es_ES.csv create mode 100644 view/frontend/templates/CustomForm.phtml diff --git a/Model/PicpayInstructionsConfigProvider.php b/Model/PicpayInstructionsConfigProvider.php index c1ff70c..cf6ba9f 100644 --- a/Model/PicpayInstructionsConfigProvider.php +++ b/Model/PicpayInstructionsConfigProvider.php @@ -5,6 +5,7 @@ use Magento\Checkout\Model\ConfigProviderInterface; use Magento\Framework\Escaper; use Picpay\Payment\Helper\Data as PaymentHelper; +use Magento\Framework\View\Element\Template; class PicpayInstructionsConfigProvider implements ConfigProviderInterface { @@ -22,12 +23,17 @@ class PicpayInstructionsConfigProvider implements ConfigProviderInterface * @param PaymentHelper $paymentHelper * @param Escaper $escaper */ + + protected $template; + public function __construct( PaymentHelper $paymentHelper, - Escaper $escaper + Escaper $escaper, + Template $template ) { $this->escaper = $escaper; $this->paymentHelper = $paymentHelper; + $this->template = $template; } /** @@ -54,12 +60,9 @@ protected function getInstructions() $instructions = $this->paymentHelper->getCustomHtmlForm(); } else { - $instructions = 'PicPay' - . '
' - . '

Não conhece o PicPay? ' - . 'Clique aqui' - . ' e baixe agora para efetuar seu pagamento.

'; + + $instructions = $this->template->getLayout()->createBlock('Magento\Framework\View\Element\Template')->setTemplate('Picpay_Payment::CustomForm.phtml')->toHtml(); + } return $instructions; } diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 57bcde9..bfd6318 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -35,4 +35,9 @@ "In pixels. Just numbers.","In pixels. Just numbers." "Set the sequence number of this payment method in the checkout. Payment methods with a higher sort order number will be displayed lower in the list.","Set the sequence number of this payment method in the checkout. Payment methods with a higher sort order number will be displayed lower in the list." "Enable with want build a custom HTML form in Checkout","Enable with want build a custom HTML form in Checkout" -"Accept html. The extension has a default message on checkout.","Accept html. The extension has a default message on checkout." \ No newline at end of file +"Accept html. The extension has a default message on checkout.","Accept html. The extension has a default message on checkout." +"Not familiar with PicPay ?","Not familiar with PicPay ?" +"Click here","Click here" +" and download now to make your payment."," and download now to make your payment." +"Your order has been approved.","Your order has been approved." +"Check your order details below...","Check your order details below..." \ No newline at end of file diff --git a/i18n/es_ES.csv b/i18n/es_ES.csv new file mode 100644 index 0000000..2d62780 --- /dev/null +++ b/i18n/es_ES.csv @@ -0,0 +1,43 @@ +"Cannot create an invoice without products.","No es posible generar la factura sin productos impagos." +"Order invoiced by API notification. Authorization Id: ","Pedido facturado mediante notificación API. ID de autorización:" +"Select the taxvat attribute","Seleccione el atributo TAXVAT" +"There isn't invoice to refund on order ","No hay factura para reembolsar" +"Sync Picpay Transaction","Sincronizar pedido con Picpay" +"Are you sure you want to Sync Picpay Transaction?","¿Está seguro de que desea forzar la sincronización de pedidos con Picpay?" +"Order canceled with success at Picpay.","Pedido cancelado correctamente en Picpay." +"Error while try refund order. ","Se produjo un error durante el reembolso del pedido." +"Unable to process refund payment. Contact Us.","No pudimos procesar el reembolso del pago. Contáctenos." +"Invalid payment url","URL de pago no válida" +"Enable","Habilitado" +"Title","Título" +"Checkout Mode","Modo de funcionamiento al finalizar la compra" +"Iframe width on iframe Mode","Checkout Iframe Width en modo iframe" +"Iframe height on iframe Mode","Altura de iframe de pago en modo iframe" +"Iframe callback message after paid","Mensaje personalizado que se mostrará después de que se detecte el pago" +"Qrcode width on Onpage Mode","Ancho del código QR en el modo On Page" +"Message to show with qrcode on success page","Mensaje de instrucciones que se mostrará con QRcode" +"Qrcode width on info payments","Ancho del código QR en la información de pago" +"API Picpay Token","API de Picpay Token" +"API Seller Token","API de vendedor de tokens" +"Order status: order creation","Estado del pedido creado" +"Status given to newly created orders before payment result confirmation via server notifications.","Estado que se utiliza al crear el pedido desde el método de pago PicPay." +"Use custom form","¿Usar formulario personalizado?" +"Custom html form","HTML personalizado para formulario de pago" +"Customer document attribute","Atributo CPF" +"If your store use a customer ID custom ttribute, select here.","Seleccione el atributo CPF de su tienda." +"If your store use a custom telephone attribute, select here.","Seleccione el atributo de teléfono de su tienda" +"Customer address attribute","Dirección del cliente" +"Enable status order notification","Habilitar notificaciones de API" +"Payment from applicable countries","Países aplicables" +"Payment from specific countries","Pago de países específicos" +"Enable debug logging","Habilitar el registro de depuración" +"Sort Order","Ordenar" +"In pixels. Just numbers.","En píxeles. Sólo números." +"Set the sequence number of this payment method in the checkout. Payment methods with a higher sort order number will be displayed lower in the list.","Para solicitar los métodos de pago en la sección de pago de caja" +"Enable with want build a custom HTML form in Checkout","Habilite si desea utilizar HTML personalizado en el formulario de pago al finalizar la compra" +"Accept html. The extension has a default message on checkout.","Acepta html. Ya existe un mensaje predeterminado si no desea hacer algo personalizado." +"Not familiar with PicPay ?","¿No estás familiarizado con PicPay?" +"Click here","Haga clic aquí" +" and download now to make your payment."," y descárguelo ahora para realizar su pago." +"Your order has been approved.","Su pedido ha sido aprobado." +"Check your order details below...","Verifique los detalles de su pedido a continuación ..." \ No newline at end of file diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index 9435cd2..f0a9150 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -35,4 +35,9 @@ "In pixels. Just numbers.","Em pixels. Apenas números." "Set the sequence number of this payment method in the checkout. Payment methods with a higher sort order number will be displayed lower in the list.","Para ordenação das formas de pagamento na seção de pagamento do checkout" "Enable with want build a custom HTML form in Checkout","Habilite caso queira utilizar HTML personalizado no form de pagamento no checkout" -"Accept html. The extension has a default message on checkout.","Accept html. Já existe uma mensagem padrão caso não queria fazer algo personalizado." \ No newline at end of file +"Accept html. The extension has a default message on checkout.","Accept html. Já existe uma mensagem padrão caso não queria fazer algo personalizado." +"Not familiar with PicPay ?","Não conhece o PicPay ?" +"Click here","Clique aqui" +" and download now to make your payment."," e baixe agora para efetuar seu pagamento." +"Your order has been approved.","Seu pedido foi aprovado." +"Check your order details below...","Confira os detalhes do seu pedido a seguir ..." \ No newline at end of file diff --git a/view/frontend/templates/CustomForm.phtml b/view/frontend/templates/CustomForm.phtml new file mode 100644 index 0000000..a79179e --- /dev/null +++ b/view/frontend/templates/CustomForm.phtml @@ -0,0 +1,8 @@ + + +PicPay +
+

+ +

\ No newline at end of file diff --git a/view/frontend/templates/picpay/callback.iframe.phtml b/view/frontend/templates/picpay/callback.iframe.phtml index 0b3b8d8..07a6fce 100644 --- a/view/frontend/templates/picpay/callback.iframe.phtml +++ b/view/frontend/templates/picpay/callback.iframe.phtml @@ -17,7 +17,7 @@ $isSecure = $picpayHelper->isCurrentlySecure(); getMessageIframeCallback()): ?> getMessageIframeCallback();?> -

Seu pedido foi aprovado.
Confira os detalhes do seu pedido a seguir ...

+


getId()): ?>