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

[FRON-972] #326

Closed
wants to merge 7 commits into from
Closed

[FRON-972] #326

wants to merge 7 commits into from

Conversation

timothyOmise
Copy link
Contributor

1. Objective

Currently the magento plugin has 2 flows that will create and send invoices when merchant is using 3ds (redirect & webook). This PR aims to mitigate this issue by delaying the creation and sending of the invoices by 10secs when initiated via webhook. This delay should allow time for any redirect process to complete and update the order records to reflect that the invoice for the order has been created and sent already.

2. Description of change

A delay has been added above the 'sendInvoiceEmail' method that is called in the PendingInvoiceHandler Class handler method. The creation of the invoice from the PendingInvoiceHandler Class handler method has been moved inside the 'sendInvoiceEmail' method. A 2nd argument has been added to the 'sendInvoiceEmail' to flagh whether or not to created the invoice before sending.

A slight updated to 'Omise\Payment\Model\Api\Capabilities' class has been made. The purpose of this is to pass the exception message to the custom exception 'LocalizedException' to allow for better error debugging for interrogations.

3. Quality assurance

3DS checkout process needs to be tested. Ensure that only 1 invoice is created and sent. As we fixing a race condition there may still be very rare edge cases that still send and create 2 invoices. Therefore a 99% success rate is acceptable.

🔧 Environments:

Local php development env

i.e.

  • Platform version: Magento CE 2.4.3.
  • Omise plugin version: Omise-Magento 2.20.5.
  • PHP version: 7.4.27.

✏️ Details:

Created a order with 3DS enabled and conffirm that only 1 invoice is created and sent

4. Impact of the change

N/A

5. Priority of change

High

@sonarcloud
Copy link

sonarcloud bot commented Aug 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

1 similar comment
@sonarcloud
Copy link

sonarcloud bot commented Aug 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@aashishgurung
Copy link
Contributor

Already fixed this in other branch.

@aashishgurung aashishgurung deleted the feature/FRON-972-2 branch September 27, 2022 07:08
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.

2 participants