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

Feature/174160060 support to sandbox in m2 #53

Conversation

jrudani
Copy link
Contributor

@jrudani jrudani commented Aug 20, 2020

Changes as requested in PR #52

@r-martins
Copy link
Owner

r-martins commented Aug 21, 2020

Thanks for the update @jrudani .
I can confirm the "Pagar no PagSeguro" (Redirect) is now working on the correct url.
I also found the following problems/errors:

  1. In orders placed with the above method in Sandbox, the message "Ambiente de Testes" is not displayed in the block info in the admin.
  2. When opening an order with _cc method, I got the error Notice: Undefined index: is_sandbox in /var/www/html/app/code/RicardoMartins/PagSeguro/view/adminhtml/templates/info/cc.phtml on line 6, and couldn't see the order. I guess the issue only happens to old transactions or those placed with sandbox mode turned off. Please check if the problem occurs in the frontend block too for the client that tries to see its order in the customer area.
  3. The notification still doesn't work, and it's probably because the url you're using is incorrect. For example, when sending the notificationCode 93DC0FF3DD54DD54B885546EBF91BA8D74B4, the sandbox url you use is https://ws.sandbox.pagseguro.uol.com.br/v2/transactions/notifications/93DC0FF3DD54DD54B885546EBF91BA8D74B4?token=0&email=v47654530968559692463%40sandbox.pagseguro.com.br, which would return some error or Not found. The correct as we see in M1 would be https://ws.ricardomartins.net.br/pspro/v7/wspagseguro/v2/transactions/notifications/93DC0FF3DD54DD54B885546EBF91BA8D74B4?public_key=PUBC468779D3E884CD690ACB09FC42B5A0D&isSandbox=1 where Public key is the sandbox public key. Ideally (not mandatory atm) those URL's preffixes should be defined in config.xml (as in M1).

Thanks in advance. We are almost there.

@@ -134,6 +134,7 @@ public function order(InfoInterface $payment, $amount)
$code = (string)$returnXml->code;
if($this->pagSeguroHelper->isSandbox()) {
$redirectUrl = 'https://sandbox.pagseguro.uol.com.br/v2/checkout/payment.html?code=' . $code;
$payment->setAdditionalInformation(array('is_sandbox' => '1'));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to use new array syntax [] to reduce code quality issues.

@r-martins
Copy link
Owner

r-martins commented Aug 25, 2020

Hi @jrudani
I just reviewed it again. You've solved the other problem related to error when displaying older CC orders in the admin, but the other 2 issues remains untouched.

  1. It still using the wrong url (as described in item 3 in my previous msg)
  2. It still doesn't show the message about test environment in admin block for orders placed using rm_pagseguro_pagar_no_pagseguro method.

@r-martins r-martins closed this Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants