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

[ECP-9064] Make asynchronous POS flow configurable #2566

Merged
merged 8 commits into from
Apr 8, 2024

Conversation

candemiralp
Copy link
Member

@candemiralp candemiralp commented Mar 25, 2024

Description

The new asynchronous POS cloud payment flow contains some breaking changes for the merchants who have already implement POS payments into their V9 stores. This PR introduces configuration Order Creation Time field for In-person payments to make POS flow synchronous/asynchronous. This field has two potential values where having Before payment by default.

  • Before payment: Order will be created first then payment will be initiated. (More robust, allows asynchronous webhook to finalise the order in case of network degradation)
  • After payment: Payment will be completed first then order will be created. (Fragile in case of network degradation, payment might be lost)

Tested scenarios

  • Synchronous/asynchronous payment flows for POS cloud payments
  • Intentional network disruption and finalise the order with async webhook event

Copy link

sonarcloud bot commented Apr 5, 2024

@candemiralp candemiralp merged commit 541c621 into feature/asyncPosFlow Apr 8, 2024
9 checks passed
@candemiralp candemiralp deleted the ECP-9064 branch April 8, 2024 09:31
RokPopov added a commit that referenced this pull request Apr 18, 2024
* [ECP-8912] Make Pos payments flow async (#2498)

* ECP-8912/Make-POS-payments-flow-async

* refactor

* Make POS async

* pos async

* pos async

* fix TypeError: Magento\Payment\Gateway\Data\PaymentDataObject::__construct(): Argument #1 ($order) must be of type Magento\Payment\Gateway\Data\OrderAdapterInterface, Magento\Sales\Model\Order\Interceptor given, called in /var/www/html/vendor/adyen/module-payment/Model/Api/AdyenPosCloud.php on line 54 and defined in /var/www/html/app/code/Magento/Payment/Gateway/Data/PaymentDataObject.php:26

* tuning backend of async

* fix FE call

* fixes

* clean up

* Refactor SubmitQuoteObserver

* Refactor adyen-pos-cloud-method.js

* put the correct status

* Add test coverage for AdyenPosCloud & GuestAdyenPosCloud

* Add test coverage for PaymentPosCloudHandlerTest

* Add test coverage for SetOrderStateAfterPaymentObserverTest

* Comments refactor

* rename handleFaildResponse to handleFailedResponse

* Terminal API does not return Authorised result code.

* Update Plugin/GuestPaymentInformationResetOrderId.php

* Update Plugin/PaymentInformationResetOrderId.php

* Update events.xml

---------

Co-authored-by: Peter Ojo <[email protected]>
Co-authored-by: Can Demiralp <[email protected]>

* [ECP-9064] Make asynchronous POS flow configurable (#2566)

* [ECP-9064] Define new configuration field and getter for payment action

* [ECP-9064] Pass payment_action config to frontend

* [ECP-9064] Use POS payment action value on frontend and observers logic

* [ECP-9064] Use constant definition for payment action field

* [ECP-9064] Fix unit tests

* [ECP-9064] Fix unit tests

* [ECP-9064] Formatting

* [ECP-9064] Update unit tests

---------

Co-authored-by: Can Demiralp <[email protected]>

* Update the tooltip and the label of the configuration field

* Update unit tests

---------

Co-authored-by: hossam-adyen <[email protected]>
Co-authored-by: Peter Ojo <[email protected]>
Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: Rok Popov Ledinski <[email protected]>
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.

3 participants