omise / omise-magento

Omise Magento Plugin
https://docs.opn.ooo/magento-plugin
MIT License
34 stars 19 forks source link

[ENGA3-618]: Issue of credit memo not creating on webhook has been fixed #401

Closed aashishgurung closed 1 year ago

aashishgurung commented 1 year ago

1. Objective

Fix the issue of credit memo being not created on webhook.

2. Description of change

Change the webhook event from charge.complete to charge.capture so that webhook triggers the code that creates invoices because without invoice we can't create credit memo. We created CreditMemoService that abstracts the creation of credit memo from refund classes. We added the CreditMemoService class into the RefundSyncStats and WebhookRefundObserver.php as dependency and used its create method to generate credit memo.

###Edit### Added back charge.complete as it is required for webhook flow. Now, we listen to both charge.complete and charge.capture, later for manual capture.

3. Quality assurance

Check credit memo creation on webhook and Sync order status.

🔧 Environments:

sonarcloud[bot] commented 1 year ago

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 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication