-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
payment/details
api call was performed.
src/SprykerEco/Zed/Adyen/Business/Handler/Redirect/OnlineTransferRedirectHandler.php
Outdated
Show resolved
Hide resolved
…gfix/supesc-280-adyen-sends-information-about-refused-authorization-which-needs-to-be-checked
payment/details
api call was performed.payment/details
API call was performed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think, you should also mention changes
AdyenFacade::handleOnlineTransferResponseFromAdyen()
andAdyenFacade::handleCreditCard3dResponseFromAdyen()
in the change log. - Release Type looks like minor not patch.
- The bug MUST be tested. Please, add coverage for this case in FacadeTest.
src/SprykerEco/Zed/Adyen/Business/Handler/Redirect/OnlineTransferRedirectHandler.php
Outdated
Show resolved
Hide resolved
…esc-280-adyen-sends-information-about-refused-authorization-which-needs-to-be-checked � Conflicts: � tests/SprykerEcoTest/Zed/Adyen/Business/BaseSetUpTest.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We shouldn't describe
GatewayController
in the change log. - Please, use the template to describe changes and avoid the technical details. Describe the business logic changes.
- Please, think a bit about how to improve PR/RG title based on our requirements.
- Fix Travis.
tests/SprykerEcoTest/Zed/Adyen/_support/_generated/AdyenZedTesterActions.php
Outdated
Show resolved
Hide resolved
…-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
Please fix change logs markup. methods should be |
@@ -85,6 +85,15 @@ public function handle(AdyenRedirectResponseTransfer $redirectResponseTransfer): | |||
return $redirectResponseTransfer; | |||
} | |||
|
|||
$resultCodeLower = strtolower($responseTransfer->getPaymentDetailsResponseOrFail()->getResultCode()); | |||
if ($resultCodeLower === $this->config->getAdyenPaymentStatusRefused()) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//Arrange | |
// Arrange |
same for similar cases
$redirectResponseTransfer = $this->createRefusedRedirectResponseTransfer($orderTransfer); | ||
|
||
//Act | ||
$result = $facade->handleOnlineTransferResponseFromAdyen($redirectResponseTransfer); |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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
Developer(s): @herasimenko1987, @Zingeon
Ticket: https://spryker.atlassian.net/browse/SUPESC-280
Release Group: https://release.spryker.com/release-groups/view/3863
merge: squash
Release Table
Module Adyen
Change log
Improvements
AdyenFacade::handleOnlineTransferResponseFromAdyen()
so it handles refused authorisation from the API.AdyenFacade::handleCreditCard3dResponseFromAdyen()
so it handles refused authorisation from the API.AdyenConfig::getAdyenPaymentStatusRefused()
.