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

Notification url update Issue #68

Open
vijayNava opened this issue Dec 9, 2024 · 9 comments
Open

Notification url update Issue #68

vijayNava opened this issue Dec 9, 2024 · 9 comments

Comments

@vijayNava
Copy link

Describe the bug
We are using both API and MSI modules to achieve the order process. From this scenario, we are using MSI module notification url to update the order data from multisafepay payment. Here we are facing an issue like once sending an OK response to notify url it should stop. But still it's triggering even though we sent OK. So it is causing load a issues. So kindly help us to fix the issue.

To Reproduce
Steps to reproduce the behavior:

  1. We are using MSI API's to create an order from react js (This will be our customisation).
  2. We want to use notifications updates from the MSI plugin (We are using notification URL from MSI plugin).

Expected behavior
Once we return OK response to notification URL. It should be stop.

Screenshots
Screenshot from 2024-12-03 11-26-16

Desktop (please complete the following information):

  • we are using version 2.22 of the multisafepay module.

Additional context
Additionally, the module has been updated to 3.8.1. However, because the multisafepay msi module is deactivated,
the upgraded module displays a problem when compiling the code. MSI is not a part of our project.

Therefore, we have already deleted every Magento MSI module. However, there are some dependencies between the Magento MSI modules
and the Multisafepay MSI module. Kindly suggest to proceed further.

Error message while compiling project :
Impossible to process constructor argument Parameter #0 [ Magento\InventorySalesApi\Api\Data\ItemToSellInterfaceFactory $itemT
oSellFactory ] of MultiSafepay\ConnectMSI\Model\StockReducer classIn GetParameterClassTrait.php line 34: Class "Magento\InventorySalesApi\Api\Data\ItemToSellInterfaceFactory" does not exist

@danielcivit
Copy link
Member

Hello @vijayNava

  • We understand you are implementing customization over our modules, but we only offer support over our integration. So this is not a bug report or a new feature request.
  • However, we are open to help you as much as possible and support your business.
  • We don't understand many of your statements, like:
    • "we are using MSI module notification url" => "MSI is not a part of our project",
      " We are using version 2.22 of the MultiSafepay module." => "The module has been updated to 3.8.1."
  • You will need to explain this much much better, so we can follow you. Provide examples, code, screenshots, etc. Clear out whats version you are using, etc
  • We think we understand the error message you shared, where if you removed all MSI modules from Magento, then you don't want the MultiSafepay MSI module, which comes in the meta package as a dependency, so basically you don't need to install the meta package. Please refer to this section of our README

Looking forward to know more ...

@vijayNava
Copy link
Author

HI @danielcivit
I'm sorry for the incomprehensible remarks. I'll do my best to make sure you understand.

Bug Description
For our website, we are utilising React JS as the frontend and Magento as the backend. Therefore, we are creating an order from React JS utilising your documents and the Multisafepay APIs. However, to update the order status from Multisafpay payment, we are utilising the notification URL provided by the Multisafepay magento module.

We are sending a notification url to update the status in magento once an order status got updated in Multisafepay.
If payment gets initiated, In multisafepay dashboard shows transaction notification status as success. But when the same order gets completed or cancelled from the multisafepay, the notification calling minimum 5 times even though we acknowledge the response as OK in the first request itself and in multisafpay shows as an error.

So kindly verify why the transaction notification status for the orders in the screenshot displays an error if we acknowledge an OK response for the notification.

Screenshot from 2024-12-03 11-26-16

Expected Behaviour
It should stop and set the proper transaction notification status in multisafepay dashboard if we acknowledge an OK response notification.
Screenshot from 2024-12-12 15-53-56

Please let us know if any other inputs.

@danielcivit
Copy link
Member

Hello @vijayNava

====

Are you able to continue with your customization with these ideas/guidelines?

@vijayNava
Copy link
Author

vijayNava commented Dec 16, 2024

Hello @danielcivit,
Yes almost you are getting our order process. But still we will explain more to better understanding.

Order Process

  1. We are using your multisafepay REST API to generate payment redirect link for payment page.
    https://docs.multisafepay.com/docs/api-integration#1-create-an-order

Notification URL
3. For the notification we are using multisafepay magento module's notificationurl and we are using module version's is 2.22.
multisafepay/connect/notification/

Issue
When we use notification url from multisafepay magento module, Notification is not getting success and continuously calling.

As per the below document, we are sending notify URL and it calling properly. But the first notify gets success for payment initialized status. And same orders's gets completed or cancelled its shows error even though we sent OK and calling the notification continuously.
https://docs.multisafepay.com/docs/webhook

I have attached screenshot for your reference.
Screenshot from 2024-12-03 11-26-16
Note : From the above screenshot order (000023390) transaction notification gets success for initialized status and the same order transaction notification gets error for completed status. Could you please let us know the reason.
Account id : 90459725

