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

Added PrePaymentDataBuildEvent and implemented dispatch in the abstra… #469

Closed
wants to merge 1 commit into from
Closed

Added PrePaymentDataBuildEvent and implemented dispatch in the abstra… #469

wants to merge 1 commit into from

Conversation

MattMaes
Copy link

…ctPaymentMethodHandler

Summary

There's a possibility in Shopware to have a custom crediting system, be it a rewards program, customer balance or other things that affect the remaining amount of an order.
When using the adyen plugin at the time of writing, it's impossible to apply this to the payment as Adyen always sends either the full amount or the partial amount (defined by adyen plugin).

In order to make the above scenario possible, I introduced an event so that a developer can use this hook to make changes accordingly.

Tested scenarios

  • Without changes: orders still work as intended - nothing has changed
  • Subscribed to the event and changed the amount: only that amount has to be paid through Adyen

@MattMaes MattMaes requested a review from a team as a code owner March 19, 2024 15:34
Copy link

sonarcloud bot commented Mar 19, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@candemiralp
Copy link
Member

Hello @MattMaes,

Thank you for your contribution. Your case seems to be a valid one but I still have some questions about the implementation.

If the plugin only uses the amount coming from PrePaymentDataBuildEvent while authorising a payment, this implementation might create an issue on AuthorisationWebhookHandler. Since the transaction amount will not be equal to the notification amount, order status will not be updated.

In this case, I expect transaction amount to be the full amount (Adyen payment + shopper credit) however notification only contains Adyen payment amount.

What would you think about this case from the perspective of webhooks?

Best regards,
Can

@MattMaes MattMaes closed this by deleting the head repository May 13, 2024
@sneakyvv
Copy link
Contributor

FYI: this is a new (better if I say so myself) approach => #516

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