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

SUPESC-280: Added a result code check when a payment/details API call was performed. #39

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

herasimenko1987
Copy link

@herasimenko1987 herasimenko1987 commented Oct 23, 2021

Release Table

Module Release Type Constraint Updates
Adyen minor

Module Adyen

Change log

Improvements

  • Adjusted AdyenFacade::handleOnlineTransferResponseFromAdyen() so it handles refused authorisation from the API.
  • Adjusted AdyenFacade::handleCreditCard3dResponseFromAdyen() so it handles refused authorisation from the API.
  • Introduced AdyenConfig::getAdyenPaymentStatusRefused().

@herasimenko1987 herasimenko1987 changed the title SUPESC-280: Added check on a refused result code when payment details api call performs. SUPESC-280: Added check on a refused result code when a payment details api call performs. Oct 23, 2021
@herasimenko1987 herasimenko1987 changed the title SUPESC-280: Added check on a refused result code when a payment details api call performs. SUPESC-280: Added a refused result code check when a payment details api call performed. Oct 25, 2021
@herasimenko1987 herasimenko1987 changed the title SUPESC-280: Added a refused result code check when a payment details api call performed. SUPESC-280: Added a result code check when a payment details api call was performed. Oct 25, 2021
@herasimenko1987 herasimenko1987 changed the title SUPESC-280: Added a result code check when a payment details api call was performed. SUPESC-280: Added a result code check when a payment/details api call was performed. Oct 25, 2021
…gfix/supesc-280-adyen-sends-information-about-refused-authorization-which-needs-to-be-checked
@dmytro-sokolovskyi dmytro-sokolovskyi changed the title SUPESC-280: Added a result code check when a payment/details api call was performed. SUPESC-280: Added a result code check when a payment/details API call was performed. Jan 12, 2022
Copy link

@dmytro-sokolovskyi dmytro-sokolovskyi left a comment

Choose a reason for hiding this comment

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

  1. I think, you should also mention changes AdyenFacade::handleOnlineTransferResponseFromAdyen() and AdyenFacade::handleCreditCard3dResponseFromAdyen() in the change log.
  2. Release Type looks like minor not patch.
  3. The bug MUST be tested. Please, add coverage for this case in FacadeTest.

herasimenko1987 and others added 5 commits January 12, 2022 15:00
…esc-280-adyen-sends-information-about-refused-authorization-which-needs-to-be-checked

� Conflicts:
�	tests/SprykerEcoTest/Zed/Adyen/Business/BaseSetUpTest.php
Copy link

@dmytro-sokolovskyi dmytro-sokolovskyi left a comment

Choose a reason for hiding this comment

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

  1. We shouldn't describe GatewayController in the change log.
  2. Please, use the template to describe changes and avoid the technical details. Describe the business logic changes.
  3. Please, think a bit about how to improve PR/RG title based on our requirements.
  4. Fix Travis.

…-authorization-which-needs-to-be-checked' of github.com:spryker-eco/adyen into bugfix/supesc-280-adyen-sends-information-about-refused-authorization-which-needs-to-be-checked
@kkicheglovspryker
Copy link
Contributor

Please fix change logs markup. methods should be highlighted.

@kkicheglovspryker kkicheglovspryker added the bug Something isn't working label Sep 28, 2022
@@ -85,6 +85,15 @@ public function handle(AdyenRedirectResponseTransfer $redirectResponseTransfer):
return $redirectResponseTransfer;
}

$resultCodeLower = strtolower($responseTransfer->getPaymentDetailsResponseOrFail()->getResultCode());
if ($resultCodeLower === $this->config->getAdyenPaymentStatusRefused()) {

Choose a reason for hiding this comment

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

$this->config->getAdyenPaymentStatusRefused() call result could be moved to a variable to not call it twice

*
* @return \Generated\Shared\Transfer\AdyenRedirectResponseTransfer
*/
protected function createRefusedRedirectResponseTransfer(OrderTransfer $orderTransfer): AdyenRedirectResponseTransfer

Choose a reason for hiding this comment

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

this method duplicates code from createRedirectResponseTransfer
result code could be passed as an argument instead

*/
public function testHandleOnlineTransferResponseFromAdyenWithRefusedStatus(): void
{
//Arrange

Choose a reason for hiding this comment

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

Suggested change
//Arrange
// Arrange

same for similar cases

$redirectResponseTransfer = $this->createRefusedRedirectResponseTransfer($orderTransfer);

//Act
$result = $facade->handleOnlineTransferResponseFromAdyen($redirectResponseTransfer);

Choose a reason for hiding this comment

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

result naming is unacceptable
facade returns AdyenRedirectResponseTransfer
what is the reason you use result?

$result = $facade->handleOnlineTransferResponseFromAdyen($redirectResponseTransfer);

//Assert
$this->assertEquals(static::REDIRECT_RESPONSE_RESULT_CODE_REFUSED, $result->getResultCode());

Choose a reason for hiding this comment

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

never use assertEquals on non-object types
assertSame must be used instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working request-AA-review
Development

Successfully merging this pull request may close these issues.

7 participants