We have attached some logs also to understand the issue:
[2024-12-02T12:44:30.461756+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): MultiSafepay initialize Vault process has been started [] [] [2024-12-02T12:44:30.461827+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): MultiSafepay initialize Vault process has ended [] [] [2024-12-02T12:44:30.461861+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): MultiSafepay change payment process has been started [] [] [2024-12-02T12:44:30.461889+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): MultiSafepay change payment process has ended [] [] [2024-12-02T12:44:30.466111+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): MultiSafepay transactie status: completed [] [] [2024-12-02T12:44:30.466180+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): MultiSafepay order transaction complete process has been started. [] [] [2024-12-02T12:44:33.831999+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): Order confirmation email after paid transaction has been sent [] [] [2024-12-02T12:44:33.832144+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): MultiSafepay pay order process has been started. [] [] [2024-12-02T12:44:33.862502+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): Invoice created [] [] [2024-12-02T12:44:33.862613+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): Order payment was updated [] [] [2024-12-02T12:44:33.868990+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): Transaction saved [] [] [2024-12-02T12:44:34.453745+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): Order status has been changed to: processing [] [] [2024-12-02T12:44:34.453875+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): MultiSafepay pay order process has ended. [] [] [2024-12-02T12:44:34.455145+00:00] MultiSafepay.INFO: (Order ID: 000023390) INFO: Sending invoice emails disabled (code: 0, line: 146, file: /home/promofm2st/releases/20241202073315/vendor/multisafepay/magento2-core/Service/EmailSender.php) [] [] [2024-12-02T12:44:34.599975+00:00] MultiSafepay.INFO: (Order ID: 000023390): Invoice: 000013768 update request has been sent to MultiSafepay. [] [] [2024-12-02T12:44:34.600127+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): MultiSafepay order transaction complete process has been finished successfully. [] [] [2024-12-02T12:44:34.600213+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): Payment link comment already added to the comment history, skipping [] [] [2024-12-02T12:44:34.713217+00:00] MultiSafepay.DEBUG: (Order ID: 000023390): Order has been saved. [] [] [2024-12-02T12:44:34.713646+00:00] MultiSafepay.INFO: (Order ID: 000023390): Webhook response set: ok [] []

Note and Solution
We have two query regarding our process.

  1. If we use Multisafepay API to generate payment redirect link, is that possible to use multisafepay magento modules for notification.
  2. If we update the module version, the notification issue will be sorted out or we need to use separate URL(Without module) to notification.

If its still not clear, can we connect over a call to discus this? Because it needs to be sorted out earlier.

@danielcivit
Copy link
Member

Hello @vijayNava

You should not be creating the order by directly submitting a request to the MultiSafepay API. You should be creating the order using the Magento REST API, via our module.

Please, check the following information:

===

You should upgrade to use the latest version of the MultiSafepay module.

https://github.com/MultiSafepay/magento2/releases/tag/3.8.1

===

Please consider:

  • We don't support outdated versions of our module, and we can't offer support or advice based on 2.22.
  • Check our comments in detail, and consider adjusting your approach in your custom integration to use the Magento REST API (or GraphQL). Only that way you should be able to use our notification controller to process the webhook notification request.

@vijayNava
Copy link
Author

Hi @danielcivit
We will explore the document and let you know further.
But this link not works https://github.com/MultiSafepay/magento2-internal-core/blob/3.8.1/etc/webapi.xml#L1-L45.
Screenshot from 2024-12-16 22-26-14

@danielcivit
Copy link
Member

Hi @danielcivit We will explore the document and let you know further. But this link not works https://github.com/MultiSafepay/magento2-internal-core/blob/3.8.1/etc/webapi.xml#L1-L45. Screenshot from 2024-12-16 22-26-14

This is the right link: https://github.com/MultiSafepay/magento2-core/blob/3.8.1/etc/webapi.xml#L1-L45

It contains a reference of the API endpoints.

@vijayNava
Copy link
Author

Hi @danielcivit
We have explored the documents which you provided and changing our approach. But still we have some query related our existing approach.

Is it feasible to generate a payment URL using the Multisafepay API? If we are not use the multisafepay magento modules?

If above case is possible can we use custom notification URL?

@danielcivit
Copy link
Member

  • You should be able to create a payment link via the Multisafepay API and handle the notification via a custom controller, but what's the purpose of using Magento as the backend in that case?, and since that approach is a custom solution this conversation is not related to this repository anymore, and it's really difficult to provide advice in that case.

  • If you are using Magento as the backend, and you follow the approach of creating an order via the Magento API, you will get a payment link, where the user can be redirected. The notification controller will be able to handle that one properly because everything will be done in the expected way.

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

No branches or pull requests

2 participants