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

Realizado correcao do instanciamento da template #19

Open
wants to merge 1 commit into
base: master
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
17 changes: 10 additions & 7 deletions Model/PicpayInstructionsConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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;
}

/**
Expand All @@ -54,12 +60,9 @@ protected function getInstructions()
$instructions = $this->paymentHelper->getCustomHtmlForm();
}
else {
$instructions = '<img width="150px" src="https://ecommerce.picpay.com/doc/assets/picpay-logo.svg" alt="PicPay" '
. 'style="background-color: rgb(33, 194, 94); border: 0; padding: 10px;" />'
. '<br/>'
. '<p>Não conhece o PicPay? '
. '<a href="https://www.picpay.com/site" target="_blank">Clique aqui</a>'
. ' e baixe agora para efetuar seu pagamento.</p>';

$instructions = $this->template->getLayout()->createBlock('Magento\Framework\View\Element\Template')->setTemplate('Picpay_Payment::CustomForm.phtml')->toHtml();

}
return $instructions;
}
Expand Down
7 changes: 6 additions & 1 deletion i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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..."
43 changes: 43 additions & 0 deletions i18n/es_ES.csv
Original file line number Diff line number Diff line change
@@ -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 ..."
7 changes: 6 additions & 1 deletion i18n/pt_BR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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 ..."
8 changes: 8 additions & 0 deletions view/frontend/templates/CustomForm.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Custom template for PicPay Payment -->

<img width="150px" src="https://picpay.github.io/picpay-docs-digital-payments/img/PP-logo.png" alt="PicPay"
style=" border: 0; padding: 10px;" />
<br/>
<p><?php echo __('Not familiar with PicPay ?')?>
<a href="https://www.picpay.com/site" target="_blank"><?php echo __('Click here')?></a>
<?php echo __(' and download now to make your payment.')?></p>
2 changes: 1 addition & 1 deletion view/frontend/templates/picpay/callback.iframe.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $isSecure = $picpayHelper->isCurrentlySecure();
<?php if($picpayHelper->getMessageIframeCallback()): ?>
<?php echo $picpayHelper->getMessageIframeCallback();?>
<?php else: ?>
<p>Seu pedido foi aprovado.<br/>Confira os detalhes do seu pedido a seguir ...</p>
<p><?php echo __('Your order has been approved.')?><br/><?php echo __('Check your order details below...')?></p>

<?php if($order && $order->getId()): ?>
<script type="text/javascript">
Expand Down
4 changes: 2 additions & 2 deletions view/frontend/templates/picpay/form/picpay.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
<img width="150px" src="<?php echo $this->getSkinUrl("images/picpay/picpay-logo.png"); ?>" alt="PicPay" />
<br/>

<p>Não conhece o PicPay? <a href="https://www.picpay.com/site" target="_blank">Clique aqui</a> e baixe agora para efetuar seu pagamento.</p>
<p><?php echo __('Not familiar with PicPay ?')?><a href="https://www.picpay.com/site" target="_blank"><?php echo __('Click here')?></a><?php echo __(' and download now to make your payment.')?></p>
<?php endif; ?>
</li>

</ul>

<?php echo __('Follow Us')?>